Page 1 of 1

[SOLVED] I need a good eye real quick please

Posted: Fri Jul 09, 2004 12:52 am
by fresh
I screwed this script all to heck and back, it wont parse out the contents, after the form has been submitted, it's got to be because of the bracket setup, please, someone look at this and fix it, I'm going nuts, and making people mad... here's my script:

Code: Select all

fixed thanks
I will owe you big time... thanks in advance... :oops: :cry:

Posted: Fri Jul 09, 2004 1:43 am
by d3ad1ysp0rk

Code: Select all

if(!$_POST['uname'] | !$_POST['passwd']) {
try

Code: Select all

if(!$_POST['uname'] || !$_POST['passwd']) {
or

Code: Select all

if(empty($_POST['uname']) || empty($_POST['passwd'])){

hmm

Posted: Fri Jul 09, 2004 2:12 am
by fresh
where? and why? You think my brackets arent the problem?

P.s. I know for a fact it's the brackets, because I had it working but it was throwing up, no directory or file exists, warning, but it still showed the part that I said is not being parsed... so when I added the if statement, file_exists > return; , thats when it all went to hell... could you look at the brackets, I dont see any mistakes there, but I know thats it... :?:

Posted: Fri Jul 09, 2004 2:29 am
by qads
wouldn't it be easier to put the code in 2 files and include it? or put it in a file, put a pointer where it should split, explode it, echo it....saves lot work work space, easier to move around the file to see where it would echo aswell.

yeah

Posted: Fri Jul 09, 2004 2:34 am
by fresh
i'll do that later, I got it working, finally!! Can I ask, how do you check to see if a directory exists??? thanks :D

Posted: Fri Jul 09, 2004 2:53 am
by patrikG
[php_man]is_dir[/php_man]

hey

Posted: Fri Jul 09, 2004 3:10 am
by fresh
thanks, hey would the syntax go:

if(is_dir("my_dir/")) {
echo "yes";
} else {
echo "no";
}

??? thanks

Posted: Fri Jul 09, 2004 3:55 am
by patrikG
yup. If it runs on your machine it runs on a remote machine (should, at least) ;) There are also some code-examples and alternatives in the user-notes of the php-manual.

Posted: Fri Jul 09, 2004 3:57 am
by JayBird
Fresh, you should have left the code in your original post so if anyone else runs into the same problem, hopefully they could solve it from this post.

Thanks

Mark

sorry

Posted: Fri Jul 09, 2004 4:27 am
by fresh
it was really buggy, almost worthless... all I did was rearranged my brackets, and it worked then, but, still is and was, really buggy... sorry, normally I would ;)