Jump to content

Reason why this works the way it does?


Imprettynew1

Recommended Posts

Like most that start threads like this. I will have to say I'm pretty new.

 

<head>

<?php include('http://www.example.ca/includes.php'); ?>

</head>

 

The above snippet of code fails to load a site the way I want. However the snippet of code below does work.

 

<head>

<?php include('./includes.php'); ?>

</head>

 

I just need to understand why -

 

Is the first example and path, not the same as the second example?

 

Please and thank you.

Link to comment
https://forums.phpfreaks.com/topic/274228-reason-why-this-works-the-way-it-does/
Share on other sites

Is the first example and path, not the same as the second example?

 

No, the first example makes a request to the url provided. This returns the output of the php script requested after it has already been processed.

 

The second, actually includes the php script into your current script ready to be processed.

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.