Hi Friends;
I am using redhat 5 with php3.0.16 and mysql 3.23. I am trying to using header Location but I am receiving a error message:
Warning: Cannot add more header information - the header was already sent (header information may be added only before any output is generated
from the script - check for text or whitespace outside PHP tags, or calls to functions that output text) in /home/httpd/html/submitform.php3 on
line 13.
I create one html page with this information:
submit.html:
<body>
<form action=submitform.php3 method=POST>
NAME: <input type=text name=name size=20 maxlength=20><br>
LOGIN: <input type=text name=login size=20 maxlength=20><br>
PASSWORD: <input type=password name=passwd size=20 maxlength=20><br>
<input type=submit>
</form>
</body>
this is the script submitform.php3 :
<body>
<?php
mysql_connect (localhost, user, test);
mysql_select_db (test);
if ($passwd) {
$key = "Key access";
$passwd_encrypt = mcrypt_cbc(MCRYPT_SAFER-SK128, $key, $passwd, MCRYPT_ENCRYPT);
mysql_query ("INSERT INTO cliente (name,login,password) VALUES ('$name', '$login', '$passwd_encrypt')");
print ("$name");
print (" Thank");
header("Location:http://www.system.com/user.php3");
} else {
echo " Error ";
}
?>
</body>
Please , can anyone tell what is happen. I need this information , because a discover without the header Location, the user can reload the page and insert more information in the databank. I am new in PHP, and this is very important to me.
Regards