inherit
73659
0
Aug 7, 2024 0:53:49 GMT -8
Nocando
www.clearnonsense.com
1,707
March 2006
undercoverandrey
|
Post by Nocando on Sept 23, 2009 12:47:21 GMT -8
Here is what I'm trying to accomplish I made a layout and coded it. What I would normally do before, was use a php script which would include the website's pages within the layout. For some reason the script no longer works, maybe its out of date? <?php if(strstr($id, "..") || $id[0]=="/") $id = ""; if(empty($id)) $id = "/home/critical/public_html/tte/home.html"; else { $id = $id . ".html"; } if(is_file("$id")){ include("$id"); } else include ("404error.html"); ?>
i set up my links like this <a href="index.php?id=linktous">Link to Us</a> the problem is, the home page loads just fine, but the links themselves arent working criticalmassguild.net/tte/click the place an order link on the left and see what happens can anyone help
|
|
inherit
66746
0
Oct 7, 2012 14:05:38 GMT -8
«The Silver Lining»™
^ Me !!!!
1,338
December 2005
chrisrulez001
|
Post by «The Silver Lining»™ on Sept 23, 2009 14:54:02 GMT -8
Hi there.
Where is $id variable to get the id from the link assigned? i dont see it in the script.
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Sept 23, 2009 15:26:51 GMT -8
<?php $id = "home"; if (isset($_GET["id"])) $id = str_replace('.', "", str_replace('/', "", $_GET["id"])); // prevent directory navigation if (!file_exists($id . ".html")) $id = "404error"; // the page must exist include($id . ".html"); ?>
By default, ID is home. If a custom ID is set, we strip / and . from it. Then, if the custom ID doesn't exist, we set the ID to the 404 error page. Then, we include the page.
Also, be sure to use $_GET["id"] instead of just $id, as all servers do not automatically convert $_GET["etc"] variables to just $etc.
|
|
inherit
73659
0
Aug 7, 2024 0:53:49 GMT -8
Nocando
www.clearnonsense.com
1,707
March 2006
undercoverandrey
|
Post by Nocando on Sept 23, 2009 16:16:18 GMT -8
<?php $id = "home"; if (isset($_GET["id"])) $id = str_replace('.', "", str_replace('/', "", $_GET["id"])); // prevent directory navigation if (!file_exists($id . ".html")) $id = "404error"; // the page must exist include($id . ".html"); ?> By default, ID is home. If a custom ID is set, we strip / and . from it. Then, if the custom ID doesn't exist, we set the ID to the 404 error page. Then, we include the page. Also, be sure to use $_GET["id"] instead of just $id, as all servers do not automatically convert $_GET["etc"] variables to just $etc. thanks a lot, the code works, much appreciated
|
|