User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,466 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,776 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 424 | Replies: 2
Reply
Join Date: Sep 2007
Posts: 1
Reputation: stagnation is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
stagnation stagnation is offline Offline
Newbie Poster

Question Need Help Please!

  #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:

<?
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
Last edited by stagnation : Sep 11th, 2007 at 12:56 pm.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2007
Location: USA
Posts: 3,090
Reputation: Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold 
Rep Power: 15
Solved Threads: 307
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Posting Sensei

Re: Need Help Please!

  #2  
Sep 11th, 2007
echo "<a href='index.htm?pic=$num1'>Link text</a>";
Reply With Quote  
Join Date: Jul 2004
Location: North East Indiana
Posts: 491
Reputation: Puckdropper is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 20
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

Re: Need Help Please!

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the PHP Forum

All times are GMT -4. The time now is 2:19 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC