Jump to content

Parse error: syntax error, unexpected T_STRING in mysql Instert


blink359

Recommended Posts

Im having a problem making an insert script i keep getting Parse error: syntax error, unexpected T_STRING in /home/a9855336/public_html/mail.php on line 46 and im not sure what to do here is my code

32<form action="mail.php" method="post">
33Name: <input type="text" name="name" /><br />
34Email: <input type="text" name="email" /><br />
35<input type="submit" />
36</form> 
37<?php
38$mysql_host = "mysql12.000webhost.com";
39$mysql_database = "a9855336_mail";
40$mysql_user = "a9855336_root";
41$mysql_password = "n4th4n";
42
43mysql_connect("$mysql_host","$mysql_host","$mysql_password");
44mysql_select_db("$mysql_database);
45
46mysql_query("INSERT INTO mail 
47(name, email) VALUES('$_POST['name']', '$_POST['email']' ) ") 
48or die(mysql_error());  
49
50echo "Email Address Added";
51
52mysql_close
53?> 

 

The numbers are to represent line numbers due to the irellivency of putting up the whole file as its just the layout of the website they aer not actually in my script

 

Thanks,

 

Blink359

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.