This if isn't working as expected

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
toasty2
Forum Contributor
Posts: 361
Joined: Wed Aug 03, 2005 10:28 am
Location: Arkansas, USA

This if isn't working as expected

Post by toasty2 »

Code: Select all

if(!file_exists('content/'.$name.'.txt') and $name!='header' and $name!='footer' and $name!='navbar' and $name!='nav' and $name!='' and !strpos('..',$name)))
Edit: The only problem seems to be that the !strpos('..',$name) is not working.
Last edited by toasty2 on Mon May 28, 2007 12:56 pm, edited 1 time in total.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

http://de3.php.net/function.strpos wrote:strpos ( string $haystack, mixed $needle
try strpos($name, '..')
Post Reply