NYCPHP Meetup

[nycphp-talk] <a href> vs. <form> request

George Webb gw.nyphp at gwprogramming.com
Wed Apr 16 18:58:21 EDT 2003


Hi Jerry.

	The only way I can see how to do this is something
like the following PHP code:

<?php
if ( $_SERVER['QUERY_STRING'] == '' )
	my_fail_handler();
elseif ( $_SERVER['REQUEST_METHOD'] == 'POST )
	my_fail_handler();

/* Else, continue normally... */
?>

	This will only work if HREFs to your PHP script
don't already have query string arguments.  I.e.,

	http://yourserver.com/yourscript.php

will work, but

	http://yourserver.com/yourscript.php?foo
	http://yourserver.com/yourscript.php?arg=test
	http://yourserver.com/yourscript.php?arg=test&arg2=test2

all will be rejected, so I hope that's okay....  Make sense?


Best, George.

George Webb
gw.nyphp at gwprogramming.com



More information about the talk mailing list