Forum Moderators: coopster & phranque

Message Too Old, No Replies

If this and that, do this....

How do you add a second if requirement...

         

Jesse_Smith

4:01 am on Apr 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




$database = "/home/virtual/site8/fst/var/www/html/file.txt";
if ($database ne '') {
open (DATABASE,">>$database");
print DATABASE "<A HREF=\"URL\">title</a>\n";
close(DATABASE);
}

With this code, how would you change it to have two requirements? Having the database file, and also having a certian IP address?

eastwright

5:16 am on Apr 22, 2004 (gmt 0)

10+ Year Member




$database = "/home/virtual/site8/fst/var/www/html/file.txt";
$ip = '127.0.0.1';
if ($database ne '' && $ENV{REMOTE_ADDR} eq $ip) {
open (DATABASE,">>$database");
print DATABASE "<A HREF=\"URL\">title</a>\n";
close(DATABASE);
}

timster

1:01 pm on Apr 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




Sorry, couldn't resist...

if ( this and that ) {
open (DATABASE,">>$database");
print DATABASE "<A HREF=\"URL\">title</a>\n";
close(DATABASE);
}

sub this {
$database ne ''
}

sub that {
$ENV{REMOTE_ADDR} eq $ip;
}