Hi
Thanks for your help in advance.
I have two different files: 1. submit.php and 2. createentry.php
Submit.php contains html code and calls createentry.php on press of the button.
Here is the code of createentry.php. I want send it to table called test1 in mysql db, but it always inserts blanks rows and I have already turned on register_global in php.ini and restarted the computer.
<?php
/ mysql_connect("localhost", "parth", "patwari") or
die ("Coultn't connect to database.");
mysql_select_db("sitenoc") or
die ("Couldn't slect database.");
/
$db = mysql_connect("localhost", "parth", "patwari");
mysql_select_db("sitenoc",$db)
or die("Unable to execute query:<br>$sql<br>Error: " . mysql_error());
//if($submit = "Sign!" )
// { ($HTTP_POST_VARS["name"]);
// echo '$name1';
//echo "$f_name";
//echo $e_mail;
$query = "INSERT INTO test1
(fname,lname,email) VALUES
('$firstname', '$lastname', '$emailfield')"
;
$result = mysql_query($query)
or die("Unable to execute query:<br>$sql<br>Error: " . mysql_error());
mysql_close($db);
/$result = mysql_query($query);// or /
//die (mysql_error());
?>
<h2> did it </h2>
<?php/
}
else
{
include ("submit.php");
}
/?>
Thanks for your help.
Parth
😕 😕 😕 😕 😕