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

Button-hyperlink and PHP variables.

Hello,

anybody know why the following button

<form action="newpage.php?id=3">
<input type="submit" value="Cancel">
</form>
loads "newpage.php?" (not "newpage.php?id=3")?

Jul 17 '05 #1
6 2145
On 8 Jul 2005 12:41:12 -0700, op*********@yahoo.com wrote:
Hello,

anybody know why the following button

<form action="newpage.php?id=3">
<input type="submit" value="Cancel">
</form>

loads "newpage.php?" (not "newpage.php?id=3")?


Some browsers do not support url parameters in form actions -- I think
it's officially not supposed to.

You're supposed to do this instead:

<form action="newpage.php">
<input type="hidden" name="id" value="3">
<input type="submit" value="Cancel">
</form>
Jul 17 '05 #2
I noticed that Message-ID: <i0********************************@4ax.com>
from Wayne contained the following:
<form action="newpage.php">
<input type="hidden" name="id" value="3">
<input type="submit" value="Cancel">
</form>


shouldn't that be

<form action="newpage.php" method="get">
<input type="hidden" name="id" value="3">
<input type="submit" value="Cancel">
</form>

--
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 #3
Geoff Berrow wrote:
I noticed that Message-ID: <i0********************************@4ax.com>
from Wayne contained the following:
<form action="newpage.php">
<input type="hidden" name="id" value="3">
<input type="submit" value="Cancel">
</form>


shouldn't that be

<form action="newpage.php" method="get">
<input type="hidden" name="id" value="3">
<input type="submit" value="Cancel">
</form>


Arguably! though 'method' defaults to GET anyway. I don't see
why you wouldn't put it in.

--
Jock
Jul 17 '05 #4
Wayne wrote:
Some browsers do not support url parameters in form actions
Ok, have you run any tests?
-- I think it's officially not supposed to.


Well, the HTML spec merely restricts 'action' to a URI.
There's nothing wrong with having a query part in a URI,
though following the procedures set out in the spec you could
get some surprising results here!

--
Jock
Jul 17 '05 #5
op*********@yahoo.com wrote:
Hello,

anybody know why the following button

<form action="newpage.php?id=3">
<input type="submit" value="Cancel">
</form>
loads "newpage.php?" (not "newpage.php?id=3")?


are you checking the value of $_GET["id"]?

--
Tony Garcia
Web Right! Development
Riverside, CA
www.WebRightDevelopment.com
Jul 17 '05 #6
op*********@yahoo.com wrote:
Hello,

anybody know why the following button

<form action="newpage.php?id=3">
<input type="submit" value="Cancel">
</form>
loads "newpage.php?" (not "newpage.php?id=3")?


Maybe?

<form action="newpage.php&amp;id=3">

(Note: not tried).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 17 '05 #7

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

Similar topics

3
by: Matt | last post by:
I want to understand the difference between submit button and regular button: <input type="submit"> and <input type="button">. My understanding is that submit button will send the entire HTML form...
6
by: Skip Hollowell | last post by:
I am working on a menu bar for a site, and am using buttons in the bar (because the customer wants to use accessKeys for each selection, apparently it is too much work to click on them with a...
5
by: TrvlOrm | last post by:
Can any one please help me...I am new to JavaScript and I have been struggling with this code for days now and can't figure it out. I would like to get the Buttons to correspond with the action...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
25
by: KK | last post by:
Hi, I am using history.go(-1) for implementing the back button functionality. Its working fine but with this exception. 1. The page which is having back button has some hyperlinks on it. ...
3
by: Zürcher See | last post by:
Someone has implemented a Datagrid Button for the Windows.Form?
18
by: jrhoads23 | last post by:
Hello, I am trying to find a way to tell if an .NET windows forms Button (System.Windows.Forms.Button) is "depressed" (pushed down). For my application, I can not use a check box control set to...
18
by: Colin McGuire | last post by:
Hi - this was posted last weekend and unfortunately not resolved. The solutions that were posted almost worked but after another 5 days of working on the code everynight, I am not further ahead....
7
by: =?Utf-8?B?bWFydGluMQ==?= | last post by:
Hi, All, I create button in the code ( Dim Button as new Button), not using button web component (means not drap button and drop it ont he webform), after that I try to use button_click event,...
23
by: shashi shekhar singh | last post by:
Dear sir, I have a word document file contains text and images, now i have saved it as a web page and wants to display it on browser , using , string str=directory.getfiles("");...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
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...

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.