Help !! How should the IMG SRC be defined

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
DavidAKey
Forum Newbie
Posts: 3
Joined: Thu Jan 08, 2004 4:24 am

Help !! How should the IMG SRC be defined

Post 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
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post 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]
Last edited by scorphus on Thu Jan 08, 2004 9:00 pm, edited 3 times in total.
DavidAKey
Forum Newbie
Posts: 3
Joined: Thu Jan 08, 2004 4:24 am

Post by DavidAKey »

Many thanks Scorphus will try it out now!
Post Reply