Page 1 of 1

I need a definition for what this code is.

Posted: Fri Nov 26, 2010 8:57 am
by cap2cap10
Greetings php technorati. I found this strip of code on my server and I would like to verify what it does. Here is the code:

Code: Select all

<?php
if ($_GET['randomId'] != "0P3DdC7m24jjoFdQMsMYTe_JQxF7K4Qzr5vrG2pnBjBstoKisLaXAhu07DtZBgfz") {
    echo "Access Denied";
    exit();
}

// display the HTML code:
echo stripslashes($_POST['wproPreviewHTML']);

?>  
Does this block the GET method? :? I am currently having trouble with my page and I cant find a problem in my code.
Please advise.

Thanks in advance,
Batoe

Re: I need a definition for what this code is.

Posted: Fri Nov 26, 2010 9:46 am
by pickle
It means that unless the page was called with a $_GET variable named "id", and the value for that variable is"0P3DdC7m24jjoFdQMsMYTe_JQxF7K4Qzr5vrG2pnBjBstoKisLaXAhu07DtZBgfz", you get that error. Try calling the page like this:

whateverthepagenameis.php?id=0P3DdC7m24jjoFdQMsMYTe_JQxF7K4Qzr5vrG2pnBjBstoKisLaXAhu07DtZBgfz.

As a side note: If this is the type of security your pages/app has - you should move quickly to fix that. This is very insecure.