Hi,
It looks pretty standard to me. And the names display correctly on the page insertcontacts.php? Of course the "//" on the line you define the query string $query would normally cause php to treat the line as a comment instead of assigning the text to the variable. That would effectively mean you are passing a null string to the mysql_query function. The only other possibility I can think of is no db connection established on the target page. I think each page needs that, but correct me if I'm wrong....
HTH
Ray
Hi Ray,
Here is my form code:
<h2>Enter a New contacts</h2> <form name=formMaker method=post action="insertcontacts.php"> <table>
<tr height=30 valign=top> <td align=right><b>Name :</b></td> <td> <input type="text" name="nameField"> </td> </tr>
<tr height=30 valign=top> <td align=right><b>Surname :</b></td> <td> <input type="text" name="surnameField"> </td> </tr>
</table>
<input type=submit name=Submit value="Submit"> <input type=reset name=Submit2 value="Reset"> </form>
And here is my insert code:
<?
//$query="insert into contacts (name,surname) VALUES ('$nameField','$surnameField')";
$result = MYSQL_QUERY($query);
?>
<H2>New Contacts Created !!</H2>
<table> <tr height=30> <td align=right><b>Name :</b></td> <td><font color=blue><b><? echo $nameField; ?></font></b></td> </tr> <tr height=30> <td align=right><b>Surname :</b></td> <td><font color=blue><b><? echo $surnameField; ?></font></b></td> </tr> </table><br><br> Click <a href="form.php">here</a> to go back to Main Menu
------------------------------------------------------- To unsubscribe please go to http://www.sambar.ch/list/
------------------------------------------------------- To unsubscribe please go to http://www.sambar.ch/list/
