Jump to content



  • Please log in to reply
No replies to this topic

#1 legohead6

  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 31 March 2006 - 03:41 AM

how do i stop a form heading to a database from sending untill the user clicks submit? right know it sends whenever they enter or refresh the page! heres the code
[code=auto:0] <?php
$host = "localhost";
$user = "--";
$pass = "--";
$db = "--";


// open connection
$connection = mysql_connect($host, $user,'$pass') or die ("Unable to

// select database
mysql_select_db($db) or die ("Unable to select database!");

$query = "INSERT INTO members VALUES ('$first','$last','$gun','$age','$saying','$email','$phone','$users','$passs')";

<p align="center">Player Info form!</p>
<form method="POST" name="membership" action="Membership.php">
<p align="center">First name <input type="text" name="first" size="20">
Last Name:<input type="text" name="last" size="24">
Phone#<input type="text" name="phone">(format= 000-0000)
<p align="center">
Gun type:<input type="text" name="gun" size="36"><br>
Age:<input type="text" name="age" size="3"><br>
<textarea rows="2" name="saying" cols="20"></textarea></p>
<p align="center">
Current email address:<input type="text" name="email" size="36">
<p align="center">
Desired Username:<input type="text" name="user" size="20">
<p align="center">
Desired pass:<input type="password" name="pass" size="20">
<p align="center"><input type="submit" value="Submit" name="B1"></p>

"Syntax error" .. WHERE THE **** IS IT?!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users