where is my form or script breaking?

Hello. I designed the attached contact page as a dynamic form in DW. I also attached the accompanying .php script that posts it to phpmyadmin. It shows that the table has recieved something from the form but none of the data entered into the form is visable. Can anyone tell me where this form is breaking? I have attached an image of both the structure and browse view in myphpadmin. Thanks a heap.


<fieldset> <h3>&nbsp;</h3> <form id="form1" name="form1" method="POST" action="gogreencontact.php"> <h3> <label for="yourname">Your Name:</label> <input type="text" name="yourname" id="yourname" /> </h3> <h3> <label for="youremail">Your E-Mail:</label> <input type="text" name="youremail" id="youremail" /> </h3> <h3> <label for="subject"> Subject:</label> <img src="gogreenholder.gif" width="30" height="21" alt="gogreenholder" /> <input type="text" name="subject" id="subject" /> </h3> <h3> <label for="gogreenmessage"> Message: <img src="gogreenholder.gif" width="17" height="21" alt="gogreenholder" /> <textarea name="gogreenmessage" id="gogreenmessage" cols="30" rows="3"></textarea> </label> </h3> <p align="right"> <p><input name="formsubmit" type="submit" value="Submit" /> </p> </form> </fieldset>




$hostname_gogreencomputerservices =
$database_gogreencomputerservices =
$username_gogreencomputerservices =
$password_gogreencomputerservices =
$con = mysql_pconnect($hostname_gogreencomputerservices, $username_gogreencomputerservices, $password_gogreencomputerservices) or trigger_error(mysql_error(),E_USER_ERROR);

$yourname = $_POST[‘YourName’];
$youremail = $_POST[‘YourEMail’];
$subject = $_POST[‘Subject’];
$message = $_POST[‘Message’];

mysql_select_db(“xxxxxxxxxx”, $con);
$sql=“INSERT INTO gogreencontact (YourName, YourEMail, Subject, Message) values (’$yourname’, ‘$youremail’, ‘$subject’, ‘$message’)”;

header( “Location: http://www.gogreencomputerservices.com/PandAs.html” );

mysql_query($sql, $con) or die ("
Query string: $sql
Produced error: " . mysql_error() . ‘


I don’t know how to attach the images that show the results in phpmyadmin. But Thanks.

you appear to be looking for incorrect $_post variables…

[php]$yourname = $_POST[‘YourName’];
name=“yourname” id=“yourname”[/php]

you need to change to either all lowercase: [php]$_POST[‘yourname’] | name=“yourname”[/php]
or use camelCase for both: [php]$_POST[‘YourName’] | name=“YourName”[/php]

Hope that helps,
Red :wink:

SOLVED: Thank you.
I will forever put the code in all lowercase. Thank you so much. Now I am going to the other html & php scripts and code to change them all to reflect what I have learned. Thank you, again.

No worries, glad I could help,
Red :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service