i need the PHP code for recognising if a directory named "userfiles" exists.
i also need the PHP code for redirecting to another PHP file.
Recognise If A Directory Exists?
Moderator: General Moderators
- JustinMs66
- Forum Contributor
- Posts: 127
- Joined: Sun Sep 03, 2006 4:18 pm
- JustinMs66
- Forum Contributor
- Posts: 127
- Joined: Sun Sep 03, 2006 4:18 pm
ok so i did this:
and it outputs this:
Parse error: syntax error, unexpected T_ELSE in /index.php on line 4
but i can't see what i did wrong! please help!
Code: Select all
<?php
if (is_dir('userfiles')){
echo "userfile DOES exist";
else
echo "userfiles does NOT exist";
?>Parse error: syntax error, unexpected T_ELSE in /index.php on line 4
but i can't see what i did wrong! please help!
- JustinMs66
- Forum Contributor
- Posts: 127
- Joined: Sun Sep 03, 2006 4:18 pm
Code: Select all
<?php
if (is_dir('userfiles'))
{
echo "userfiles DOES exist";
} //You were missing this brace
else
{ //and this brace
echo "userfiles does NOT exist";
} //and this brace.
?>