Warning: Cannot modify header information – headers already sent by (output started at c:program fileseasyphp1-8wwwnew foldergetreg.php:5) in c:program fileseasyphp1-8wwwnew foldergetreg.php on line 27
That is the error im getting when i try to send the user back to the referring page it worked for my log in screen but is causing trouble with registration.
Im just testing to see if it will work before i start querying the database with the registration. Thanks in advance
heres the html form
[code=html]<HTML>
<HEAD>
<meta HTTP-EQUIV=”Content-Type” CONTENT=”text/html; charset=windows-1252″>
<meta http-equiv=”Content-Language” content=”en-us”>
<TITLE>New Page 2</TITLE>
</HEAD>
<BODY>
<h1>[Name of your sub site] User Registration</h1>
<hr>
<P>
<i>Please fill in the details below to register for the website</i></P>
<form action = “getreg.php” method = “POST”>
–><OL>
<LI>
<P>
Please provide your account information:</P>
<TABLE>
<TR>
<TD ALIGN=”right”>
<EM>User Name</EM></TD>
<TD>
<INPUT TYPE=TEXT NAME=”Account_Username” SIZE=16 MAXLENGTH=16>
</TD>
</TR>
<TR>
<TD ALIGN=”right”>
<EM>Password</EM></TD>
<TD>
<INPUT TYPE=PASSWORD NAME=”Account_Password” SIZE=16 MAXLENGTH=16>
</TD>
</TR>
<TR>
<TD ALIGN=”right”>
<EM>Confirm Password</EM></TD>
<TD>
<INPUT TYPE=PASSWORD NAME=”Account_PasswordConfirm” SIZE=16 MAXLENGTH=16>
</TD>
</TR>
</TABLE>
<p> <LI>
<P>
Please provide the following contact information:</P>
<TABLE>
<TR>
<TD ALIGN=”right”>
<EM>Name</EM></TD>
<TD>
<INPUT TYPE=TEXT NAME=”Contact_FullName” SIZE=35>
</TD>
</TR>
<TR>
<TD ALIGN=”right”>
<EM>Address Line 1</EM></TD>
<TD>
<INPUT TYPE=TEXT NAME=”Contact_StreetAddress” SIZE=35>
</TD>
</TR>
<TR>
<TD ALIGN=”right”>
<EM>Address Line 2 </EM></TD>
<TD>
<INPUT TYPE=TEXT NAME=”Contact_Address2″ SIZE=35>
</TD>
</TR>
<TR>
<TD ALIGN=”right”>
<EM>City</EM></TD>
<TD>
<INPUT TYPE=TEXT NAME=”Contact_City” SIZE=35>
</TD>
</TR>
<TR>
<TD ALIGN=”right”>
<EM>State/Province</EM></TD>
<TD>
<INPUT TYPE=TEXT NAME=”Contact_Province” SIZE=35>
</TD>
</TR>
<TR>
<TD ALIGN=”right”>
<EM>Country</EM></TD>
<TD>
<INPUT TYPE=TEXT NAME=”Contact_Country” SIZE=14>
</TD>
</TR>
<TR>
<TD ALIGN=”right”>
<EM>E-mail</EM></TD>
<TD>
<INPUT TYPE=TEXT NAME=”Contact_Email” SIZE=25>
</TD>
</TR>
</TABLE>
</OL>
<INPUT TYPE=SUBMIT VALUE=”Submit Form” action = getreg.php>
<INPUT TYPE=RESET VALUE=”Reset Form”>
</FORM>
<HR>
<H5>
Author information goes here.<br>Copyright © 2003 [OrganizationName]. All rights reserved. <BR>
Revised:
</H5>
</BODY>
</HTML>
this is the php code
[code=php]<html><head><title>Registration Page</title></head>
<body>
<hr>
</body>
<?php
$Username = $_POST[‘Account_Username’];
$Password = $_POST[‘Account_Password’];
$confirmP = $_POST[‘Account_PasswordConfirm’];
$FullName = $_POST[‘Contact_FullName’];
$Address1 = $_POST[‘Contact_StreetAddress’];
$Address2 = $_POST[‘Contact_Address2’];
$City = $_POST[‘Contact_City’];
$Province = $_POST[‘Contact_Province’];
$Country = $_POST[‘Contact_Country’];
$Email = $_POST[‘Contact_Email’];
$self = $_SERVER[‘PHP_SELF’];
$referer = $_SERVER[‘HTTP_REFERER’];
if($Password == $confirmP){
#submit details into database if the passwords match
echo(“The passwords matched”);
}
else{
#send back to registration with all fields still there except passwords
header(“Location:$referer”);
exit();
}
?></html>