Check a database on form submission
Posted: Mon Jul 12, 2010 5:52 pm
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
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