|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
quickform question
does anyone know how to redirect on successful submisssion to another page in Quickform? Thx.
|
|
#2
|
|||
|
|||
|
RE: quickform question
Please be more specific. The general answer is:
after you have done all your processing but before you print any characters out, do a I don't think quickform has any internal options where you can set the redirected page where it will do that automatically, but if it DID do that, that's the cod it would us to do so. If that isn't what you mean, please elaborate. |
|
#3
|
|||
|
|||
|
RE: quickform question
Sorry for being vague.
Here is what I want to do. I have page1.php that accepts user input which has quickform rules behind it. If it successfully validates.......then it will insert into the database....and move onto the next page (page2.php). This page will then allow the user to upload images to the filesystem on the server. I however need the auot-generated id from the insert into the mysql table to be passed to page2.php. Problem that I have is that there are alot of Quickform examples, however after things validate ok......they just spit out simple text....they don't show how to goto another page. I just tried your recommendation <?php header("Location: otherpage.php"); ?> and it works! However can you confirm as to if the form variables get passed along too or not? Thanks. Your help is very much appreciated! |
|
#4
|
|||
|
|||
|
RE: quickform question
try require(page2.php) after page1 is done executing
this will execute page2.php code withing the variable space of your current execution. as opposed to starting a new php execution space to handle the request. so the $_GET or $_POST will still be there if page2.php trolls them, and any other variables you defined in page1 will be ther for page2 to read. I think that is what you are looking for. if not try looking into curl() functions or even just redefine the $_GET variables for the next page header("Location: page2.php?foo=$foo&bar=$bar"); |
|
#5
|
|||
|
|||
|
RE: quickform question
the require didn't work quite right (no variables). So i'll look at the curl() function and/or building the _get vars. Thanks for your help.
|
|
#6
|
|||
|
|||
|
RE: quickform question: Require_once works but not as expected
Dear Sir/Madam
With repect to this i have a simple problem while using require_once.php. as per your advise i got the same Workspace and all form varible in the page2.php. however the control is not as required. PROBLEM: After using the Require_once 'page2.php' it still re-displays the page1.php at the end of the Displayed for image of the problem (tested and you can re-produce the errors); Php 5.04/Apache 2, windows 2003 --page1.php-- <?php /* PROBLEM: After using the Require_once 'page2.php' it still re-displays the page1.php at the end of the Displayed page2.php image of the problem --page1.php-- */ require_once('HTML/QuickForm.php'); $obj_search_form = new HTML_QuickForm('frmSearch','POST'); $obj_search_form->addElement('text','txtCode','CODE:',array('size' =>10,'maxlength' =>10)); $obj_submit[] = &HTML_QuickForm::createElement('submit', 'btnSubmit', 'GO'); $obj_search_form->addGroup($obj_submit, '', '', '  '); if($obj_search_form->validate()) { // post-validation filters comes here $obj_search_form->applyFilter('__ALL__', 'addslashes'); // "search_mserver_logdata" function to search $obj_search_form->process('search_mserver_logdata', false); //require_once('page2.php.php'); // the above direction does not pass varibles } function search_mserver_logdata($ary_sloginput_info) { $tcode=$ary_sloginput_info['txtCode']; echo "before calling: $tcode "; echo " "; require_once('page2.php'); } ?> <HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS Pragma: no-cache"> <TITLE>Serverlogcheck</TITLE> </HEAD> <BODY> <?php // display the form here $obj_search_form->display(); ?> </BODY> </HTML> ------------------Page2.php---------- <HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS Pragma: no-cache"> <TITLE>Serverlogcheck</TITLE> </HEAD> <BODY> <?php // display the data here $tActcode=$ary_sloginput_info['txtCode']; echo "<P>"; echo var_dump($ary_sloginput_info); echo "<P>"; echo " inside the page2.php: $tActcode"; ?> <p>c 2005 baka. All rights reserved.</p> </BODY> </HTML> ----------------------page2.pgp ends here--- Thanks for the wondeful reply. baka Tokyo,Japan |
|
#7
|
|||
|
|||
|
RE: quickform question
You need quickform-controller to get this done.
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PEAR Packages > quickform question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|