473,408 Members | 2,888 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,408 software developers and data experts.

Pass data to another page?

I need to pass data from one web page to another.

For example I have 10 products, when the user clicks the price of the product I need to load a new page which can display data from the first page such as description, price, quantity etc.

not sure if i need to do this in PHP or if it can be done in HTML?

Any help appreciated.

thanks
May 13 '09 #1
4 7109
Markus
6,050 Expert 4TB
@pqsoftware
HTML cannot do this, no. You could use Javascript to avoid using server-side programming.

However, while we are here, we may as well discuss the options.

You may have noticed complex looking URLs like so: http://site.com/?name=markus&age=18&desc=very%20sexy. This is using a route that passes information via the URL. This information can be obtained via the GET array (links at bottom). How do I get the info to the URL, you may ask? Well, if you set a form's action attribute to 'get', open submitting the form, it will create and append the data within the form to the URL. As said before, you then have access via the GET array.

Another option is the POST (links at bottom) array, this is sometimes preferable to GET as the data is not easily visible to the user; it is not passed via the URL, but by magic. This option can be achieved by setting the form's action attribute to 'post'.

There are other options such as SESSION or COOKIE that are used to pass data between pages.

Mark.
May 13 '09 #2
dlite922
1,584 Expert 1GB
@pqsoftware
HTML is not a programming language, but a markup language. To achieve your solution in HTML, you'd have to create a html page for each product detail and go to that page (hard code the name) from the product summary page.

to do it with PHP is very easy. You can pass it via the URL such as:

yoursite.com/productDetail.php?productID=12345

then on productDetail you can get the productID with $_GET['productID'].

From this product ID you can pull the rest of your product info from your data soruce...which I hope is a MySQL database.

Cheers,



Dan
May 13 '09 #3
dlite922
1,584 Expert 1GB
Ahhhg... you beat me to it. shouldn't have taken that smoke break. :)



Dan

@Markus
May 13 '09 #4
Markus
6,050 Expert 4TB
It takes you 45+ minutes for a smoke? What the chuff are you smoking? ;)
May 14 '09 #5

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

Similar topics

7
by: Andy Fish | last post by:
Hi, I have a javascript solution where page A launches page B in a second window and then they can pass data between them. That's all well and good. Now say page B wants to navigate to page C...
4
by: tom | last post by:
Hi Experts, I want to pass the selectedDate value from my calender form to another web form or a web user control. Could you please show me how to do this? Thanks in advance.
8
by: darrel | last post by:
I'm still trying to fully understand how best to pass variables between pages/usercontrols/each other. On a current site I've done, I've had one userControl do the logic and set the variable,...
2
by: KFactor | last post by:
Is it possible to pass form variables to a page on another server using response.redirect? Or is there a secure way of passing sensitive information from one site to another such as a userID? ...
2
by: c676228 | last post by:
Hi, This is my first time to post asp.net question on this forum. I have a question for "How to pass the first form value to the next form" I have enrollinfo.aspx form which look like as follow:...
2
by: David Thielen | last post by:
Hi; I have a IHttpHandler that is generating a page. If it throws an exception I want to put up a nice page that is based on my master page so it looks good. How can I redirect from my...
17
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the...
5
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, Is there an easier way to handle that? I used Javascript to handle this when our two domains are hosted on two different servers(on different networks) and our search engine marketing...
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
9
by: JRough | last post by:
I tried to pass the $result from a mysql_query in a url like this line Header("Location:clm_historyXL.php?_result=".$result); but on the redirect location clm_history.php page I get an error on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.