473,395 Members | 1,658 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,395 software developers and data experts.

URL GET data problem

Hi...

I have the following chunk of html output by my PHP script:
<select id="show_page" name="show_page">
<option value="3&year=2002&month=10">October 2002</option>
<option value="3&year=2003&month=10">October 2003</option>
<option value="3&year=2003&month=11">November 2003</option>
<option value="3&year=2003&month=12">December 2003</option>
</select>

But when I select one of these from the list and click submit, instead of
appearing like this in the address bar:

http://www.mysite.com/main.php?show_...=2002&month=10

It appears like this instead:

http://www.mysite.com/main.php?show_...3%26month%3D10

You can see the & and = characters have been substituted for the URL-safe
equivalents. I'm sure it's PHP doing this, as I have a 99% identical page in
ASP which works fine. Is there an option I can switch to stop it
translating?

TIA,

Plankmeister
Jul 17 '05 #1
2 3901
I noticed that Message-ID:
<3f*********************@dread11.news.tele.dk> from The Plankmeister
contained the following:
http://www.mysite.com/main.php?show_...3%26month%3D10

You can see the & and = characters have been substituted for the URL-safe
equivalents. I'm sure it's PHP doing this, as I have a 99% identical page in
ASP which works fine. Is there an option I can switch to stop it
translating?


Using a simple ampersand is not valid. Try:

<option value="3&amp;year=2002&amp;month=10">October 2002</option>
etc...
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2
On Mon, 8 Dec 2003 15:07:35 +0100, "The Plankmeister"
<pl******************@hotmail.com> wrote:
I have the following chunk of html output by my PHP script:

<select id="show_page" name="show_page">
<option value="3&year=2002&month=10">October 2002</option>
<option value="3&year=2003&month=10">October 2003</option>
<option value="3&year=2003&month=11">November 2003</option>
<option value="3&year=2003&month=12">December 2003</option>
</select>

But when I select one of these from the list and click submit, instead of
appearing like this in the address bar:

http://www.mysite.com/main.php?show_...=2002&month=10

It appears like this instead:

http://www.mysite.com/main.php?show_...3%26month%3D10

You can see the & and = characters have been substituted for the URL-safe
equivalents. I'm sure it's PHP doing this, as I have a 99% identical page in
ASP which works fine. Is there an option I can switch to stop it
translating?


Sounds more like it's the browser (correctly) doing it. You're breaking the
HTML 4.0 standard in your code having a bare & for starters, but anyway the
main issue is that the browser is reacting correctly: in order to get that
value passed for that option, it must be URL encoded.

You can't cause a single option to set multiple values by abusing the value
attribute to try and form a URL like that and expect it to work. If it does,
it's a bug (almost certainly in the browser - I don't see where PHP or ASP
comes into it since it's simply going from the output HTML to the next page;
the server's not involved until it receives the GET request).

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
by: Neil Ginsberg | last post by:
We're using SQL Server 7 with an Access 2000 MDB as a front end with ODBC linked tables. I recently created a new set of tables for the app, and users are complaining that unsaved data is being...
4
by: William | last post by:
After much frustration I was able to update my data store via code only. Using the data adapter was the only way I was able to set up all the objects written in my code. Basically, I cheated by...
5
by: rogsonl | last post by:
My computer was moved last week, and the company changed the network groups we work on. As a result, one of the main benefits from Whidbey (database connectivity) no longer works. Situation: 1....
9
by: tomblower | last post by:
Access 2000 fully updated Three PCs manage data held on a server. They each have a front-end mdb file linked to tables on the server and on each PC. A problem has arisen over the following line...
0
by: mjsterz | last post by:
I've been working with VB .NET for less than a year and this is the first time I've posted on one of these groups, so let me apologize beforehand if I'm being unclear, not posting my issue...
9
by: David Harris | last post by:
Ok, so I'm semi-new to .NET, having done everything manually with SQL code back in VB6. So before I program this up completely manually again, I thought I'd ask for better ways to think through...
11
by: Chad | last post by:
Hi Is it possible to substitute an alternative data source (eg MySQL or SQL Server) into an existing MS-Access application?
3
by: Joe Salmeri | last post by:
I have found a data corruption problem with pyodbc. OS = Windows XP SP2 DB = Microsoft Access XP PROBLEM: When selecting columns from a table that are of type Memo the value returned is...
0
by: george585 | last post by:
Hello! I am new to network programming, and understand just basics. Using some sample code, and having read documentation, I managed to create a simple app in C# and VB.NET. The application is...
16
by: pereges | last post by:
ok so i have written a program in C where I am dealing with huge data(millions and lots of iterations involved) and for some reason the screen tends to freeze and I get no output every time I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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:
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
Oralloy
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,...
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
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...

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.