Jump to content
MakeWebGames

Whitelist array help


Recommended Posts

Posted

Can anyone give me an example of how i would do a whitelist array? Thanks :)

Posted

I know what an array is... Im just wondering how exactly i would go about doing it in mccodes such as for the url restrictments and stuff.

Posted

Seriously this is pissing me off. I offer my help to anyone who asks and when i have a question, noone could give a damn to answer it.

Posted

This is what you want isnt it

Action restrictions

<?php
$allowed = array('1', '2', '3', '4', '5');
if (!in_array($_GET['action'], $allowed)) {
echo 'This is not allowed!';
exit;
}
?>

for url restrictments

$allowed = array('http://www.google.co.uk', 'http://www.test.com', 'http://www.duno.com', 'http://www.nowimrelistuckwhattoput.com', 'http://www.cddesigns.org :D');
$url= explode('.', $_POST['URL'])
if (!in_array($url[1], $allowed)) {
echo 'This URL not allowed!';
exit;
}
?>

PLEASE NOT THESE ARE NOT TESTED!!! this is just something to base your code on ...

Posted

Thank you. Atleast not everyone ignores ppl when they need help

Posted

No problem mate i would of replyed earlier but i was at work on my phone so its a bit hard to code :P ... is that what the sorta thing you was looking for?

Posted

Yea pretty much, i was just wondering about how to check the url data as well as the whole page.

Posted

Dude your a tool I can tell that just by this one topic.

You posted and 2 hours later expect EVERYONE on the site to be online to help??? wtf honestly. I will never help you or anyone that acts like that.

You ask for help you WAIT for someone to help. Don't come back and bitch about it an 2 hours later.

Posted
This is what you want isnt it

Action restrictions

<?php
$allowed = array('1', '2', '3', '4', '5');
if (!in_array($_GET['action'], $allowed)) {
echo 'This is not allowed!';
exit;
}
?>

 

for url restrictments

$allowed = array('http://www.google.co.uk', 'http://www.test.com', 'http://www.duno.com', 'http://www.nowimrelistuckwhattoput.com', 'http://www.cddesigns.org :D');
$url= explode('.', $_POST['URL'])
if (!in_array($url[1], $allowed)) {
echo 'This URL not allowed!';
exit;
}
?>

 

PLEASE NOT THESE ARE NOT TESTED!!! this is just something to base your code on ...

Doesn't look like a while list array to me....

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.   Paste as plain text instead

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