Launching another PHP Script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Rob Watton
Forum Newbie
Posts: 4
Joined: Wed Mar 19, 2003 5:22 am
Location: Staffordshie, UK

Launching another PHP Script

Post 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.
bionicdonkey
Forum Contributor
Posts: 132
Joined: Fri Jan 31, 2003 2:28 am
Location: Sydney, Australia
Contact:

Post by bionicdonkey »

lookup header();
Rob Watton
Forum Newbie
Posts: 4
Joined: Wed Mar 19, 2003 5:22 am
Location: Staffordshie, UK

Post 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.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post 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. :)
phpfreak
Forum Commoner
Posts: 30
Joined: Fri Mar 21, 2003 10:28 am
Location: New Jersey,USA
Contact:

external window

Post 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
Post Reply