[SOLVED] call another script automatically

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
jbatty
Forum Commoner
Posts: 35
Joined: Tue Sep 23, 2003 2:42 pm

[SOLVED] call another script automatically

Post by jbatty »

Just a quick one, please.

HOw do i call another PHP script at the end of script? I want the first script to hand over the the second automatically passing one variable on.

Thank you
User avatar
vigge89
Forum Regular
Posts: 875
Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden

Post by vigge89 »

just create a php-file that has include("script.php");
at the end of it, and it will be executed automatic.
Example;
page.php:

Code: Select all

<?php

$var1 = "Something";

$somename = "Brian";

include(script.php");

?>
script.php:

Code: Select all

<?php

echo $var1

echo $name

?>
when you include something, you put everything in the file you include in the place you include it....
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

[php_man]include[/php_man]()
[php_man]require[/php_man]()
jbatty
Forum Commoner
Posts: 35
Joined: Tue Sep 23, 2003 2:42 pm

Post by jbatty »

Thank you all!
User avatar
vigge89
Forum Regular
Posts: 875
Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden

Post by vigge89 »

your welcome :)
jbatty
Forum Commoner
Posts: 35
Joined: Tue Sep 23, 2003 2:42 pm

Post by jbatty »

Thank you all!
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

np ;)
Post Reply