944,045 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1178
  • PHP RSS
Oct 7th, 2006
0

PHP includes & variables

Expand Post »
I don't have much time to say this but I'm going to try and hurry...

Here's a snippet of code:

Quote ...
$subName = "someName";

include "contentHeader.php";
Inside of contentHeader:

Quote ...
echo $subName;
--------------------------

I know that this variable is correct because I had tried to use it on the original page that has the include file and it works. However when I try to echo it using the include page, it does not work. I can't explain in great detail right now but all I know is I need to get that variable from the original page and allow it to echo in contentHeader. What could I be doing wrong?

Thanks!! Sorry for the rush, hope you can answer
--Mike
Similar Threads
Reputation Points: 11
Solved Threads: 0
Newbie Poster
Mikeish is offline Offline
20 posts
since Sep 2006
Oct 7th, 2006
0

Re: PHP includes & variables

That looks like that should work. Is an error message being displayed? Maybe set error reporting to report all errors. If there is a minor issue that may report it to you.
Moderator
Reputation Points: 161
Solved Threads: 38
He's No Good To Me Dead
stymiee is offline Offline
1,422 posts
since May 2006
Oct 7th, 2006
0

Re: PHP includes & variables

Found out that I typed in the wrong address to you and I was using a full-length

My bad, I'm sorry.. thanks tho!
--Mike
Reputation Points: 11
Solved Threads: 0
Newbie Poster
Mikeish is offline Offline
20 posts
since Sep 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Making thumbnails in PHP
Next Thread in PHP Forum Timeline: Filtering My sql through Php using drop down menu and text field





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC