First of all, I'd use something like this:

-- CODE --
<?
if (!isset($_GET['action']) || trim($_GET['action']) == "")
{
?>
        <form>.....</form>
<?
}
else if ($_GET['action'] == 'adduser')
{
?>
        Foo
<?
}
?>
-- END --

But the actual error is in the echo. You're having quotation marks inside it. You need to do it my way, or write the form like
<?
echo "<form name=\"myForm\">...</form>";
?>




Niklas



Logan Moore wrote:
I am currently coding a cms. So far I have completed the security
login/password system but have now moved on to a new area of php. Uploading
info to a database.

This is the code as it stands now.

<?php
  if($_GET[action] == ""){echo"
  <form name="adduser" method="post" action="adduser.php?action=adduser">
  <table width="400" border="0" cellspacing="0" cellpadding="5">
    <tr valign="top">
      <td width="50%" align="right">Full Name:</td>
      <td width="50%"><input name="fullname" type="text" id="fullname"></td>
    </tr>
    <tr valign="top">
      <td height="50" align="right">Email:</td>
      <td><input name="email" type="text" id="email"></td>
    </tr>
    <tr valign="top">
      <td align="right">UserName:</td>
      <td><input name="username" type="text" id="username"></td>
    </tr>
    <tr valign="top">
      <td align="right">Password:</td>
      <td><input name="password" type="password" id="password"></td>
    </tr>
    <tr align="center">
      <td colspan="2"><input type="submit" name="Submit"
value="Submit"></td>
      </tr>
  </table>
  </form>
  ";}

  if($_GET[action] == "adduser"){echo "Add User Function is still Under
Construction <br> as a result what you just did has had no effect"}
  ?>


I know there is something wrong as i get an error when I goto the page. I want it to display the form, then when you click submit, goto the same page except run the command to add the information from the form to the database.

Also how do I put the information in the database.

Regards
Logan

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to