Hi Guys

I need your help as what i am trying to develop is doing me head in :-)

I am developing a PHP form which basically adds two variable together. The final number then needs to placed in to a HTML url which triggers the image to be loaded on the next page. I am having problems creating the 'html link' on the echo request. Upon submission the url( with the number) needs to open in the same window.

the html link code looks like this:

index.htm?pic=4

What i need to know is how do put added together number in place of the 4.

Below is the script for adding the numbers together:

<?
if ($_POST['submit']) {
$frame1 = $_POST['frame1'];
$mount1 = $_POST['mount1'];

$num1 = $frame1 + $mount1;
echo "<a href="\index.htm?pic=".$num1."\">"</a>; 
}
?>

What is the correct form to put $num1 into the url??

Hope you can help!
Thanks
Rob

Recommended Answers

All 2 Replies

echo "<a href='index.htm?pic=$num1'>Link text</a>";

The way you've done it looks ok. My psychic debugging skills, however, are telling me it's something more...

You do know that variables in the URL are GET variables and not POST?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.