here is my h_register.php:
the strange thing is that when I display it directly in a browser it doesn't include the header.php and navigationbar.php and it also prints some fragments of the code e.g.:
$feedback
"; $feedback_str = $feedback; } else { // Show form for the first time $feedback_str = ''; } // ---------------- // DISPLAY THE FORM // ---------------- include("header.php"); include("navigationbar.php"); // Superglobals don't work with heredoc //$php_self = $_SERVER['PHP_SELF']; $php_self = h_register.php; $reg_str = <<< EOREGSTR
I guess RhythmAce was right about the tags, maybe it doesn't recognize the PHP tags, but I think I've typed them correctly.
<?php /* ====================================================
NAME
h_register.php
==========================================================*/ ?>
<?php
require_once('h_register_funcs.inc');
$first_name="";
$last_name="";
$address="";
$city="";
$phone="";
$password="";
$email="";
if (array_key_exists('submit',$_POST) && $_POST['submit'] == 'Mail confirmation') {
$feedback = user_register();
// In every case, successful or not, there will be feedback
$feedback_str = "<P class=\"errormess\">$feedback</P>";
} else {
// Show form for the first time
$feedback_str = '';
}
// ----------------
// DISPLAY THE FORM
// ----------------
include("header.php");
include("navigationbar.php");
// Superglobals don't work with heredoc
$php_self = $_SERVER['PHP_SELF'];
$reg_str = <<< EOREGSTR
<td align="center" valign="top">
<table width="550" height="77" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="75" align="left" valign="bottom"><img src="Welcome.JPG" width="550" height="75"></td>
</tr>
</table>
<br>
<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 ALIGN=CENTER WIDTH=621>
<TR>
<TD width="10%"/>
<TD align="left" valign="top">
$feedback_str
<P CLASS="left"><B>REGISTER</B><BR>
Fill out this form and a confirmation email will be sent to you. Once you click on the link in the email your account will be confirmed and you can begin to contribute to the community.</P>
<FORM ACTION="$php_self" METHOD="POST">
<P CLASS="bold"><B>First Name*</B><BR>
<INPUT TYPE="TEXT" NAME="first_name" VALUE="$first_name" SIZE="20" MAXLENGTH="25"></P>
<P CLASS="bold"><B>Last Name*</B><BR>
<INPUT TYPE="TEXT" NAME="last_name" VALUE="$last_name" SIZE="20" MAXLENGTH="25"></P>
<P CLASS="bold"><B>Address</B><BR>
<INPUT TYPE="TEXT" NAME="address" VALUE="$address" SIZE="10" MAXLENGTH="25"></P>
<P CLASS="bold"><B>City</B><BR>
<INPUT TYPE="TEXT" NAME="city" VALUE="$city" SIZE="10" MAXLENGTH="25"></P>
<P CLASS="bold"><B>Phone*</B><BR>
<INPUT TYPE="TEXT" NAME="phone" VALUE="$phone" SIZE="10" MAXLENGTH="25"></P>
<P CLASS="bold"><B>Password*</B><BR>
<INPUT TYPE="password" NAME="password1" VALUE="" SIZE="10" MAXLENGTH="25"></P>
<P CLASS="left"><B>Password*</B> (again)<BR>
<INPUT TYPE="password" NAME="password2" VALUE="" SIZE="10" MAXLENGTH="25"></P>
<P CLASS="left"><B>Email*</B> (required for confirmation)<BR>
<INPUT TYPE="TEXT" NAME="email" VALUE="$email" SIZE="30" MAXLENGTH="50"></P>
<P><INPUT TYPE="SUBMIT" NAME="submit" VALUE="Mail confirmation"></P>
</FORM>
</TD>
<TD width="10%"/>
</TR>
</TABLE>
</TD>
EOREGSTR;
echo $reg_str;
include("bottom.php");
?>