Re: [PHP] script to check if form is submitted from the same page?

2006-08-14 Thread Richard Lynch
On Sat, August 12, 2006 5:57 pm, Afan Pasalic wrote: You're talking about something like captcha, right? No. FORM PAGE: ?php $token = uniqid(); //the following line is a gross abuse of a lack of error-checking: mysql_query(insert into tokens (token, used) values('$token',

RE: [PHP] script to check if form is submitted from the same page?

2006-08-14 Thread Peter Lauri
And I assume that this should be reused to minimize the time spent on this by creating a form class or function, correct? I have been thinking about this too, and it makes a lot sense to do like this. /Peter -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent:

Re: [PHP] script to check if form is submitted from the same page?

2006-08-12 Thread BBC
could I use this code to check if form is submitted from the same page/same domain if ($_POST['form_submitted'] == 'Yes') { if (preg_match($_SERVER['HTTP_HOST'], $_SERVER[HTTP_REFERER]) == 0) { die ('^[EMAIL PROTECTED]'); } } I prefer to use 'session_start();'

Re: [PHP] script to check if form is submitted from the same page?

2006-08-12 Thread Richard Lynch
On Sat, August 12, 2006 1:55 pm, Afan Pasalic wrote: could I use this code to check if form is submitted from the same page/same domain if ($_POST['form_submitted'] == 'Yes') { if (preg_match($_SERVER['HTTP_HOST'], $_SERVER[HTTP_REFERER]) == 0) { die ('^[EMAIL