hi,
my home page is an INSERT form, the user is not logged in yet and may not even be a registered user.
they fill out the INSERT form with what they want to buy, and it goes to the postingTable(post_id, user_id(not assigned yet b/c user not logged in), productInfo, valid(set to NO until user logs in).
i'm good to this point.
the problem: after they insert the user needs to either login or register to complete the post.
let's assume they are a new user, they fill out the INSERT form, and are sent to register.php to sign up. once they fill out the registration form (which this info goes into a separate table, the userTable) then how do i simultaneously update the postingTable? i need to somehow match up the post_id to a $_SESSION variable so that i can UPDATE the postingTable, updating both the user_id and valid = 'yes'...
any help is more than welcomed, i've been stuck on this issue going on three days now.
thank you!
$_SESSION passed with insert form b4 user logs in
Moderator: General Moderators
-
ninethousandfeet
- Forum Contributor
- Posts: 130
- Joined: Tue Mar 10, 2009 4:56 pm
Re: $_SESSION passed with insert form b4 user logs in
Best bet is to just insert the session_id() into the table when you first insert it, you can then marry this up when the user finishes off their registration.
I'm not sure what exactly you're doing but if you're creating a sort of wizard where they go through the process in stages then you'll be better off saving everything to a session and then saving it all to the database at the end, otherwise you'll have a tonne of useless rows in your database where users gave up half-way through or where autonomous users have submitted your form.
I'm not sure what exactly you're doing but if you're creating a sort of wizard where they go through the process in stages then you'll be better off saving everything to a session and then saving it all to the database at the end, otherwise you'll have a tonne of useless rows in your database where users gave up half-way through or where autonomous users have submitted your form.
-
ninethousandfeet
- Forum Contributor
- Posts: 130
- Joined: Tue Mar 10, 2009 4:56 pm
Re: $_SESSION passed with insert form b4 user logs in
if you've ever visited justanswer.com, then that is the overall idea of what i'm trying to do.
my most important goal is that i want to make it easy and obvious for users to post what they want to buy or sell.
it sounds like your second recommendation might be a good fit for my site. how do i go about saving all of this info to a session? i'm just diving into sessions. i'll start reading up and looking for info regarding your second option. if i find out anything new before i here back, then i will let you know.
thank you!
my most important goal is that i want to make it easy and obvious for users to post what they want to buy or sell.
it sounds like your second recommendation might be a good fit for my site. how do i go about saving all of this info to a session? i'm just diving into sessions. i'll start reading up and looking for info regarding your second option. if i find out anything new before i here back, then i will let you know.
thank you!