Jump to content

When entering a form...


nimzie

Recommended Posts

You can check a form was submitted to the page via...

 

<?php

 if (isset($_POST['submit'])) {
   // process form.
 }

?>

 

Providing you have a submit button named form. You can also check the refering page using $_SERVER['HTTP_REFERER'], this can however be spooked. One method which may offer more security is to set a $_SESSION variable within the login form page, then check for its exeistence within the processing script.[/img]

Link to comment
https://forums.phpfreaks.com/topic/71362-when-entering-a-form/#findComment-359066
Share on other sites

Use sessions.

Sessions could be spoofed, but to expand on this answer

 

at the top of your script do

 

<?php

sesson_start();

$_SESSION['verify'] = 'asdfasdfasdfasfasdfasdfasdfl';

 

 

then on the processing page do

 

<?php

session_start();

if($_SESSION['verify'] !== 'asdfasdfasdfasfasdfasdfasdfl'){

header("Location: http://www.website.com");

exit;

}

Link to comment
https://forums.phpfreaks.com/topic/71362-when-entering-a-form/#findComment-359071
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.