Hi Again,
still I have same trouble...
look at this...
you know I have this structure to process form with php4
a file named "form.phtml" with an include("form.inc") sentence.
and when the form is submitted, the "save.php" file records the info in a mysql table.
form.phtml
is a page with colors, gif..and so on
....
<body background="wallpaper.jpg">
...
<?php include("form.inc"); ?>
...
</body>
form.inc
only haves the form.
<!-- begin form.inc -->
<form name="fm" method="post" action="save.php" onsubmit="return isEmpty()">
<input type="text" name="email" value="">
<input type="text" name="city" value="">
...
...
<input type="submit" name="submit" value="Send">
</form>
<!-- end form.inc -->
the isEmpty() function is javascript code to validate blank fields..
save.php
record info into mysql table
<?
$DB_HOST="myhost";
$DB_USER="myuser";
$DB_PASS="mypass";
$DATABASE="mydb";
$db = mysql_connect ("$DB_HOST", "$DB_USER", "$DB_PASS") or die ("error");
mysql_select_db("$DATABASE",$db);
$sqlquery = "INSERT INTO contact(email,city) VALUES('$email','$city')";
$result = mysql_query ($sqlquery) or die ("error");
$db->close();
?>
the problem is that sometimes a blank record is saved into my mysql table...
and I don't know why.... exists one function isEmpty that validate blank fields...then only when all fields are filled
the form is submitted .... but sometime it happens that a blank row is saved in my table.
do you have any idea??
I have my pages in a server with php4, freeBSD 4.2.
thanks for your patience.. =)
if that reply is not readable..let me send you to your email.. ok?
regards from Chile.
Fitiux.