what xblue is telling me that I would take my html (join_form.html) and php (register.php) and integrate into one. Meaning, from my php page, also attached the codes from my join_form.html and call it something else. Let's say we call it join.php. Anyways, i'm not good at explaining this conflict that I have. Here is the code:
join_form.html
All of my header info.....then my form.
<form name="form1" method="post" action="register.php">
<table width="100%" border="0" cellpadding="4" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="26" colspan="2" valign="top"><div align="center"><font face="Verdana, Arial, Helvetica, sans-serif"><strong>Member
Account Information</strong></font></div></td>
</tr>
<tr>
<td height="27" colspan="2" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif"> </font></td>
</tr>
<tr>
<td width="294" height="30" align="left" valign="top"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">First
Name</font></div></td>
<td width="388" valign="top"> <input name="first_name" type="text" id="first_name" value="<? echo $first_name; ?>"></td>
</tr>
<tr>
<td height="30" align="left" valign="top"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Last
Name</font></div></td>
<td valign="top"> <input name="last_name" type="text" id="last_name" value="<? echo $last_name; ?>"></td>
</tr>
<tr>
<td height="30" align="left" valign="top"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Email
Address</font></div></td>
<td valign="top"> <input name="email_address" type="text" id="email_address" value="<? echo $email_address; ?>"></td>
</tr>
<tr>
<td height="30" align="left" valign="top"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Desired
Username</font></div></td>
<td valign="top"> <input name="username" type="text" id="username" value="<? echo $username; ?>"></td>
</tr>
<tr>
<td height="32"></td>
<td valign="top"> <input type="submit" name="Submit" value="Join Now!"></td>
</table>
</form>
end of my form and include my footer
//////////////////////////////////
register.php page
//////////////////////////////
<?
include 'db.php';
// Define post fields into simple variables
$first_name = $POST['first_name'];
$last_name = $POST['last_name'];
$email_address = $POST['email_address'];
$username = $POST['username'];
/ Let's strip some slashes in case the user entered
any escaped characters. /
$first_name = stripslashes($first_name);
$last_name = stripslashes($last_name);
$email_address = stripslashes($email_address);
$username = stripslashes($username);
/ Do some error checking on the form posted fields /
if((!$first_name) || (!$last_name) || (!$email_address) || (!$username)){
echo 'You did not submit the following required information! <br />';
if(!$first_name){
echo "First Name is a required field. Please enter it below.<br />";
}
if(!$last_name){
echo "Last Name is a required field. Please enter it below.<br />";
}
if(!$email_address){
echo "Email Address is a required field. Please enter it below.<br />";
}
if(!$username){
echo "Desired Username is a required field. Please enter it below.<br />";
}
// show_form();
include 'join_form.html'; // Show the form again!
/ End the error checking and if everything is ok, we'll move on to
creating the user account /
exit(); // if the error checking has failed, we'll exit the script!
}
Your telling me to open up my register.php and include my header, <form></form>and footer of my join_form.html?
////////////////////////////////////////////////////////////////////////////
matt_4013, I'm totally not to much of a professional with php. I was looking at your example, and I got lost.
// Put all your other stuff here
what should i put?
echo "<form>";
if my form name is "form1" should i
echo "<form1>";
echo "</form1>";
also,
// And a bunch of more stuff here
} else {
// Display your original form, or redirect back to your other form, etc.
}
....