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
4 7130 Markus 6,050
Recognized Expert Expert @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.
dlite922 1,584
Recognized Expert Top Contributor @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.p hp? 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
dlite922 1,584
Recognized Expert Top Contributor
Ahhhg... you beat me to it. shouldn't have taken that smoke break. :)
Dan @Markus Markus 6,050
Recognized Expert Expert
It takes you 45+ minutes for a smoke? What the chuff are you smoking? ;)
Sign in to post your reply or Sign up for a free account.
Similar topics |
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 (i.e. in the same window as page
B is currently in, and I want to pass information from B to C.
Currently I have it that B passes the information back to A before loading
C, and C then picks it up from A.
|
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.
|
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, and then I had other usercontrols simply read this by
traversing the class structure: siteClass.userControlClass.specficVariable.
That worked fine.
The new site I'm working on is a bit different, as I'm using multiple
|
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?
I would like to avoid using the querystring.
This is what I would like to do:
When a user clicks on the link, I need to add them to the database and then
|
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:
<form id="Form1" method="post" runat="server">
<Subway:Address id="address" runat="server" Caption="Home
Address"></Subway:Address>
<p></p>
<SUBWAY:PEOPLEINFO id="Peopleinfo" runat="server"
Caption="Employee Information"></SUBWAY:PEOPLEINFO>
| |
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 IHttpHandler to my handle_error.aspx page passing
it the exception in the request, not in the url. I would prefer to pass the
filename, line number and Exception.Message string but I can live with just
the Message.
|
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 returned value is ""
Anybody know how to set this value on 1st page properly, in order to let 2nd
page catch it? I don't want to use querystring to pass this value!
|
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 people don't like the javascript links since
they think the links are not favorable to a search robot.
Now our company is thinking about hosting these two domians on the same
server,
So I am wodering if there is any easy way to do that. Would you...
|
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.
Here is a newbie mistake that I found myself doing (as a newbie), and
that even a master programmer, the guru of this forum, Jon Skeet,
missed! (He knows this I'm sure, but just didn't think this was my
problem; LOL, I am needling him)
If...
|
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
this line:
$result = $_POST;
I need the $result on the clm_historyXL page to print a list to excel
because
of a header already being sent.
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |