Jump to content
Larry Ullman's Book Forums

Recommended Posts

I simply want to use the predefined constant CONTENT in place of the "textFiles/" below.

 

define ('CONTENT','../textFiles_content/');

 

$handle = fopen('textFiles/'.$category.'.html', "r") or die("Couldn't open this file.");

 

I can't get the syntax to work.

 

Link to comment
Share on other sites

What's the problem with the syntax? You're not even trying to use the constant you defined.

When you define a constant in PHP, you don't need to place a dollar sign ($) before the constant.

In other words, to refer to the constant 'CONTENT' you are defining, simply type the following:

 

 

CONTENT
  • Upvote 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...