Jump to content

question


justinh

Recommended Posts

nope - someone could put page=http://theirsite.com/nasty

 

which would then allow that script access to your server.

 

you are better defining the full path to a script in any include/require staement like so

<?php
$dir = $_SEVER['DOCUMENT_ROOT'] . 'path/to/your/dir/';
isset($_GET['page']) ? $page = $_GET['page'] : $page = "main"; 
include($dir . $page.".php");
?>

 

but MANY better ways of implementing this functionality...

Link to comment
https://forums.phpfreaks.com/topic/171233-question/#findComment-902970
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.