|
-
Nov 1st, 2002, 03:47 AM
#1
Thread Starter
Addicted Member
url to post things rather than get things (pls help)
Ello all Im sure you all know about how you can use a URL to get a webpage from a cgi script (sorry Im not sure how to word that well). Anyone from my meagre understanding that url automaticly makes it use the method GET, I was wandering if there is a way to make it use POST. Or am I totaly muddled?
-
Nov 1st, 2002, 02:56 PM
#2
Thread Starter
Addicted Member
I found this javascript so I can make a website to do what I want rather than a specialy crafted URL....
PHP Code:
<HTML>
<BODY onload="dosubmit()" bgcolor="#0ffff0">
<SCRIPT LANGUAGE=JAVASCRIPT>
function dosubmit() {
document.forms[0].action = "http://somesite.com/somescript.php"
document.forms[0].method = "POST"
document.forms[0].submit()
}
</SCRIPT>
<FORM NAME=FORM1>
<INPUT TYPE=hidden NAME=athing VALUE="anything">
<INPUT TYPE=hidden NAME=name VALUE="1">
<INPUT TYPE=hidden NAME=woooo VALUE="1">
<INPUT TYPE=hidden NAME=submit VALUE="anyvalue here">
<INPUT TYPE=BUTTON NAME=BT1 VALUE="lalalala" onClick="dosubmit()">
</FORM>
</BODY>
</HTML>
could someone please tell me whats wrong with this so I can get it working :P
-
Nov 2nd, 2002, 08:51 AM
#3
Stuck in the 80s
I'm totally confused about what you're asking. But...
Code:
<html>
<body onLoad="dosubmit();" bgcolor="#0ffff0">
<script language="JavaScript">
function dosubmit() {
document.forms[0].submit()
}
</script>
<form name="form1" method="post" action="http://somesite.com/somescript.php">
<input type="hidden" name="athing" value="anything">
<input type="hidden" name="name" value="1">
<input type="hidden" name="woooo" value="1">
<input type="hidden" name="submit" value="anyvalue here">
<input type="button" name="BT1" value="lalalala" onClick="dosubmit();">
</form>
</body>
</html>
Tags should be lowercased, property values should be quoted, etc.
And why are you having a page that submits the form right when it loads? That's beyond me...
-
Nov 2nd, 2002, 09:38 AM
#4
Every access to that page would 'spam' the page... interesting.
-
Nov 2nd, 2002, 06:00 PM
#5
Stuck in the 80s
Originally posted by mendhak
Every access to that page would 'spam' the page... interesting.
I was thinking the same thing.
Why even have a button on the page? It's just going to submit every time it loads.
And why is this in General PC?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|