username01 Posted November 19, 2010 Share Posted November 19, 2010 Hi everyone. I would like to do this: In page1.php, I need to make a few checkboxes, which when the user clicks "next" button, transfers the data (which checkboxes were clicked) to a database table. Then, when the user clicks a button "next", he is moved to another page, page2.php, from which he is automatically transferred to page3.php. At page3.php those values are gathered from the database, and the user has to click "next" button again, then those values are written into another table, in the same or another database. How can I do this? I've not much knowledge with neither SQL, neither PHP. I hope you will help me make this work, I'm making a little system for my HTML website. Thanks, if you do! Quote Link to comment Share on other sites More sharing options...
username01 Posted November 20, 2010 Author Share Posted November 20, 2010 No one knows? :/ Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 20, 2010 Share Posted November 20, 2010 It isn't really clear what you're trying to do. Especially the part about "he is moved to another page, page2.php, from which he is automatically transferred to page3.php" . . . Quote Link to comment Share on other sites More sharing options...
username01 Posted November 20, 2010 Author Share Posted November 20, 2010 Thanks for your reply. I will try to explain it more clearly. There is index.php with 5 checkboxes and a username field. User checks any number of those checkboxes, writes his name and clicks "next" button. After he clicks "next", the data, which is different, from which checkboxes were checked, is transferred to database1. For each checkbox, there is a letter. For example - for first - a, second - b, third - z, fourth - d, fifth - l. His username too. Also, if possible, the date and his IP address (at least the date). So he is on page1.php now... He do something on this page (unrelated to this system), in the end he is transferred to page2.php. So he is at page2.php now. The page2.php collects the values from the database1, and automatically checks checkboxes, so they look like at index.php. Also, it prints his IP address and name. Every value can be still changed. There is a "next" button. When the button is clicked, the values from these checkboxes, then are transferred to database2 and insert in 3 columns - name, ip and letters(checkboxes). I hope, that I made this explanation clearer. Quote Link to comment Share on other sites More sharing options...
username01 Posted November 21, 2010 Author Share Posted November 21, 2010 Hmmm, have I explained it bad again? :/ Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 21, 2010 Share Posted November 21, 2010 This page on which the user does something unrelated, is it on the same server, or a different server? Quote Link to comment Share on other sites More sharing options...
username01 Posted November 22, 2010 Author Share Posted November 22, 2010 It is on a different server. Quote Link to comment Share on other sites More sharing options...
username01 Posted November 25, 2010 Author Share Posted November 25, 2010 So no one will help with that? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 25, 2010 Share Posted November 25, 2010 I kind of lost track of the thread, but I do have a question. How are you going to ensure the user returns to your site after the excursion to the unrelated site? Quote Link to comment Share on other sites More sharing options...
username01 Posted November 25, 2010 Author Share Posted November 25, 2010 The unrelated site sends him back to my site, when he clicks a button. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 27, 2010 Share Posted November 27, 2010 I don't think there's going to be a reliable way to do this, unless you have control over what data the other site sends back. Quote Link to comment Share on other sites More sharing options...
username01 Posted November 27, 2010 Author Share Posted November 27, 2010 No, I don't. I have a control, what to send to the site... Hmm. I could ask to do it another way, but then it would a little different. I could send some data to the 'unrelated' site, and send the data from the checkboxes to the database. Then, when the site will send the user to my chosen site... It could be, that it would do some different thing. Hm. Maybe, if someone could say, that he/she could do it, could send me a PM, and I could give the details, why and what exactly would be the use of it. Or, maybe I could PM you, Pikachu, and ask for advice, what would be the reliable way to do it? I don't want to post the exact use of this system I thought of in public. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 27, 2010 Share Posted November 27, 2010 The major issue I can foresee here is that you insert a record into the database, send the user off to another, unrelated site, and expect that they'll always come back and continue the process. I think you're going to end up a lot of orphaned records in the database because you have no way of ensuring the user returns. On the other hand, if you were to keep the user on your site, and use something like cURL to send the data to the other site, you'd have much better control over the flow, you could store the form data in a $_SESSION var, and insert it all at once when the final form is submitted. Quote Link to comment Share on other sites More sharing options...
username01 Posted November 28, 2010 Author Share Posted November 28, 2010 Hm, there won't be many users. I will be able to manually clean the database occasionally. There may be... Few users a month. It's a small community. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 28, 2010 Share Posted November 28, 2010 Based on what you've said, I think the first thing I'd try would be storing the results of the first form in $_COOKIEs. Then when the user returns from the external site, use the $_COOKIE values to populate the next form. When that form is submitted, you can save the data to the database. That should help keep orphaned records to a minimum, and still allow you to access the data from the first form when the user returns. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.