Page 1 of 1
Launching another PHP Script
Posted: Sat Mar 29, 2003 3:39 pm
by Rob Watton
I have a small problem.
I have a simple IF statement which depending on the condition I want it to run another PHP script in the same window but clearing the window on launch of the external script.
eg.
if ($matches >0){
---->>> run EDITDATA.PHP here
}else
{
print "No results found";
}
Can anyone help ?
Regards
Rob.
Posted: Sat Mar 29, 2003 3:42 pm
by bionicdonkey
lookup header();
Posted: Sat Mar 29, 2003 3:44 pm
by Rob Watton
Have tried header, but as the current window has a form on it and the if statement is executed on submit of the form.
When I run the header statement nothing happens.
Rob.
Posted: Sat Mar 29, 2003 7:31 pm
by m3mn0n
What do you mean by "clearing the window"? Also i think a javascript is capable of doing something like this. I've never seen php do it, if it does you must tell me how.

external window
Posted: Sat Mar 29, 2003 9:19 pm
by phpfreak
hi there,
this script takes the value from the text box match and if it is above 0 then it will call another php script called hello.php.
it runs hello.php in forif.php thus by running in the same window.The exit function in the hello.php does not allow the remaining script of the forif.php to run.
i hope this helped, if this is not what you wanted then please post it and i will try to help if i can.
===============
forif.php
-------------
<?php
session_start();
if(!isset($Submit))
{
}
else
{
if($Submit=="Find My match")
{
if($match>0)
{
include 'hello.php';
}
}
}
?>
<html>
<body>
<form name="form1" action="<?php echo $PHP_SELF?>">
Match:<br><input type="text" size="2" maximum="2" name="match">
<br><input type="Submit" name="Submit" value="Find My match">
</form>
</body>
</html>
------------
=============
hello.php
------------
<?php
echo "hi there how are u doing";
exit();
?>
=============
regards,
srinivas