I want to display some stand alone web pages from my server in a single web page when requested by the user. The pages are listed by topic.
I thought it would be simple to use the include_once function and then use ($url) for the path to the file, but it seems that this will not work. I can echo $url and it shows the correct path, but has no effect when trying to load the page. I am sure that I have missed something here, any help would be appreciated.

Member Avatar for rajarajan2017

Post your code?

$url = $_GET;

include ($url);

Member Avatar for rajarajan2017

Try to use

include $url

HI Raja,
thanks for your help with this. Unfortunately your suggestion did not work. I have tried the following:

$url = $_GET;
echo $url;
$urle = ('../2010/01/January_10.html');
require $urle;
The echo displays the correct path to the page I want to include.
When I use the $urle and require it the correct page is displayed. But, when I use require $url, even though it echos correctly, nothing happens.
Any further help would be great!

Member Avatar for rajarajan2017
$url= (isset($_GET['name']) && !empty($_GET['name'])) ? $_GET['name'] : NULL;
include_once($url.'php');

whats the value of $_GET? ist the name of a person?, like "John"?, why are including names?, include and require function are used for including files, of course the $urle works coz its a path to the filename which is the january_10.html. what are you tring to do?

Hi guys,
thanks for your input, I have now solved the problem, it was three dots instead of two in my path...grrr!
It just needed another pair of eyes that hadn't been looking at the same code for as long as I have.

Member Avatar for rajarajan2017

Thats great! Please mark the thread as solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.