Web Analytics Made Easy -
StatCounter Problems with mysql and sessions - CodingForum

Announcement

Collapse
No announcement yet.

Problems with mysql and sessions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems with mysql and sessions

    Fixed it.
    Last edited by bubbles19518; Sep 27, 2006, 01:52 PM.
    -bubbles

  • #2
    maybe there is problem in registration file, given code looks ok
    Free php image upload script
    Personal web developing blog

    Comment


    • #3
      The user id is set to auto increment
      Here is reg script
      PHP Code:
      <?
      if($action == "submit")
      {
      if(!empty(
      $_POST['submit']))
      {
      $link mysql_connect("localhost""beng_beng","r0f101");
      mysql_select_db("beng_note"$link);
      if(
      $_POST['pass'] != $_POST['pass2'])
      {
      $message "Your passwords do not match, please retype them.";
      exit();
      }
      $encpass md5($_POST['pass']);
      $sql "SELECT * FROM users WHERE username='$_POST[user]'";
      $result mysql_query($sql$link) or die(mysql_error());
      if(
      mysql_num_rows($result) != 0)
      {
      $message "This Username is already taken, please try a different one.";
      exit();
      }
      $sql "SELECT * FROM users WHERE email='$_POST[emailf]'";
      $result mysql_query($sql$link) or die(mysql_error());
      if(
      mysql_num_rows($result) != 0)
      {
      $message "This Email is already taken, please try a different one.";
      exit();
      }
      $query "INSERT INTO `users` ( `id` , `username` , `password` , `email` , `name` , `school` , `major` , `cname` , `cnumber` , `cteacher` , `cdays` ) VALUES (NULL , '$_POST[user]', '$encpass', '$_POST[emailf]', '', '', '', '', '', '', '')";
      if(
      mysql_query($query))
      {
      $message "Account created successfully!";
      }
      mysql_close($link);    
      }
      }
      ?>
      -bubbles

      Comment

      Working...
      X