Help with my login/register script

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
I have made my own login/register script, but it is not working.

I don't want google on it yet, so I have put the link on two lines:
http://paperforum.x10hosting.com/games/

and then register.php or login.php

It seems to be working fine, but when I try to register it doesn't say anything, it just goes back to register.php without registering.

I could upload the files if you need to see them.

Thanks if you can help.
Edit:
I've worked out that it is the strings:

Username:

^[A-Za-z0-9]{3,20}$

Email:

^[A-Za-z0-9_.-]+\@[A-Za-z0-9-.]+[A-Za-z.]{2,6}$

Password:

.+{5}
 
Last edited:

phpasks

New Member
Messages
145
Reaction score
0
Points
0
I have made my own login/register script, but it is not working.

I don't want google on it yet, so I have put the link on two lines:
http://paperforum.x10hosting.com/games/

and then register.php or login.php

It seems to be working fine, but when I try to register it doesn't say anything, it just goes back to register.php without registering.

I could upload the files if you need to see them.

Thanks if you can help.
Edit:
I've worked out that it is the strings:

Username:

^[A-Za-z0-9]{3,20}$

Email:

^[A-Za-z0-9_.-]+\@[A-Za-z0-9-.]+[A-Za-z.]{2,6}$

Password:

.+{5}

You can download here
Login script
http://www.phpasks.com/ajax/ajax-login.html

form submit script
http://www.phpasks.com/ajax/submit_form_ajax.html

PHP:
<?php
/********************************** CHECK FOR BLANK ********************************/
/* pass the object and id of the next cell    */ 

function check_Blank($myfld,$field_name)
{
    if(strlen(trim($myfld))==0)
        //return $field_name . " is not entered<br>";
        //return $field_name . " is required<br />" ;
        return "Enter " . $field_name . "<br />" ;  
    return;
}

/********************************** CHECK FOR EMAIL ********************************/
/* pass the email address    */
function check_Email($sEmailAddress,$field_name)
{
    if (ord(check_Length($sEmailAddress,"7","75"))==0)
    {    
         if (!eregi("^[-_a-z0-9]+(\.[-_a-z0-9-]+)*@[a-z0-9]+(\.[a-z0-9]+)*(\.[a-z]{2,3})$",$sEmailAddress))
        {
            return "Enter Valid " .$field_name."<br>";
        }        
        return "";
    } else {
//        return $field_name . " must be minimum of 7 and maximum of 40 character<br>";
        return "Enter Valid " .$field_name."<br>";         
        
    }
}

/********************************** CHECK FOR ALPHANUMERIC ********************************/
/* pass the object and id of the next cell    

    it will check for only 0-9,A-Z,a-z
*/ 

function check_AlphaNumeric($myfld, $field_name)
{    
    if(ereg('[^A-Za-z0-9]', $myfld))          
        return $field_name . " required only alphanumeric character<br>";    
    else
        return "";
}

?>
 
Last edited:

woocorp

New Member
Messages
50
Reaction score
0
Points
0
Scripts

really guys, what i usually do is steal the login script of a forum like smf/phpbb and edit it to my site! alot easier
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
I want to do it myself though. I'm trying to learn PHP as well, and I can't do that by nicking other peoples stuff.
 
Top