Dear Sir/Madam
I have a simple problem while using require_once functionality.
(This mail is cross posted on web one is japan, one in google , bear me for reading for the second time -for any chance)
Page1.php is using as an input form , and after input, the control will
be transfered to pgae2.php with the same Workspace env as page1.php.
Page2.php will be displayed as per my requirement, however after the
page2.form,
again the page1.php will be dusplayed a the tail.
All form varible of page1.pgp are accessable in the page2.php.
However the control is not transfered as expected.
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 to page2.php
}
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 in advance .
baka
Tokyo,Japan