jaxdevil Posted October 24, 2008 Share Posted October 24, 2008 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 Link to comment https://forums.phpfreaks.com/topic/129882-if-statement-with-a-not-like-command-of-some-kind/ Share on other sites More sharing options...
Alt_F4 Posted October 24, 2008 Share Posted October 24, 2008 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 Link to comment https://forums.phpfreaks.com/topic/129882-if-statement-with-a-not-like-command-of-some-kind/#findComment-673342 Share on other sites More sharing options...
n3ightjay Posted October 24, 2008 Share Posted October 24, 2008 <? $self = $_SERVER['SCRIPT_FILENAME']; if ($self != '/home/whole/public_html/login.php' && $_GET['action'] != 'process') { ?> This should also work Link to comment https://forums.phpfreaks.com/topic/129882-if-statement-with-a-not-like-command-of-some-kind/#findComment-673349 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.