I am attemptng get php working for the first time using forms I copied from a book. You enter details into a form in sign.php and they are processed by create_entry.php
The forms hang together fine, and create_entry.php even updates the mysql database as it is supposed to. However the fields entered in sign.php do not have values in create_entry.php code.
I modified sign.php to method=get so that the values from sign.php could be seen in the passing url. They are in the URL correctly but when I try to use them in the php code of the second form they are empty.
Notes that may be helpful
a) windows 2k pro machine
b) running Foxserv version of Appache, PHP and mysql, so I think they are the latest
c) In the URL it looks like "Sign!" had the value "Sign%21". Is this normal? Do you get the value "Sign!" when you use the variable in your code?
d) forms cut and paist below, including my weak debugging code
SIGN.PHP
<?php include("dbconnect.php"); ?>
<h2>Sign my Guest Book!!!</h2>
<form method=get action="create_entry.php">
<b>Name:</b>
<input type=text size=40 name=name>
<br>
<b>Location:</b>
<input type=text size=40 name=location>
<br>
<b>Email:</b>
<input type=text size=40 name=email>
<br>
<b>Home Page URL:</b>
<input type=text size=40 name=url>
<br>
<b>Comments:</b>
<textarea name=comments cols=40 rows=4 wrap=virtual></textarea>
<br>
<input type=submit name=submit value="Sign!">
<input type=reset name=reset value="Start Over">
</form>
CREATE ENTRY.PHP
<?php include("dbconnect.php"); ?>
<?php
$submit = "Signy";
if ($submit == "Signx")
{ print "<b>Sign! from dbconnect</b>";
$query = "insert into guestbook "
." (name,location,email,url,comments) values "
."('$name', '$location', '$email', '$url', '$comments')"
;
mysql_query($query);
print "name";
print $name;
?>
<h2>Thanks from dbconenct!!</h2>
<h2><a href="view.php">View My Guest Book!!!</a></h2>
<?php
}
else
{ $a = "AAAA";
print $a;
print $submit;
print "<b>Else in dbconnect</b>";
include("sign.php");
}
?>