registration modify

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

    registration modify

    Hey guys anyone can assist me please on the register i want to change it it should ask for email then check if its valid after its valid it must ask for username pass location so on but u must click next whole time untill ur finish

    can someone modify this

    register.php
    Code:
    echo "<img src=\"../images/point.gif\" alt=\"!\"/>";
    echo "Allowed characters in userid and password are a-z, 0-9, and -_ only<br/>";
    echo "<img src=\"../images/point.gif\" alt=\"!\"/>";
    echo "No vulgar words are accepted in UserID<br/>";
    echo "<img src=\"../images/point.gif\" alt=\"!\"/>";
    echo "UserName and Password must contain at least 4 characters<br/>";
    echo "<img src=\"../images/point.gif\" alt=\"!\"/>";
    echo "UserName must begin with a letter<br/>";
    
    echo "<img src=\"../images/point.gif\" alt=\"!\"/>";
    echo "Birthday must be in this format YYYY-MM-DD <br/>eg. 16 January 1989 = 1989-01-16<br/>";
    echo "<img src=\"../images/point.gif\" alt=\"!\"/>";
    echo "In the Referal field enter the Nicname of the user who referd you to $stitle<br/><br/>";
    echo "</small>";
    }else
    
    $tolog = false;
    if(trim($uid)=="")
    {
        echo registerform(1);
    }
    else if(trim($pwd)=="")
    {
        echo registerform(2);
    }else if(trim($cpw)=="")
    {
        echo registerform(3);
    }else if(spacesin($uid)||scharin($uid))
    {
        echo registerform(4);
    }else if(spacesin($pwd)||scharin($pwd))
    {
        echo registerform(5);
    }else if($pwd!=$cpw)
    {
        echo registerform(6);
    }else if(strlen($uid)<4)
    {
        echo registerform(7);
    }else if(strlen($pwd)<4)
    {
        echo registerform(8);
    }else if(isdigitf($uid))
    {
        echo registerform(11);
    }else if(checknick($uid)==1)
    {
        echo registerform(12);
    
    }else if(checknick($uid)==2)
    {
        echo registerform(13);
    
    }else if(trim($email)=="14")
    {
        echo registerform(15);
    
    }
    else if(register($uid,$pwd,$usx,$bdy,$ulc,$email, $ubr, $refer)==1)
    {
        echo registerform(9);
    }else if(register($uid,$pwd,$usx,$bdy,$ulc,$email, $ubr, $refer)==2)
    {
        echo registerform(10);
    }else{
    	
    			echo "<center>Successfully</center>";
    		
    						    echo "Registration completed successfully!";
    						    $tolog = true;
    				
    	}
    so basicly it should ask one input at a time until registration are finished

    core.php
    Code:
    function registerform($ef)
    {
      $ue = $errl = $pe = $ce = "";
      switch($ef)
      {
        case 1:
            $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Please type your  Nick";
            $ue = "<img src=\"images/point.gif\" alt=\"!\"/>";
            break;
      case 2:
      $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Please type your password";
        $pe = "<img src=\"images/point.gif\" alt=\"!\"/>";
         break;
     case 3:
        $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Please type your password again";
            $ce = "<img src=\"images/point.gif\" alt=\"!\"/>";
            break;
        case 4:
            $errl = "<img src=\"images/point.gif\" alt=\"!\"/> User Nick is invalid";
            $ue = "<img src=\"images/point.gif\" alt=\"!\"/>";
            break;
        case 5:
            $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Password is invalid";
            $pe = "<img src=\"images/point.gif\" alt=\"!\"/>";
            break;
        case 6:
            $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Passwords doesn't match";
            $ce = "<img src=\"images/point.gif\" alt=\"!\"/>";
            break;
        case 7:
            $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Ur Nick must be 4 characters or more";
            $ue = "<img src=\"images/point.gif\" alt=\"!\"/>";
            break;
        case 8:
            $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Password must be 4 characters or more";
            $pe = "<img src=\"images/point.gif\" alt=\"!\"/>";
            break;
        case 9:
        $errl = "<img src=\"images/point.gif\" alt=\"!\"/> your Nick already in use, choose a different one";
            $ue = "<img src=\"images/point.gif\" alt=\"!\"/>";
            break;
        case 10:
            $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Unknown mysql error try registering later";
    
            break;
        case 11:
         $errl = "<img src=\"images/point.gif\" alt=\"!\"/> User Nick must start with a letter from a-z";
            $ue = "<img src=\"images/point.gif\" alt=\"!\"/>";
            break;
        case 12:
         $errl = "<img src=\"images/point.gif\" alt=\"!\"/> User Nick is reserved for admins of the site";
            $ue = "<img src=\"images/point.gif\" alt=\"!\"/>";
            break;
        case 13:
            $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Please choose an appropriate nickname";
      $ue = "<img src=\"images/point.gif\" alt=\"!\"/>";
               break;
       case 14:
            $errl = "<img src=\"images/point.gif\" alt=\"!\"/> U must enter an email address";
            $ue = "<img src=\"images/point.gif\" alt=\"!\"/>";
    	     break;
        case 15:
            $errl = "";
            $ue = "";
            break;
      }
    
    $rform = "<small>$errl</small><br/><br/>";
      $rform .= "<form action=\"register.php\" method=\"post\">";
      $rform .= "$ue UserName: <input name=\"uid\" maxlength=\"15\" format=\"*x\" maxlength=\"30\"/><br/>";
      $rform .= "$pe Password: <input type=\"password\" name=\"pwd\" format=\"*x\" maxlength=\"30\"/><br/>";
      $rform .= "$ce Password Again: <input type=\"password\" name=\"cpw\" format=\"*x\" maxlength=\"30\"/><br/>";
      $rform .= "Birthday <small>(YYYY-MM-DD)</small>: <input name=\"bdyy\" format=\"*N\" size=\"4\" maxlength=\"4\"/>-<input name=\"bdym\" format=\"*N\" size=\"2\" maxlength=\"2\"/>-<input name=\"bdyd\" format=\"*N\" size=\"2\" maxlength=\"2\"/><br/>";
      $rform .= "Sex:";
      $rform .= "<select name=\"usx\" value=\"M\">";
      $rform .= "<option value=\"M\">Male</option>";
      $rform .= "<option value=\"F\">Female</option>";
      $rform .= "</select><br/>";
      $rform .= "Location[Country-Area]Ex. SL-Negombo: <input name=\"ulc\"  maxlength=\"100\"/><br/>";
      $rform .= "Email: <input name=\"email\" maxlength=\"50\"/><br/>";
    
      $rform .= "<input type=\"submit\" value=\"Register\"/>";
      $rform .= "</form>";
      return $rform;
      return $rform;
    }
    ________________
    Jacques
    jacques@gw-designs.co.za
    http://coding.biz.tm
    Come join and lets make it a place to learn all the noobies how to code
    __________________

    NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

    #2
    Creating a multi-page order form using PHP

    you can also use simple if else statements for each actions.

    In my opinion ragitration page should have only 3 inputs (1) username (2) password (3) email adress. Once registration is successful you can redirect them to profile modification page with giving skip option at bottom.
    Last edited by opticalpigion; 02.06.13, 16:11.
    sigpic

    Comment


      #3
      tanx for that option optical will do that what code do i add on the page after registration so that it will only be poped up once when u log in again ull go to normal home page
      ________________
      Jacques
      jacques@gw-designs.co.za
      http://coding.biz.tm
      Come join and lets make it a place to learn all the noobies how to code
      __________________

      NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

      Comment

      Working...
      X