473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

passing variables from current url in new href url in HTML code.

I would like to use code to collect variables from a current url like:

http://www.example.com/trythis.php?v...iable&?num=123

I can not find a proper way to get the variable num=123 into an url located in the body of my HTML. For example

<a href="http://www.example.com/promo_board.php?tid=209&?num=(the desired num variable here)">
May 11 '10 #1
4 2452
dlite922
1,584 Expert 1GB
use $_GET.

Expand|Select|Wrap|Line Numbers
  1. <?php echo $_GET['num']; ?>



Dan
May 11 '10 #2
Thanks Dan,

tried it, but don't know how to get the fetched value in the new link address.
How do I get the value in there?

When I use echo I see that it presents the right value as expected, but when clicking the new link, it added just the variable name, instead of the value!
I am directed to a website with url:

http://www.example.com/promo_board.php?tid=209&?num=

Were it misses the 123 value?
May 11 '10 #3
zorgi
431 Expert 256MB
@Cosmic Surfer
Is there some code? How do you generate those links?
May 12 '10 #4
dlite922
1,584 Expert 1GB
You only need one question mark, where you have two:

?var=variable&?num=123

should be

?var=variable&num=123

get rid of the second one. The reason why It didn't show (i bet) is the 123 value was stored in $_GET['?num'] instead of $_GET['num'];





Dan
May 12 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Matthew Robinson | last post by:
i read a tutorial the other day on passing variables between php pages using a html form and setting the action to the php page to parse, can anybody see anything wrong with the code below? the...
2
by: Chieko Kuroda | last post by:
Hello all, I would like to learn the syntax for passing variables that I retreived from a database to a second asp page. Currently, I'm using: Response.Write "<tr><td>&nbsp;</td><td><Font size=...
1
by: Consuelo Guenther | last post by:
Hello, I am having problems with passing variables between pages. I have the following: First asp page has the function: -----------------------------------------------------------------------...
7
by: Khai | last post by:
First off, yes, I understand the crapload of tutorials out there, (well, rather, I understand there /are/ a crapload of tutorials out there), the problem is my comprehension. I'm trying to pass...
2
by: rowen33 | last post by:
I am trying to pass a variable form one Netscape 4.79 html page to another using Javascript? How can I do this? Greatly appreciated...
3
by: jsdeveloper | last post by:
Hi, I just started programming in javascript, and I'm having a problem passing variables between javascript and asp code in .asp page. Can you please help? I've given the sample code below. ...
26
by: webrod | last post by:
Hi, I have some php pages with a lot of HTML code. I am looking for a HTML validator tool (like TIDY). TIDY is not good enough with PHP tags (it removes a lot of php code). Do you have any...
2
by: sateeshchandrasanga | last post by:
Hi All, My HTML code is working fine in Firefox.But its not displaying any thing in IE.Can you help me in this problem.And in Google crown its displaying but not properly. ...
1
by: mbewers1 | last post by:
Hi there, I'll try and explain this as best as I can. I have a search page which generates a GridView of results based on the search terms entered by the user. One of the columns in GridView...
3
by: digituf | last post by:
i have page findroom.php that will redirect to the page DisplayDetails.php. i wanted the DisplayDetails.php page to display data from the query in the page findroom.php. The data that i wanted to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.