Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

force form to use get

Status
Not open for further replies.

y2k1981

Programmer
Aug 2, 2002
773
0
0
IE
hi all,

I don't really know much about PHP, but I was wondering if somebody could help me. I visit a page quiet alot which displays info for lots of different users, it displays a DDM where I can choose my name and it will then just filter the records for me. What I want to do is create a shortcut that will automatically filter the records for me instead. I've tried viewing the file in my browser and then adding?variable=myname but it didn't work. I know for a fact that the variable name etc are correct, but the form uses POST and not get, so does this mean that it won't work by me putting this info in the URL?

Hope this doesn't sound confusing, it'd be great if somebody could help me out

thanks in advance
 
can you modify the php page? if so you must change the <form> tag in order to have the method=get and not post, BUT, if you do so, you should modify all the calls to the form vars... I mean, now is post, so surely you access the vars with $_POST['var']... all of them must be changed to $_GET['var']. With these changes you can access the form with get and not post.

If you can not modify the page (and all dependant), forget it... this is a server side programming, not client side.

Cheers.
 
no, I can't modify the page. Basically, what I wondered was if I used GET to send data to the page, would it act the same way as if POST was used.

thanks for your reply
 
To be disambiguous, you don't send data to a form -- you send data to a script.

Whether a script will recognize GET-method data depends on whether it was written to do so or whether it can accidentally.

If the script was well-written, it will ignore GET-method data if it is supposed to use only POST-method data.

Take a look at my FAQ in this forum, titled, "Sending data to a CGI via POST" (faq434-2502)



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
thanks for that sleipnir, my guess is that this page is pretty well written as the guy who wrote it has done some pretty cool stuff - so I guess the answer to my question is that I can't use GET then !!

Thanks again for both your replies.
 
Acutally, if you're really dedicated to building a bookmark to this page with your filters already active, you could try creating a local html page on your machine that contains the appropriate form variables and posts to his page. Then to view the page, simply open that local page (you can have it auto-submit).

Reasons this may not work:
1) I'm sure there are security settings on web servers that may not allow this type of activity, but I've done this kind of thing before and it's always worked.
2) The page may check its referer. If it's not hissite.com/originalform.php, it may ignore your request.
3) If the site somehow logs you in, or establishes any kind of session data, this may ruin your chances.
4) A whole handful of things I haven't thought of. :)

At any rate, it's pretty easy to try.

Brad Gunsalus
bardley90@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top