Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

form help new to php

$
0
0

ok so i followed a tutorial and cant figure out why this code is not working when i use on server on pc i get a Parse error: syntax error, unexpected T_STRING in C:\wamp\www\insertform.php on line 14 error when i use on my hostgator i just get a blank page any help would be greatly appreciated i changed the pw for posting to password if that does make a difference i can change it back

<html>
<head>
</head>
<body>
<form action="insertform.php" method="post">
SHG Player Name: <input type="text" name="playername">
Email Address: <input type="text" name="email">
<input type="submit" name="submit"
</form>

<?php
if (isset($_POST['submit'])){
$con=mysql_connect("localhost","dbs_dbs","password");
die(Can not connect: " . mysql_error());


mysql_select_db("dbs_forms",$con);
$sql = "INSERT INTO emails(player_name,email)('$_POST[playername]','$_POST[email]')";
mysql_query($sql,$con);
mysql_close($con);
}
?>
</body>
</html>

ty confuzzled


Viewing all articles
Browse latest Browse all 13200

Trending Articles