Page 1 of 1

Check a database on form submission

Posted: Mon Jul 12, 2010 5:52 pm
by markosjal
Hello,

I have been working on a classified ads site that is live. I have run into a snag that IU need some help with.

When a user goes to post an ad as an anonymous user, and that same user has an account, we want to force that user to log in.

in case that is not clear enough:

@post
if the email address matches an account 'email'
Save the current post
prompt for login
return to post, and submit from account after logging in (same form)

WHat needs ot happen on the back end is at the time the form is submitted the database table for "acc_users" needs to be checked to see if the email exists in the "email" field. If so we then need to temporarily save the data from the form and force the user to the login page.


Since I am totally illiterate at accessing a database from PHP I seek suggestions or examples , preferably with annotations so that even I may understand it.

Thanks is advance

Re: Check a database on form submission

Posted: Mon Jul 12, 2010 7:30 pm
by requinix
What you seek is Google.

Re: Check a database on form submission

Posted: Mon Jul 12, 2010 8:02 pm
by MHardeman25

Re: Check a database on form submission

Posted: Mon Jul 12, 2010 9:37 pm
by markosjal
no I do not seek google. I tried that. Google is not some secret that only you know.

As for the link to the database creation, thanks , but...I mean come on really?

Re: Check a database on form submission

Posted: Mon Jul 12, 2010 11:43 pm
by MHardeman25
well, i didn't know how far advanced you were, so I figured you should start from the beginning.

http://www.homeandlearn.co.uk/php/php.html

that's the entire tutorial list. Just find which one is appropriate for what you want to do.