Jump to content

Outside Postings


The Little Guy

Recommended Posts

Store a variable in session that you only set on pages from your site and check that.

 

Other than that it is hard to do as someone can easily spoof what page they are coming from and can access it/submit it like it is coming from your domain.

Link to comment
Share on other sites

Referer can be faked.

 

The best way to do this is to use a javascript submit function.  inside the javascript set a hidden value, or a cookie, then check that value/cookie in your post routine.

 

This will help reduce spam from robots.

 

Mark

 

or

 

you could create a session in your form page and require the PHP script, your using to process your form results, too require this session for your form processing PHP script.

Link to comment
Share on other sites

Ok you can take this approach  generated a md5 hash for every form posted

 

so say your hash is as an example "9e107d9d372bb6826bd81d3542a419d6"

 

so lets say you got two pages one page is a form lets call it form1.php and another page is form1_submit.php (enters data into a database)

 

 

so on form1.php

1) set a session variable storing the hash

2) send the hash via a hidden field in the form

 

on form1_submit.php

1) check if both match the value in the session and the post hidden field

 

hope this is helpful

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.