+ Reply to Thread
Results 1 to 4 of 4

Thread: Login Script

  1. #1
    taekwondokid42 is offline x10 Lieutenant taekwondokid42 is an unknown quantity at this point
    Join Date
    Aug 2007
    Posts
    268

    Login Script

    I have created a login script, but I am having problems with the spaces. Is there any way that I can disallow the space character in my signup forms?

    something like

    if (username has a space in it){
    echo "You cannot have spaces in your username";
    }else{

    ...

  2. #2
    supajason's Avatar
    supajason is offline x10 Lieutenant supajason is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    England........:-)
    Posts
    288

    Re: Login Script

    i think this is right?

    PHP Code:
    $name 'supa jason';
    $find   ' ';
    $string strpos($name$find);

    if (
    $string === false) {
        echo 
    "no spaces'";
    } else {
        echo 
    "the string has a space";

    supajason was here

  3. #3
    VPmase's Avatar
    VPmase is offline x10 Elder VPmase is an unknown quantity at this point
    Join Date
    Nov 2007
    Location
    Dixon, IL, USA
    Posts
    914

    Re: Login Script

    You should just make a javascript code that checks to see if anything is wrong on the registration page then inform them of their errors or allow them to continue if there aren't any errors.
    http://www.javascript-coder.com/java...m-submit.phtml

  4. #4
    taekwondokid42 is offline x10 Lieutenant taekwondokid42 is an unknown quantity at this point
    Join Date
    Aug 2007
    Posts
    268

    Re: Login Script

    I like the strpos better.

    Let me get this staight.

    <?
    $username = I made a username!;
    $find = ' ';
    $string = strpos($username, $find);

    if ($string == true) {
    echo "You are not allowed to have spaces in your username!!";
    } elseif ($string == false) {
    //rest of createuser script
    }


    I just tried it out. This is what I'm looking for
    Last edited by taekwondokid42; 12-08-2007 at 07:07 AM. Reason: to close the thread.

+ Reply to Thread

Similar Threads

  1. Replies: 8
    Last Post: 12-03-2007, 04:12 PM
  2. Mine Died. Anyone have a login script?
    By salukigirl in forum Scripts & 3rd Party Apps
    Replies: 0
    Last Post: 10-19-2007, 03:18 PM
  3. Secure login script question
    By cetutnx1 in forum Free Hosting
    Replies: 0
    Last Post: 05-01-2006, 05:40 PM
  4. Cant login to my news script
    By SecureStealth in forum Free Hosting
    Replies: 0
    Last Post: 09-08-2005, 05:47 PM
  5. PHP login script
    By xunhandmex in forum Scripts & 3rd Party Apps
    Replies: 8
    Last Post: 05-26-2005, 07:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers