PEAR Packages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPEAR Packages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old September 27th, 2005, 04:26 AM
plummer plummer is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 plummer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
quickform question

does anyone know how to redirect on successful submisssion to another page in Quickform? Thx.

Reply With Quote
  #2  
Old September 27th, 2005, 06:49 AM
ednark ednark is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 25 ednark User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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
php Code:
Original - php Code
  1.  
  2. <?php header("Location: otherpage.php"); ?>


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.

Reply With Quote
  #3  
Old September 28th, 2005, 05:44 AM
plummer plummer is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 plummer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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!

Reply With Quote
  #4  
Old September 28th, 2005, 03:15 PM
ednark ednark is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 25 ednark User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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");

Reply With Quote
  #5  
Old September 28th, 2005, 10:11 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
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.

Reply With Quote
  #6  
Old October 17th, 2005, 06:26 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
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, '', '', '&nbsp;&nbsp');
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

Reply With Quote
  #7  
Old November 4th, 2005, 02:36 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
RE: quickform question

You need quickform-controller to get this done.


Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPEAR Packages > quickform question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek