Jump to content


Photo

Recognise If A Directory Exists?


  • Please log in to reply
2 replies to this topic

#1 JustinMs66@hotmail.com

JustinMs66@hotmail.com
  • Members
  • PipPipPip
  • Advanced Member
  • 138 posts

Posted 17 September 2006 - 06:53 PM

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.

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 17 September 2006 - 06:56 PM

1.is_dir($what_ever);http://www.phpfreaks...ion.is-dir.html

2.header("location: where_ever.php");
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 JustinMs66@hotmail.com

JustinMs66@hotmail.com
  • Members
  • PipPipPip
  • Advanced Member
  • 138 posts

Posted 17 September 2006 - 07:40 PM

ok so i did this:
<?php
if (is_dir('userfiles')){
echo "userfile DOES exist";
else
echo "userfiles does NOT exist";
?>
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!





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users