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 Quote Link to comment 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 } ?> Quote Link to comment 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>'; } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.