form to database help

tonytony ModeratorAdministrator
rite, im hopeless at php/mysql, im learning a bit in about 3 weeks at uni but not gonna be soon enough

On my website ukhard house.info (without the space) on the right hand side you can see a form (username password fields and register log in buttons)

I want the register button to link to a website and i want the login button to check my phpbb database to check username and password to see if its correct, if so log them in, if not then dont do anything

I know this is a lot to ask so but could anybody do this for me? I cant really pay but i can give you a permanent text link on both my sites (sitewide) i can also give you forum dollers and maybe we can sort something else out, if your interested id really appreciate it, cheers
tony

Comments

  • ForgeForge Senior Member The Royal RAM
    This is what id do. Have a form on your site that the action is to the login screen of phpBB make sure the names of the input fields are exact and your on your way.
    Can fat people Go skinny Dipping?
  • dabossdaboss WP V.I.P. ''The Boss'' Administrator
    Tony, I'd do it for free. But it'd have to be over the weekend... :)

    Send a reminder in if this old fart forgets...
  • tonytony Moderator Administrator
    thanks that would be great, ill mither the life out ofyou if it helps? ;)

    i wont really but that would be great if you could do that, cheers
  • dabossdaboss WP V.I.P. ''The Boss'' Administrator
    Hi Tony,

    Scripts attached as promised :)

    The zip file contains 3 files - 2 html files and 1 php file. I tested them out on my laptop (with Apache, PHP and MySQL installed) and they work.

    To test it out yourself, copy the 3 files to the same location in your server. If you need to rename or have the files in separate locations (from each other), you will need to update the html and php files according (which is very simple to do actually).

    I've taken the liberty to include "forgot password" functionality for you. I guess this is quite normal nowadays.

    I've thought about it and the best way to implement the register new users functionality is to have a text link to the registration page instead of having a button. If you insist of having a button for it, let me know and I'll have a go at it for you.

    Logic:
    1. Call login_form.html with a browser
    2. Key in th username and password field and click on submit, login_form.html will call login_proc.php which will authenticate the user
    3. If the user forgot his password, he'll click on the "forgot password" text link which will direct the user to login_forgot.html
    3a. Key in the username and an email address to send the password to
    3b. Click the submit button
    3c. login_forgot.html will call login_proc.php which will retrieve the password out and send an email to the user (I've commented out the command to send the email as I was testing on my standalone laptop. Please uncomment the command yourself.)
    4. If the user wants to register (new user), he'll click on the "New Registration" text link which will direct the user to a another page (please put your own page in the link)

    Please change the following accordingly. At the moment, the script assumes that:
    1. Your host can be accessed using "localhost"
    2. Your database is called "test"
    3. Your database user is "phpuser"
    4. Your database user's password is "phpuser"
    5. Your login table is "login_tbl"
    6. Your login table has two fields named "login" and "password"

    Do test it out and tell me the results... Good luck!!!
  • tonytony Moderator Administrator
    thanks for that :)
    ill see if i can get it to work and let you know
  • dabossdaboss WP V.I.P. ''The Boss'' Administrator
    How did it go Tony? Hopefully you're OK with it...
  • tonytony Moderator Administrator
    i tried and couldnt get it working kept saying the password and or username was incorrect so im presuming ive not set it up properly to check the database, but im just changing hosts at the minute as mine is being a it of an ass so ill try again properly as soon as my DNS updates
  • dabossdaboss WP V.I.P. ''The Boss'' Administrator
    T,

    It would seem that you've got the connection to the database server wrong.

    These will have to be changed in the scripts...

    1. Your host can be accessed using "localhost"
    2. Your database is called "test"
    3. Your database user is "phpuser"
    4. Your database user's password is "phpuser{@}
  • tonytony Moderator Administrator
    i did changethem to what i thought wascorrect, i changed my host anyway everything is sorted so ill have another go when i get home tonight
  • dabossdaboss WP V.I.P. ''The Boss'' Administrator
    T, one tip for you. If your host is using CPanel, when you create the MySQL database, it will normally display to you the information to use to connect to the MySQL database - i.e. the server name (whether or not you can use localhost), usrname and passwd...
  • tonytony Moderator Administrator
    hi, thanks for your help and i never got to try that properly i found a fairly easy way round it, i coped the login.php script that come with phpbb edited to to look like what i wanted and i managed to get it working 1st time :)

    i am going to keep your script though as i know it will be useful in the future :)

    thanks again
  • dabossdaboss WP V.I.P. ''The Boss'' Administrator
Sign In or Register to comment.