Azu Posted December 1, 2006 Share Posted December 1, 2006 I know this is probably a stupid question with a really obvious answer but I've been searching a long time and haven't been able to find the answer to it :(How do I set to my little [url=http://www.google.com]links[/url] (sometimes a few hundred of them on a page) to use post instead of get, so things like google web accelerator, and spiders that ignore robots.txt (very common nowadays) won't click on them? And so people get the browser warning if they accidentally use them twice? And so they will be submitted straight to my website instead of showing up in the address bar?And on a side-note.. is there ANY reason to EVER use get for forms? Link to comment https://forums.phpfreaks.com/topic/29065-solved-posting/ Share on other sites More sharing options...
projectshifter Posted December 1, 2006 Share Posted December 1, 2006 Are these internal or external links?One way to do it is to set it up so it is <form method="post" action="$url"><a href="javascript:form.submit()">Text</a></form>, but you're probably going to end up using javascript one way or another. If they're external links though you might as well just setup an internal script to handle the forwarding of the URLs. Link to comment https://forums.phpfreaks.com/topic/29065-solved-posting/#findComment-133178 Share on other sites More sharing options...
Azu Posted December 1, 2006 Author Share Posted December 1, 2006 Thanks for the quick reply.All of them will be internal. They just need to pass some data to the page it's running from, or to ./index.phpIs there a way to do it without javascript? I've been trying very hard to get my site working without javascript/flash/activex etc being needed.. :) Link to comment https://forums.phpfreaks.com/topic/29065-solved-posting/#findComment-133181 Share on other sites More sharing options...
projectshifter Posted December 1, 2006 Share Posted December 1, 2006 [quote author=Azu link=topic=116938.msg476743#msg476743 date=1164947810]Thanks for the quick reply.All of them will be internal. They just need to pass some data to the page it's running from, or to ./index.phpIs there a way to do it without javascript? I've been trying very hard to get my site working without javascript/flash/activex etc being needed.. :)[/quote]Good man, it's bad to use javascript/flash/etc most of the time ;)What kind of data are you trying to pass?? You could use mod_rewrite to encode the URLs and pass certain bits of data, or you could use sessions/cookies to store it temp if you need to. Link to comment https://forums.phpfreaks.com/topic/29065-solved-posting/#findComment-133194 Share on other sites More sharing options...
Azu Posted December 2, 2006 Author Share Posted December 2, 2006 Thanks ;DAnd I didn't have anything specific in mind. I just want to replace a bunch of my GET links with POST links so stuff like google web accelerator is less likely to click on them all, and so when people press f5 over and over it won't reload the page over and over.. Link to comment https://forums.phpfreaks.com/topic/29065-solved-posting/#findComment-133982 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.