Jump to content

problem updating database from other pc


AdRock

Recommended Posts

I have a small script within my page that checks to make sure some other website is adding content to my database but it is causing problems.

I can update stuff and insert records no problem but when i try and do it on a different computer I get an error saying "You do not have permission to use this script from another URL" whcih is in the script.  It only works on my computer.

Is there anything I can do to allow another computer to update the database.  It's for an admin area and I don't want the hassle of updating the database all the time.

[code]// Stop the form being used from an external URL
    // Get the referring URL
    $referer = $_SERVER['HTTP_REFERER'];
    // Get the URL of this page
    $this_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"];
    // If the referring URL and the URL of this page don't match then
    // display a message and don't send the email.
    if ($referer != $this_url) {
        echo "You do not have permission to use this script from another URL.";
        exit;
    }[/code]
Link to comment
Share on other sites

I got the person with the problem computer to run a test and he got this message

"You do not have permission to use this script from another URL"
Referer was blank
this url "http://www.jackgodfrey.org.uk/admin/index.php?page=editnews&id=4" which is correct

He got someone else to send a message using the feedback form which uses exaclty the same code and i recieved a message so it's definitely his computer.

I added the code you mentioned and tested it myself to see what the output was and i got this

referer: http://www.jackgodfrey.org.uk/admin/index.php?page=editnews&id=6
this_url: http://www.jackgodfrey.org.uk/admin/index.php?page=editnews&id=6

whereas he didn't have the referer

Could it be to do with his browser settings?
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.