Check a database on form submission

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
markosjal
Forum Commoner
Posts: 63
Joined: Fri Apr 16, 2010 10:15 pm

Check a database on form submission

Post 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
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Check a database on form submission

Post by requinix »

What you seek is Google.
MHardeman25
Forum Commoner
Posts: 42
Joined: Mon Jul 12, 2010 10:34 am

Re: Check a database on form submission

Post by MHardeman25 »

markosjal
Forum Commoner
Posts: 63
Joined: Fri Apr 16, 2010 10:15 pm

Re: Check a database on form submission

Post 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?
MHardeman25
Forum Commoner
Posts: 42
Joined: Mon Jul 12, 2010 10:34 am

Re: Check a database on form submission

Post 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.
Post Reply