By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,642 Members | 1,674 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,642 IT Pros & Developers. It's quick & easy.

php script kicking off another php script

P: 28
Hello there,

I've a script that uses sql,php and html.I need this script to call another script.The script generates check boxes for the users to select, before the button is clicked.But after the button is clicked the selected checkboxes values are grouped in a string,which is directed to the same page that displays a link that directs to the required another script.Instead,i want to do it differently.I want the string to be directed to the required script without an intermediate link.I'm very new to php and dont know how to do this.Can anybody please help me with this.My script goes as follows:


if(!isset($button))
{
display of checkboxes
}
else
{
.
.
..
makes a string of all selected checkbox values
displays a link that directs to the required page
///this link should be avoided and the string should be sent to the other script as input for its execution
}

Thanks,
Shara.
Jan 19 '07 #1
Share this Question
Share on Google+
9 Replies


10K+
P: 13,264
Hello there,

I've a script that uses sql,php and html.I need this script to call another script.The script generates check boxes for the users to select, before the button is clicked.But after the button is clicked the selected checkboxes values are grouped in a string,which is directed to the same page that displays a link that directs to the required another script.Instead,i want to do it differently.I want the string to be directed to the required script without an intermediate link.I'm very new to php and dont know how to do this.Can anybody please help me with this.My script goes as follows:


if(!isset($button))
{
display of checkboxes
}
else
{
.
.
..
makes a string of all selected checkbox values
displays a link that directs to the required page
///this link should be avoided and the string should be sent to the other script as input for its execution
}

Thanks,
Shara.
Ah, but you can get help for this in the PHP forum.
Jan 19 '07 #2

Atli
Expert 5K+
P: 5,058
Ok wow I read this 5 times and I didnt get it. Could you clarify what you mean?
Linebreaks are your friend ;)
Jan 19 '07 #3

P: 28
Ah, but you can get help for this in the PHP forum.
I'm not able to find the solution i need in the forum.I've seen some functions like passthru,exec,backtickoperator,etc. and tried them all in my script but none served my purpose.Can you tell me the right approach for this.

Thanks,
Shara.
Jan 19 '07 #4

P: 28
Ok wow I read this 5 times and I didnt get it. Could you clarify what you mean?
Linebreaks are your friend ;)
Hello Atli,

Sorry if i confused you.All that i need is just to get one php script generate some input for and also execute a different php script (without taking the help of a button or a hyperlink sort_ofs) ,which takes that input to give some xls output.I'm able to achieve it with an intermediate link which i dont want now.

Thanks,
Shara.
Jan 19 '07 #5

Atli
Expert 5K+
P: 5,058
Ahh ok..

You can simply include that script into you running code using the include or require functions.

Thusly:

[PHP]
$myvar = "SometextIneedtopass";

// Include the php, wich gets executed after this line
include("myphp.php");

// Executed after myphp.php
[/PHP]

If you dont like that you can probbly use headers

Like so:
[PHP]
header('Location: myphp.php?myvar=SometextIneedtopass');
[/PHP]
This would have to be sent before you do any output to the browser tho, wich is very limiting.
But if you use it you can get you var by using $_GET['myvar']

Hope this helps :)
Jan 19 '07 #6

MMcCarthy
Expert Mod 10K+
P: 14,534
This question is being moved to the PHP forum.

ADMIN
Jan 21 '07 #7

ronverdonk
Expert 2.5K+
P: 4,258
Welcome to the PHP forum, your friendly neighbourhood php help desk!

shara: is your question answered or are there still items to be resolved?

Ronald :cool:
Jan 21 '07 #8

P: 28
Hello Atli,

Thank you very much.Your idea of including header helped me to go to the required page.

Thanks,
Shara.






Ahh ok..

You can simply include that script into you running code using the include or require functions.

Thusly:

[PHP]
$myvar = "SometextIneedtopass";

// Include the php, wich gets executed after this line
include("myphp.php");

// Executed after myphp.php
[/PHP]

If you dont like that you can probbly use headers

Like so:
[PHP]
header('Location: myphp.php?myvar=SometextIneedtopass');
[/PHP]
This would have to be sent before you do any output to the browser tho, wich is very limiting.
But if you use it you can get you var by using $_GET['myvar']

Hope this helps :)
Jan 22 '07 #9

P: 28
Thank you .My question is completely answered.






Welcome to the PHP forum, your friendly neighbourhood php help desk!

shara: is your question answered or are there still items to be resolved?

Ronald :cool:
Jan 22 '07 #10

Post your reply

Sign in to post your reply or Sign up for a free account.