SEO Class in Chicago, IL
Learn How To Optimize Your Website on July 26, 2013
High Rankings is offering a 1-day customized SEO training class in Chicago. Class size is limited so please sign-up now if you want in!
Are you a Google Analytics enthusiast?
Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE!

www.CustomReportSharing.com
From the folks who brought you High Rankings!
More SEO Content
Php Coding
#1
Posted 23 January 2005 - 12:30 PM
<? include '<? echo $data ?>.php' ?>
#2
Posted 23 January 2005 - 01:43 PM
$data = $data . ".php";
include($data);
?>
Or if you don't want to reset $data to add the .php part you should also be able to do something like:
include($data . ".php")
?>
HTH
#3
Posted 23 January 2005 - 05:08 PM
Also, echo writes to the browser window. So what you are coding says to print out whatever $data holds, as part of an include. No idea what errors this will throw, or how PHP will handle it, but it will throw a bunch!!!
#4
Posted 24 January 2005 - 04:37 AM
#5
Posted 24 January 2005 - 11:13 AM
Are you including files with names based on user submitted input?
This is a HUGE security risk.
A MUCH better idea is to do something like this:
$myincludes[1] = "blah1.php";
$myincludes[2] = "blah2.php";
$myincludes[3] = "blahblah.php";
$myincludes[4] = "abcde.php";
$choice = intval($data);
if($choice <0 || $choice > 4){
echo("Error...");
}else{
include($myincludes[$choice]);
}
#6
Posted 24 January 2005 - 12:25 PM
Are you including files with names based on user submitted input?
This is a HUGE security risk.
A MUCH better idea is to do something like this:
$myincludes[1] = "blah1.php";
$myincludes[2] = "blah2.php";
$myincludes[3] = "blahblah.php";
$myincludes[4] = "abcde.php";
$choice = intval($data);
if($choice <0 || $choice > 4){
echo("Error...");
}else{
include($myincludes[$choice]);
}
Hi sherri, No this was just for loading a file in a table cell. Thank you for the example though, I think I have a use for that.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users










