Search
Left Quote    Every day I get up and look through the Forbes list of the richest people in America. If I
- Robert Orben    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: Complete Members System error
  This user is offline  rh_penguin
  Subject: "Complete Members System error" Posted: @ 7:08 pm on Feb 17 2007   
Member #: 279
Rank: User - (4)
Since: 02/17/07
Posts: 4

hi,

I followed the whole tutorial but now when i access the 'register.php' page i get a whole bunch of unwanted characters.
Code:
', '?', ':', '"', '='); //starting lenght of username $len = strlen($_POST[' username']); //replace invalid characters $_POST['usernam e'] = str_replace($ju nk, '', $_POST['usernam e']); $test = $_POST['usernam e']; //if lenghts are different ($len smaller), invalid characters found, so prompt error. if(strlen($test ) != $len) { die('Username Error: Username contained invalid characters. You can only use A-Z, 0-9 and the underscore (_).'); } //Check if username already exists... $q2 = mysql_query(&qu ot;SELECT * FROM `members` WHERE `username` = '".$_POST[ 'username'].&qu ot;'"); $q3 = mysql_fetch_obj ect($q2); if($q3->user name == $_POST['usernam e']) { die('

Sorry, but the username "'.$q3-> ;username.'&quo t; is taken, please choose another.'); } //PASSWORD if(!$_POST['pas sword']) { die('Error: Password field was blank'); } if(!$_POST['ver ify_password']) { die('Error: Verify Password field was blank.'); } if($_POST['pass word'] != $_POST['verify_ password']) { die('Error: The passwords do not match.'); } if(strlen($_POS T['password']) < 6 ) { die('Error: Your password is too short. Must be 6 or more characters in length.'); } //ADD NEW MEMBER $insert ="INSERT INTO `members` (username, user_password, user_email) VALUES ('".$_POST ['username'].&q uot;', '".md5($_P OST['password'] )."', '".$_POST[ 'email']." ')"; $insert2 = mysql_query($in sert); if(!$insert2) die(mysql_error ()); echo('Registrat ion Successful, Welcome new member! You can now login to your new account.'); } else { ?>

The register form does get displaid but if i try and register i get a 403 error:
Code:
Forbidden - You don't have permission to access /login_system/& lt; on this server.
Can someone please tell what im doing wrong?


    Viewed: 11,625 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Complete Members System error" Posted: @ 2:26 am on Feb 18 2007    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

Is the login_system directory protected?




-bs0d | AllSyntax.com

    Viewed: 11,614 Times | Reply to This | To top
  This user is offline  rh_penguin
  Subject: "re: Complete Members System error" Posted: @ 10:08 am on Feb 18 2007    
Member #: 279
Rank: User - (4)
Since: 02/17/07
Posts: 4

  bs0d said...

< i> Is the login_system directory protected?
Nope, I havent done anything to it. :/ (Im on Windows btw)




    Viewed: 11,604 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Complete Members System error" Posted: @ 4:07 pm on Feb 18 2007    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

Are you running this from your own webserver? Also, you said you get a bunch of unwanted characters, what do you mean? In that 1st code sample you posted, is that what displays? If so, that is PHP code that is suppose to be executed.

Check through if you used ?> to jump into HTML and make sure you've used <? to jump back in




-bs0d | AllSyntax.com

    Viewed: 11,594 Times | Reply to This | To top
  This user is offline  rh_penguin
  Subject: "re: Complete Members System error" Posted: @ 6:03 pm on Feb 18 2007    
Member #: 279
Rank: User - (4)
Since: 02/17/07
Posts: 4

  bs0d said...

< i> Are you running this from your own webserver? Also, you said you get a bunch of unwanted characters, what do you mean? In that 1st code sample you posted, is that what displays? If so, that is PHP code that is suppose to be executed.

Check through if you used ?> to jump into HTML and make sure you've used <? to jump back in


Yup im running from my own server. (Currentlly on Windows)




    Viewed: 11,588 Times | Reply to This | To top
  This user is offline  rh_penguin
  Subject: "re: Complete Members System error" Posted: @ 6:05 pm on Feb 18 2007    
Member #: 279
Rank: User - (4)
Since: 02/17/07
Posts: 4

I just accessed the login page and now all those extra characters are gone......I didnt do anything to the code.....someho w it just fixed it self. :/ How could that happen?
BUT i still gte the No permission to access the dir error. When i get that error in the browser it shows: http://localhos t/login_system/ %3C?%20$_SERVER ['PHP_SELF']; %20?%3E
Does that help?
Maybe i dont have something enabled in php.ini. Anything specific that should be on?




    Viewed: 11,587 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Complete Members System error" Posted: @ 6:12 pm on Feb 18 2007    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

Is it an Apache server? Im not much help to you there. I do have a feeling you will need to make adjustments in your php.ini file. I question the URL a bit.

Just a hunch here, but in your form, do you have this for the form action:

action=&quo t;<? $_SERVER['PHP_ SELF']; ?>" If you don't open and close PHP before and after $_SERVER['PHP_ SELF'] it may pass it along the URL as if it is an existing page...




-bs0d | AllSyntax.com

    Viewed: 11,583 Times | Reply to This | To top
  This user is offline  misterhaan
  Subject: "re: Complete Members System error" Posted: @ 3:57 pm on Feb 19 2007    

Member #: 5
Rank: User - (213)
Since: 02/11/05
Posts: 148
From: chair

is your server set up to use apache? you can try saving this code as info.php and accessing it through the browser -- if php is set up correctly you'll get a lot of information. if it's not set up, you'll just see the contents of the file and will need to tell apache to use php and where to find it.


Code:

<? phpinfo(); ?>






please note that the above post is likely made up in its entirety.

    Viewed: 11,550 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register








"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank