User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 427,459 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,578 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 818 | Replies: 2
Reply
Join Date: Sep 2006
Posts: 20
Reputation: Mikeish is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
Mikeish Mikeish is offline Offline
Newbie Poster

PHP includes & variables

  #1  
Oct 7th, 2006
I don't have much time to say this but I'm going to try and hurry...

Here's a snippet of code:

$subName = "someName";

include "contentHeader.php";

Inside of contentHeader:

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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2006
Location: New Jersey
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Rep Power: 5
Solved Threads: 34
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: PHP includes & variables

  #2  
Oct 7th, 2006
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.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote  
Join Date: Sep 2006
Posts: 20
Reputation: Mikeish is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
Mikeish Mikeish is offline Offline
Newbie Poster

Re: PHP includes & variables

  #3  
Oct 7th, 2006
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
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 6:00 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC