Hey,
I have just done a website with php includes so far so good but 1 problem.
That link wont work. I know its the ?id=$b[id] but how could I go about fixing it?PHP Code:?page=comments?id=$b[id]
Thanks

Hey,
I have just done a website with php includes so far so good but 1 problem.
That link wont work. I know its the ?id=$b[id] but how could I go about fixing it?PHP Code:?page=comments?id=$b[id]
Thanks
change
toPHP Code:?page=comments?id=$b[id]
PHP Code:?page=comments&id=$b[id]
Looking for a good desiner to design a social networking template.
PM me.
Thanks +Rep
No problem im here to help.
Well sort of... ;l
Looking for a good desiner to design a social networking template.
PM me.
And you can just keep adding aswell
?view=hello&me=is¬=gay&so=lets&go=to&bed=please
Make sure the includes script has protection, this is a good example of a secure including script:
PHP Code:<?php
if( isset ( $_GET[ "page" ] ) && !empty( $_GET[ "page" ] )) {
$page = $_GET[ "page" ];
$page = str_replace( ".", "", $page);
$page = urlencode( $page );
$page = htmlentities( $page );
$page = "". $page .".php";
if( file_exists( $page ) ) {
include( "$page" );
}
else {
include( "404.php" );
}
}
?>
Last edited by Invent; 19-06-2007 at 07:00 PM.
Yer thanks ive already got thatMake sure the includes script has protection, this is a good example of a secure including script:
PHP Code:<?php
if( isset ( $_GET[ "page" ] ) && !empty( $_GET[ "page" ] )) {
$page = $_GET[ "page" ];
$page = str_replace( ".", "", $page);
$page = urlencode( $page );
$page = htmlentities( $page );
$page = "". $page .".php";
if( file_exists( $page ) ) {
include( "$page" );
}
else {
include( "404.php" );
}
}
?>![]()
:p I got bored, so I decided to make it lol.
A good alternative i find is just to keep the files in a dir and hardcode it to the script which prevents any misuseMake sure the includes script has protection, this is a good example of a secure including script:
PHP Code:<?php
if( isset ( $_GET[ "page" ] ) && !empty( $_GET[ "page" ] )) {
$page = $_GET[ "page" ];
$page = str_replace( ".", "", $page);
$page = urlencode( $page );
$page = htmlentities( $page );
$page = "". $page .".php";
if( file_exists( $page ) ) {
include( "$page" );
}
else {
include( "404.php" );
}
}
?>
put what u like in the url, pagesfolder/http://haxzorsite.hax/l33t.php.php aint gona be found.PHP Code:$page = $_GET[ "page" ];
$location = "pagesfolder/".$page.".php";
if( file_exists($location) ) {
include($location);
}else {
include( "defultpage.php" );
}
ps. -removed- i was wrong, im to use to js escapting
Last edited by Mentor; 19-06-2007 at 07:11 PM.
Yes, but I thought incase for some odd reason they may want to protect files from another folder being accessed.
Because with your script the user could do ?page=../../page.php
Not sure why you need to block it but yeah![]()
Want to hide these adverts? Register an account for free!