form submit - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: form submit (/showthread.php?tid=3689) |
form submit - El Forum - 10-17-2007 [eluser]wojtekk[/eluser] Code: <form action="submit.php" method="POST"> in submit.php i want to put some data to database and then send post data from form to other site (pay system) how can i do this? Thx for any help form submit - El Forum - 10-17-2007 [eluser]meridimus[/eluser] Watch both these video tutorials, will take 25 minutes of your time but then you'll be able to do what you want. http://codeigniter.com/tutorials/ form submit - El Forum - 10-17-2007 [eluser]cinewbie81[/eluser] Not sure if this is what you are looking for: form_open('paysystem/save'); form_submit('mysubmit', 'Submit'); class Paysystem extends Controller { function Paysystem() { } function save() { // put data to database here field['name'] = $this->input->post('name'); // blah blah and save into the database } } form submit - El Forum - 10-17-2007 [eluser]wojtekk[/eluser] i know how forms works and how to put data to database the problem is how to send them futher with post i could use onclick sumbit button make AJAX call to submit.php (so it would be normal html post to action url and ajax would make input to database) or just use GET: in controller Code: header( 'Location: siteurl?datafromform'); and it works but i want send them with POST form submit - El Forum - 10-17-2007 [eluser]nmweb[/eluser] http://nl3.php.net/curl Curl is what you need. Your php script opens up a http connection to the website and POSTS whatever it wants. It might seem difficult at first but once you delve into it it becomes easier, there are several tutorials available to help you out. If the other website is your's it becomes easier since you know what the form checks for, if not use an extension for Firefox that lists all your headers and copy those to the proper curl function so as to mimic a browser. On the php.net page there are several scripts in the notes. If curl is not installed it's still possible using http-sockets in php, don't know about that though. form submit - El Forum - 10-17-2007 [eluser]nmweb[/eluser] If you have php5, you can also use this http://nl3.php.net/manual/en/ref.http.php form submit - El Forum - 10-17-2007 [eluser]wojtekk[/eluser] i already try sockets and curl but i send post parameters i even can echo result but how to go to this url? this is pay sytem and i need to redirect to the page where i send those data so that client could put there more data, then he click few things and will be redirected to adress which i put in pay system and then i will update database with transaction status form submit - El Forum - 10-17-2007 [eluser]nmweb[/eluser] I don't really understand what you mean. If it is a proper payment system it should have an API to handle this stuff. Otherwise I wouldn't know. form submit - El Forum - 10-17-2007 [eluser]wojtekk[/eluser] its works like that -form put some data (like shop id, amount) -submit to pay system page where is form, client put some data(like number of card,bank) (i need to put to database that he chose to pay) -submit redirect back to my page with transaction status(is he paid, is he had enought cash) its all work but curently on GET and GET soon will be deprecited so i need POST form submit - El Forum - 10-17-2007 [eluser]wojtekk[/eluser] ok i skip the problem by makeing 2 forms form 1 chose data ->submit->add to database->form 2 are u sure->(yes->pay system redirect u to bank page->pay->redirect u to shop) or (no->remove from database back to shop) |