Page 1 of 1

Help !! How should the IMG SRC be defined

Posted: Thu Jan 08, 2004 4:24 am
by DavidAKey
As a novice I was hoping to call upon some of the experts in this forum to offer the kind advice.

I have an html form with two fields -dkfld1 & dkfld2- the form is processed by the script dkphp1.php Script dkpkp1.php creates an image using dkphp2.php <IMG SRC="dkphp2.php" > How should the IMG SRC in dkphp1.php be defined to pass the values of dkfld1 & dkfld2 And then in dkphp2.php can these values be referenced

I hope you can help.

Many thanks in advance

Posted: Thu Jan 08, 2004 7:02 am
by scorphus
You could use GET method.

In dkpkp1.php you have access to the posted variables ($_POST['dkfld1'] and $_POST['dkfld2']) so you could call the image passing these two variables through GET:

Code: Select all

<img src="dkphp2.php?dkfld1=<?php echo $_POST['dkfld1']; ?>&dkfld2=<?php echo $_POST['dkfld2']; ?>" border="0" />
and then use $_GET['dkfld1'] and $_GET['dkfld2'] in dkfld2.php.

Hope it helps,
Scorphus.

[edit]
Dave, welcome to PHPDN. Please don't crosspost. Take a look at Before Post Read: General Posting Guidelines.
[/edit]

Posted: Thu Jan 08, 2004 7:08 am
by DavidAKey
Many thanks Scorphus will try it out now!