Jump to content

$_POST


ShaolinF

Recommended Posts

You could check the $_SERVER['HTTP_REFERER'], but this isn't 100% reliable.

 

You could set a session variable on form.php, and check for it on process.php. If it's not there, then they didn't go to form.php first. That solution only works once though.

 

Or, you could set a hidden variable to pass through, and check for that.

<input type="hidden" name="valid_user" value="true" />

 

Or, you could check that all the fields have been set (or at the least the ones that have to), and if they're not... send them back to form.php.

<?php
if(!isset($_POST['name']))
    header("Location: URL/form.php"); // They didn't enter their name or they came to process.php directly!

Link to comment
https://forums.phpfreaks.com/topic/73384-_post/#findComment-370259
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.