Dave3765 Posted October 22, 2007 Share Posted October 22, 2007 I'm trying to insert some html if the browser location is my top level domain (www.mydomain.com) only, and I have the following code which appears not to work :-( Can anyone cast an eye over it? <? $spacecheck = $_SERVER["PHP_SELF"] if $spacecheck = "/" { echo ('<td height="27"></td>') } else {} ?> Thanks Link to comment https://forums.phpfreaks.com/topic/74330-solved-domain-checking-problem-_serverphp_self/ Share on other sites More sharing options...
phpQuestioner Posted October 22, 2007 Share Posted October 22, 2007 try this: <?php $spacecheck = $_SERVER["PHP_SELF"]; if ($spacecheck == "/index.php") { echo "<td height=\"27\"></td>"; } else { // do something else } ?> Link to comment https://forums.phpfreaks.com/topic/74330-solved-domain-checking-problem-_serverphp_self/#findComment-375577 Share on other sites More sharing options...
trq Posted October 22, 2007 Share Posted October 22, 2007 You should be getting errors because your syntax is floored. <?php $spacecheck = $_SERVER["PHP_SELF"]; if ($spacecheck == "/") { echo '<td height="27"></td>'; } ?> Link to comment https://forums.phpfreaks.com/topic/74330-solved-domain-checking-problem-_serverphp_self/#findComment-375579 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.