Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A little question... 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have been trying to make a site that uses includes to insert different articles depending on the links this way:

Link:


And articles.php has the following include:

<?php
include('article' . $article_id . '.html');
?>

So that would insert article1.html.

That gives me the following error:
Error 0: not found

Any ideas how I might get that to work using includes and variables in the url?
 
Yes it is.
I have tried even with the following url
<a href=&quot;article.php?articleid=article1.html&quot;>Click here</a>

Then in article.php :
<?

include($articleid)
?>

And that wont work either.
I am aware this could present a security issue but Im just trying to see what Im doing wrong.
 
also, try this:

<?php
include_once($DOCUMENT_ROOT.&quot;/relative/location/to/file/article&quot;.$article_id.&quot;.html&quot;);
?>

Although PHP assigns the current directory as the default include location, there is no guarantee that it is actually looking there.

Chad.
ICQ: 54380631
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top