Need Help Please!

Reply

Join Date: Sep 2007
Posts: 1
Reputation: stagnation is an unknown quantity at this point 
Solved Threads: 0
stagnation stagnation is offline Offline
Newbie Poster

Need Help Please!

 
0
  #1
Sep 11th, 2007
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:

  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.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,438
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 510
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: Need Help Please!

 
0
  #2
Sep 11th, 2007
echo "<a href='index.htm?pic=$num1'>Link text</a>";
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 494
Reputation: Puckdropper is an unknown quantity at this point 
Solved Threads: 21
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

Re: Need Help Please!

 
0
  #3
Sep 12th, 2007
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?
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC