Code2Design.com

User login

The Layout

Programming

Graphic Design

Resources

Navigation

C2D Projects

Unsystematic Affiliates

Christian Cosmos Tarnic XeonFX PhotoShop Aid 

Change Language

Who's online

There are currently 0 users and 4 guests online.

Multiple Rows of Information Being Added into Database

<?php
$uname 
$_POST['username'];
$pword $_POST['password'];
$cpass $_POST['confirmpass'];
$email $_POST['email'];
$probs $_POST['prob'];

if(
$probs != "10")
{
<
table width="100%" border="0" cellspacing="0" cellpadding="0">
      <
tr>
        <
td height="82" class="textseg"><div style='font-weight:bold; font-size:18px;'>Registration Error</div>
         <
br />
            <
br />
           
The answer to the problem was incorrectplease go back and try again!<br />
            <
br />
            <
div align="right"><<a href="javascript: history.back()" title="Go back!">BACK</a>>
        </
div></td>
      </
tr>
</
table>
}
elseif(
$probs == "10")
{
if(
$uname != "" && $pword != "" && $cpass != "" && $email != "")
{
    if(
$pword == $cpass)
    {
       
$register mysql_query("SELECT * FROM `users`");
        while(
$reg mysql_fetch_array($register ))
          {
              if(
"{$reg['username']}" == $uname)
              {
<
table width="100%" border="0" cellspacing="0" cellpadding="0">
      <
tr>
        <
td height="82" class="textseg"><div style='font-weight:bold; font-size:18px;'>Registration Error</div>
         <
br />
            <
br />
           
The username you have entered was already takenplease go back and try again!<br />
            <
br />
            <
div align="right"><<a href="javascript: history.back()" title="Go back!">BACK</a>>
        </
div></td>
      </
tr>
</
table>
              }
              else
              {
                  if(
"{$reg['password']}" == $pword)
                  {
<
table width="100%" border="0" cellspacing="0" cellpadding="0">
      <
tr>
        <
td height="82" class="textseg"><div style='font-weight:bold; font-size:18px;'>Registration Error</div>
         <
br />
            <
br />
           
The passwords you have entered are already takenplease go back and try again!<br />
            <
br />
            <
div align="right"><<a href="javascript: history.back()" title="Go back!">BACK</a>>
        </
div></td>
      </
tr>
</
table>
                  }
                  else
                  {
                      if(
"{$reg['eamil']}" == $email)
                      {
<
table width="100%" border="0" cellspacing="0" cellpadding="0">
      <
tr>
        <
td height="82" class="textseg"><div style='font-weight:bold; font-size:18px;'>Registration Error</div>
         <
br />
            <
br />
           
The email you have entered is already takenplease go back and try again!<br />
            <
br />
            <
div align="right"><<a href="javascript: history.back()" title="Go back!">BACK</a>>
        </
div></td>
      </
tr>
</
table>             
                      }
                      elseif(
"{$reg['username']}" != $uname && "{$reg['password']}" != $pword && "{$reg['email']}" != $email)
                      {
                     
$date date('Y-m-d H:i:s');
mysql_query("INSERT INTO `users` ( `username` , `password` , `email` , `group` , `logo` , `warnings` , `reg_date` )

VALUES ('$_POST[username]', '$_POST[password]', '$_POST[email]', 'Member', 'sources/style_images/green/logo.jpg', '0', '$date' )"
);

echo 
"<script>
window.location = '?page=login&CODE=001';
</script>"
;
                      }
                  }
              }
          }
    }
    elseif(
$pword != $cpass)
    {
        <
table width="100%" border="0" cellspacing="0" cellpadding="0">
      <
tr>
        <
td height="82" class="textseg"><div style='font-weight:bold; font-size:18px;'>Registration Error</div>
         <
br />
            <
br />
           
The passwords you entered didn't match, please go back and try again!<br />
            <br />
            <div align="right"><<a href="javascript: history.back()" title="Go back!">BACK</a>>
        </div></td>
      </tr>
</table>
    }
}
else
{
<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="82" class="textseg"><div style='
font-weight:boldfont-size:18px;'>Registration Error</div>
         <br />
            <br />
            The form was not accepted, please go back and try again!<br />
            <br />
            <div align="right"><<a href="javascript: history.back()" title="Go back!">BACK</a>>
        </div></td>
      </tr>
</table>
}
}
?>

(FYI: Where you see PLAIN HTML I had ending PHP tags, but I had to remove them to post.

I'm trying to make a site that it going perfectly accept for the registration part. It's adding more than one row on one registration, and the number that is added is only doubled hear's a more graphic explanation.

2 accounts already registered

On the next registration 2 more account are added with all of the same detailed information.


Submitted by Navigator on March 4, 2008 - 12:02am.
printer friendly version

Using <code>

(FYI: Where you see PLAIN HTML I had ending PHP tags, but I had to remove them to post.

You are supposed to use the "<code>" tag - then you wouldn't have that problem. Also, It would be nice if you could edit it and fix the formating - I can't read it without proper tabbing/spacing for each block of code.


Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <br> <br /> <h3>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use BBCode tags in the text, URLs will be automatically converted to links
More information about formatting options



Like what you see?

Why not add more? C2D is looking for other Christian Web Masters who would like to help write articles for this site. If you have expericance in FLASH, CSS/HTML, PHP/MySQL, PhotoShop/GIMP, Blender, Javascript, or just General Design - our users would love to hear what you have to say. Contact Us

delicious   digg   reddit   magnoliacom   newsvine   furl   google   yahoo   technorati