Page 1 of 1

simple isset script using $_REQUEST will not fire

Posted: Tue Sep 22, 2009 12:21 pm
by Spoooon
I'm trying to get an include to fire if a variable is null
It just wont fire or do anything at the moment. Am I doing something wrong?

Code: Select all

 
<?php
 
if(!isset($_REQUEST['db_password']))
    { 
    include 'localhost/includes/database/login.inc.form.html.php';
    }   
 
?>
 

Re: simple isset script using $_REQUEST will not fire

Posted: Tue Sep 22, 2009 12:33 pm
by jackpf
Have you got error reporting turned on?

Try putting "echo 'blah';" in the if() statement. See if it shows up or not.

Re: simple isset script using $_REQUEST will not fire

Posted: Tue Sep 22, 2009 12:39 pm
by Spoooon
I tried that but nothing showed up.

However, then I changed the include script to

Code: Select all

 
include 'login.inc.form.html.php';
 
and it worked just fine.

why should the referral location matter? Shouldn't have I gotten at least a php error message?
Thanks for the help.

Re: simple isset script using $_REQUEST will not fire

Posted: Tue Sep 22, 2009 12:42 pm
by jackpf
Oh yeah, so stupid of me, didn't even look at your include file location lol.

You need to either specify a relative or absolute path. You're sort of in between...

If you're trying to include over HTTP, you need "http://" in front of "localhost". You also need url_include turned on. If not, you need to either use a relative path, so...if it's in the same directory, just the name of the script. Otherwise, you can do this:

Code: Select all

include $_SERVER['DOCUMENT_ROOT'].'/path/to/file/file.php';
I'm right in the middle of playing L4D, so sorry if this doesn't make sense, but I hope it's a bit clearer :P