SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 33 of 33
  1. #26
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    israel
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    normal error ... :
    Code:
    Parse error: parse error in /home/www/somatnt.superihost.com/notice.php on line 77
    this is the line :
    Code:
    . ' (account, password, 'e-mail', age)'

  2. #27
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    israel
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and ye i've change the field name to Email ....

  3. #28
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    israel
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the result :
    Code:
    Executing INSERT INTO reg (account, password, Email, age) VALUES ('Admin', 'yoman', '', 15)
    Result = 1
    Account created
    ill post soon if it added a line to the db ... sec

  4. #29
    SitePoint Wizard swdev's Avatar
    Join Date
    Oct 2004
    Location
    UK
    Posts
    1,053
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah - ok I see where the parse error came from. You used normal single quotes around the column name. It shoul dhave been backticks.

  5. #30
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    israel
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yup ther is a new line in the db ... cool but what heppen to the E-mail ... i've entered one and its not writen ....

  6. #31
    SitePoint Wizard swdev's Avatar
    Join Date
    Oct 2004
    Location
    UK
    Posts
    1,053
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Post the complete code and I'll have a look.

  7. #32
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    israel
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my work of art :
    Code:
    <?php
      include "notice.html";
      include "connection.php";
    
    
    
     if (!isset($_POST["insert_button"]))
    
      {
    
         ?>
       <FORM action="<?= $_SERVER["notice.php"]; ?>" method="POST">
          <TABLE border=0 cellpadding=7 cellspacing=7>
             <TR>
                <br><br><br><br>
                <TD><font color="#ffbc8c83">account:</font></TD>
                <TD><INPUT type="TEXT" name="account" size=20 maxlength=20 value="<?= $_POST["account"]; ?>"></TD>
             </TR>
             <TR>
                <TD><font color="#ffbc8c83">password:</font></TD>
                <TD><INPUT type="password" name="password" size=20 maxlength=20 value="<?= $_POST["password"]; ?>"></TD>
             </TR>
             <TR>
                <TD><font color="#ffbc8c83">Email:</font></TD>
                <TD><INPUT type="TEXT" name="Email" size=30 maxlength=50 value="<?= $_POST["Email"]; ?>"></TD>
             </TR>
             <TR>
                <TD><font color="#ffbc8c83">age:</font></TD>
                <TD><INPUT type="TEXT" name="age" size=2 maxlength=2 value="<?= $_POST["age"]; ?>"></TD>
             </TR>
             <TR>
                <TD align="right"><INPUT type="SUBMIT" name="insert_button" value="register"></TD>
                <TD align="left"><INPUT type="RESET" value="reset"></TD>
             </TR>
          </TABLE>
       </FORM>
       <?
      }
    
    
    
      if (isset($_POST["insert_button"]))
    
      {
         $account=$_POST["account"];
         $password=$_POST["password"];
         $e_mail=$_POST["Email"];
         $age=$_POST["age"];
    
    
         $grade_insert_errors="";
    
         if ('$account'=="")
            $grade_insert_errors.="<br>account name isnt good.<BR>";
    
         if ('$password'=="")
            $grade_insert_errors.="password just isnt right.<BR>";
    
         if ('$e_mail'=="")
            $grade_insert_errors.="type a working Email plz.<BR>";
    
         if ($age=="")
            $grade_insert_errors.="age isnt good.<BR>";
    
         if ('' == $grade_insert_errors)
      {
        // make sure strings are quoted and escaped
        $account = '\''. mysql_real_escape_string($account) . '\'';
        $password = '\''. mysql_real_escape_string($password) . '\'';
        $e_mail = '\''. mysql_real_escape_string($e_mail) . '\'';
        $age = $age;
        $grade_reg_table = 'reg';
    
        $grade_insert_query = 'INSERT INTO '
                         . $grade_reg_table
                         . ' (account, password, Email, age)'
                         . ' VALUES ('
                         . $account
                         . ', ' . $password
                         . ', ' . $e_mail
                         . ', ' . $age
                            . ')'
                            ;
    
        // START DIAGNOSTIC - REMOVE WHEN WORKING
        echo 'Executing ' . $grade_insert_query . '<br />';
        // END DIAGNOSTIC - REMOVE WHEN WORKING
    
        $result = mysql_query ($grade_insert_query,$chan);
        // START OF DIAGNOSTIC - REMOVE WHEN WORKING
        echo 'Result = ' . $result . '<br />';
        // END OF DIAGNOSTIC - REMOVE WHEN WORKING
    
        if (false == $result)
        {
          echo ' Failed to execute ' . $grade_insert_query . ' due to ' . mysql_error() . '<br />';
        }
        else
        {
          echo 'Account created <br />';
        }
    
         }
         else
    
         {
            echo "<BR><br><FONT color=\"#ffbc8c83\">".$grade_insert_errors."</FONT><BR>";
            unset($_POST["insert_button"]);
    
         }
      }
    ?>
    im away cya soon

  8. #33
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    israel
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how do i make sure that ther werent any accounts already made in that name ?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •