Hi. I am looking for the way to insert a Jquery script just in the index: I have tried this two possibilities so far: <?php $homepage = "/"; $currentpage = $_SERVER['REQUEST_URI']; if($homepage==$currentpage) { echo '<script type="text/javascript" src="/templates/zone_2/javascript/jquery-file.js"></script>'; } ?> and <?php $homepage = "/index.php"; $currentpage = $_SERVER['REQUEST_URI']; if($homepage==$currentpage) { echo '<script type="text/javascript" src="/templates/zone_2/javascript/jquery-file.js"></script>'; } ?> The fact is that the index ends up in .com. Neither .com/ nor .com/index.php So these codes do not work. The idea is that the script is meant to be just in the index page, but not in any of the internal sections. Any idea? Thanks.
Sorry Syndication, but it does not work. I was very specific: there is no index.php in my site. The index page is like this: www.thewebpage.com Nothing more.
are you using a framework like code igniter or something? i think your way could work, however set up an index.html file and redirect it to index.php here is a site that uses this style of redirect. and it forces the site to become yourdomain/index.php and then your script might work,
This is the source code for the page i mentioned before: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>yoursite.com</title> <meta http-equiv="REFRESH" content="0;url=http://www.yoursite.com/index.php"></HEAD> <BODY> </BODY> </HTML> The code only works as most servers look for index.html before index.php, if your server has it in a different order (unlikely) then this wont work for you. I have no experience with joomla, and i cant guarantee that it will work for you. Please let me know if or how you get it to work.