I need a definition for what this code is.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
cap2cap10
Forum Contributor
Posts: 158
Joined: Mon Apr 14, 2008 11:06 pm

I need a definition for what this code is.

Post 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
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

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

Post 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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply