Jump to content

If statement with a NOT LIKE command of some kind.


jaxdevil

Recommended Posts

I am trying to add a footer to a page if the page doesn't equal a certain page, I have the code working for other pages but this one contains a ? in the path, so I am trying to bypass that by using something like 'NOT LIKE' but I don't think that will work. Here is what I am trying, it obviously won't work that way, but what would you suggest, I am open to any methods of working this out:

 

<?
$self = $_SERVER['SCRIPT_FILENAME'];
if ($self NOT LIKE '/home/whole/public_html/login.php%') {
?>
<center>
<table cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td background="http://<?=$_SERVER[HTTP_HOST]?>/images/l_border.gif" height="100%" width="27">
</td>
<td align="center">
<?
}
?>

 

The page I am wanting it to NOT show up on is: /home/whole/public_html/login.php?action=process but it won't work this way:

 

<?
$self = $_SERVER['SCRIPT_FILENAME'];
if ($self != '/home/whole/public_html/login.php%') {
?>
<center>
<table cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td background="http://<?=$_SERVER[HTTP_HOST]?>/images/l_border.gif" height="100%" width="27">
</td>
<td align="center">
<?
}
?>

 

So if you can find a way to do that, or even better if someone knows where to put additional html tags (this is on the template_application_top.php page, and closing of it is on the application_bottom.php, this is in CRELoaded and I am using these two add a left and right border to the page) in CRELoaded where they won't get rerun breaking the script. Otherwise just how to make that if statement work with a page that has a ? in the path.

 

Thanks!

 

SK

try this:

 

<?
$self = $_SERVER['SCRIPT_FILENAME'];

$pos = strpos($self , "/home/whole/public_html/login.php");
    if ($pos == false) {
?>
<center>
<table cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td background="http://<?=$_SERVER[HTTP_HOST]?>/images/l_border.gif" height="100%" width="27">
</td>
<td align="center">
<?
}
?>

 

that should work

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.