Ljudi imam i jedan problem, postavio sam PHP skripte na sajt u tri fajla, ali nikako da prebacim podatke metodom POST
evo i skripti:
----------------------------------------------------------------------------------------------------------------
// INDEX.PHP
<html>
<head>
<title>My Guestbook</title>
</head>
<body>
<a href="sign.php">Sign my Guestbook</a>
<?php
$hostname="localhost"; // Your MySQL hostname
$user="*****"; // Your MySQL username
$pass="******"; // Your MySQL password
$dbase="******"; // Your MySQL database name
$connection = mysql_connect("$hostname" , "$user" , "$pass");
$db = mysql_select_db($dbase , $connection);
$q="SELECT * from guestbook order by date desc";
$result= mysql_db_query($dbase, $q, $connection) or die ("Error : $q." . mysql_error());
while ($row=mysql_fetch_array($result))
{
$id=$row["id"];
$name=$row["name"];
$email=$row["email"];
$sitename=$row["sitename"];
$siteurl=$row["url"];
$date=$row["date"];
$comments=$row["comments"];
$answer=$row["answer"];
/* This is how the separate entries'll look like. This example is a simple table. If you change it, be sure not to lose the variables. */
print "<table border=1 cellspacing=0><tr><td><a href=mailto:$email>$name</a>
| <a href=$siteurl target=_blank>$sitename</a> | $date
<tr><td>$comments<tr><td><i>$answer</i></table>";
}
?>
</body>
</html>
-----------------------------------------------------------------------------------------------------------------
// sign.php
<html>
<head>
<title>My Guestbook</title>
</head>
<body>
<form action="guestbook.php" method="POST">
Name: <input type="text" name="name" value="">
Email:<input type="text" name="email" value="">
Site URL:<input type="text" name="url" value="
http://">
Site name:<input type="text" name="sitename" value="">
Comments:<textarea name="comments" cols="40" rows="5"></textarea>
<input type="submit" value="Sign it!"><input type="reset" value="Clear it!">
</form>
</body>
</html>
-----------------------------------------------------------------------------------------------------------------
// guestbook.php
<?php
$hostname="localhost"; // Your MySQL hostname
$user="*****"; // Your MySQL username
$pass="******"; // Your MySQL password
$dbase="******"; // Your MySQL database name
$connection = mysql_connect("$hostname" , "$user" , "$pass");
$db = mysql_select_db($dbase , $connection);
$q="INSERT into guestbook (id,name,email,siteurl,sitename,comments,date) VALUES ('','$name','$email','$url','$sitename','$comments',now())";
$result= mysql_db_query($dbase, $q, $connection) or die ("Error. Please try again or contact the webmaster. : $q." . mysql_error());
if ($result)
{
// Redirects the user back to your index.php file.
print ("<html><head><meta http-equiv=\"Refresh\" content=\"0;URL=index.php\">
<p>
Going back to <a href=\"index.php\">guestbook</A>:...
");
}
?>
</body></html>
------------------------------------------------------------------------------------------------------------------
Samo mi sacuva Datum i nista vise, pomozite!