$this problem

Started by martinu, January 12, 2010, 11:03:26 PM


I get the following error:Fatal error: Using $this when not in object context in /home7/microca5/public_html/signup_form.php on line 19

I placed the signup form inside of my own page to make it look nicer. Is there anything I can do to eliminate these types of errors? By the way, my include header only brings in drop down menus and not the full header. That is hard coded into the page as you can see.

Here is the code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- Begin Header-->
<title>Microcapsadviser Registration Form</title>
<meta name="description" content="Receive microcap stock news ahead of the pack. Signup for free alerts.">
<?php include("header.php"); ?>
<table width="968" border="0" align="center">
    <td><!-- Begin Signup Form-->
    <form method="post">
      <h3>User Registration Form</h3>
      <p>Registered users obtain access to the restricted part of our website. This is were we post breaking news that could have an immediate impact on a stock.</p>
      <p>In addition, we will email you breaking information and give you a &quot;heads-up&quot; in advance of an important event. Do not underestimate how valuable these emails can be. Remember, for certain new issues, we are the first to release company related news. All registered users will get email alerts.<br>
      <font color="red"><?php echo $this->error; ?></font><br />
      Login:<br />
      <input type='input' name='access_login' value='<?php echo $this->login ?>'/>
      <br />
      Password:<br />
      <input type="password" name="access_password" />
      <?php if (USE_EMAIL && !LOGIN_AS_EMAIL) echo "<br />Email:<br /><input type='input' name='access_email' value='$this->email' />"; ?>
      <input type="submit" name="access_submit" value="Sign up" />
<?php include("footer.php"); ?>


I get the same error message with the standard signup form. I find this online but do not know enough about coding php to tell if it is meaningful. My server uses PHP5

"you were allowed to use $this outside of classes in PHP4, but PHP5 does not allow it."

Does this have any meaning to anyone, such that it can help me with this problem?


I tried to write an explanation of where you are going wrong but the form won't submit because it's over 1000 characters. I shortenned it but it still wouldn't submit, so I guess you're on your own. Sorry.