Hi Leon,
I tried you snippet below, and got the expected url -- namely, the one
specified by the "action" attribute. I also got the name-value pairs
for the submit button and hidden field.
Since my test server is on port 8501, I edited your "action" url to
include that port number, as follows:
action="http://localhost:8501/cgi-bin/test/cgi-bin/test?rm-login"
Here's the packet that was sent by Safari to the server on port 8501,
as follows:
---
POST /cgi-bin/test/cgi-bin/test?rm-login HTTP/1.1
Host: localhost:8501
Connection: close
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us)
AppleWebKit/125.2
(KHTML, like Gecko) Safari/125.8
Accept: */*
Accept-Encoding: gzip, deflate;q=1.0, identity;q=0.5, *;q=0
Accept-Language: en-us, ja;q=0.62, de-de;q=0.93, de;q=0.90,
fr-fr;q=0.86,
fr;q=0.83, nl-nl;q=0.79, nl;q=0.76, it-it;q=0.72, it;q=0.69,
ja-jp;q=0.66,
en;q=0.97, es-es;q=0.59, es;q=0.55, da-dk;q=0.52, da;q=0.48,
fi-fi;q=0.45,
fi;q=0.41, ko-kr;q=0.38
Content-Type: application/x-www-form-urlencoded
Content-Length: 34
update=update+particular&rm=update
---
Note that no additional information was appended to the post url (see
first line of packet above); also note that the form field name-value
pairs appear correctly (see last line of packet above.)
To view packets sent between Safari and the server, I used
INTERARCHY. See the following link for details:
<http://www.interarchy.com/main/>
Hope this info helps.
Regards,
- Jeremy
On Jun 23, 2004, at 11:18 AM, Leon Chen wrote:
I am testing with the following HTML with a simple test CGI on my OS
X machine:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"
xml:lang="en-US">
<head><title>Welcome</title></head>
<body>
<h3>Welcome </h3>
<form method="post"
action="http://localhost/cgi-bin/test/cgi-bin/test?rm-login"
enctype="application/x-www-form-urlencoded" name="Form">
<h4><input type="submit" name="update" value="update particular"
/></h4>
<input type="hidden" name="rm" value="update" /><div></div>
</form>
</body>
</html>
I found Safari behaves differently from IE and Netscape:
- I run it in Safari. I click the "update particular" button I got
the URL like this:
http://localhost/cgi-bin/test?rm=login?rm=update which obviously
created error
- When I run the same HTML on IE and Netscape I got the URL like this:
http://localhost/cgi-bin/test?rm=update