Jump to content

How to pass a value to multiple PHP programs?


jr8rdt

Recommended Posts

How to pass a value to multiple phps?

 

I want to pass $id_chart to a.php, b.php, c.php, d.php all at once , automatically, without user interaction.

a.php, b.php, c.php, d.php are graphics maker which take $id_chart to create graphs.

 

<?php
$id_chart = $_REQUEST[id1];
?>

<html>
<img src="a.php"  border=0 align=center width =640 height=480>
<p>
<img src="b.php"  border=0 align=center width =640 height=480>
<p>
<img src="c.php"  border=0 align=center width =640 height=480>
<p>
<img src="d.php"  border=0 align=center width =640 height=480>
</html>

 

Link to comment
Share on other sites

<img src="a.php?id_chart=<?php echo $id_chart; ?>"  border=0 align=center width =640 height=480>

<img src="b.php?id_chart=<?php echo $id_chart; ?>"  border=0 align=center width =640 height=480>

<img src="c.php?id_chart=<?php echo $id_chart; ?>"  border=0 align=center width =640 height=480>

<img src="d.php?id_chart=<?php echo $id_chart; ?>"  border=0 align=center width =640 height=480>

 

Ray

Link to comment
Share on other sites

still not working . the problem is when I run below program the url says

...chart.php?id1=17

 

why it is id1 and not id_chart

id1 inside chart.php is 17 but when it is passed to a.php it is empty.

it is understandable.

so the question again is why the url is passing id1 and not id_chart?? id_chart  has the correct value

 

<?php
$id_chart = $_REQUEST[id1];
echo $id_chart;
?>

<html>



<img src="a.php?id_chart=<?php echo $id_chart; ?>"  border=0 align=center width =640 height=480>
<p>
<img src="b.php?id_chart=<?php echo $id_chart; ?>"  border=0 align=center width =640 height=480>
<p>
<img src="c.php?id_chart=<?php echo $id_chart; ?>"  border=0 align=center width =640 height=480>
<p>
<img src="d?id_chart=<?php echo $id_chart; ?>"  border=0 align=center width =640 height=480>

</html>

Link to comment
Share on other sites

Try this

<?php
$id_chart = $_REQUEST['id1'];  // should have quotes around anything that is not an integer
echo $id_chart;
?>

<html>



<img src="a.php?id_chart=<?php echo $id_chart; ?>"  border=0 align=center width =640 height=480>
<p>
<img src="b.php?id_chart=<?php echo $id_chart; ?>"  border=0 align=center width =640 height=480>
<p>
<img src="c.php?id_chart=<?php echo $id_chart; ?>"  border=0 align=center width =640 height=480>
<p>
<img src="d?id_chart=<?php echo $id_chart; ?>"  border=0 align=center width =640 height=480>

</html>

 

Also on your a,b,c,d pages. Is it looking for the parameter id_chart or id1??

 

Ray

Link to comment
Share on other sites

depends if u want user to see the output of the scripts or not.

 

if they are generated images, u can use the <IMG tag, so user can see the generated output.

 

if u dun want user to see the scripts output, u can use fopen('url'), however keep in mind of the timeout.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.