944,039 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 761
  • PHP RSS
Sep 11th, 2007
0

Need Help Please!

Expand Post »
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:

PHP Syntax (Toggle Plain Text)
  1. <?
  2. if ($_POST['submit']) {
  3. $frame1 = $_POST['frame1'];
  4. $mount1 = $_POST['mount1'];
  5.  
  6. $num1 = $frame1 + $mount1;
  7. echo "<a href="\index.htm?pic=".$num1."\">"</a>;
  8. }
  9. ?>

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

Hope you can help!
Thanks
Rob
Last edited by stagnation; Sep 11th, 2007 at 12:56 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
stagnation is offline Offline
1 posts
since Sep 2007
Sep 11th, 2007
0

Re: Need Help Please!

echo "<a href='index.htm?pic=$num1'>Link text</a>";
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007
Sep 12th, 2007
0

Re: Need Help Please!

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?
Reputation Points: 23
Solved Threads: 23
Posting Pro in Training
Puckdropper is offline Offline
494 posts
since Jul 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Javascript Variables in PHP
Next Thread in PHP Forum Timeline: Pass Javascript variable to PHP code





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC