Re: Printingt Variables in Included Text

From: Date: Wed, 20 Jun 2001 18:56:35 +0000
Subject: Re: Printingt Variables in Included Text
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-54585@lists.php.net to get a copy of this message
hehe. ok i'll explain, half way through you will see what you were doing wrong :) // valid $test = 'chris lee'; echo $test; // in-valid echo $test; $test = 'chris lee'; // valid $pullquote1 = 'test for pull quote'; include('header.inc'); // in-valid include('header.inc'); $pullquote1 = 'test for pull quote'; see where im going ? your echoing the data, then assigning it a value. it needs to be the other way around -- Chris Lee lee@mediawaveonline.com "Jeremy Bowen" <ocarules@webnationinc.com> wrote in message news:01062010405501.03370@pegasus... > Hey, > > I have a website where I use header and footer files in a "includes" director > to establish the header and footer of each page. They are pretty simple, mostly > straight up html. > > The website is kind of an online magazine and what I want to do is print pull > quotes out of each story. > > So in my file lests say index.phtml I have: > > <? include(/path/to/file/header.inc) ?> > > <? > pullquote1='Test for pull quote'; > pullquote2='pullquote2 text'; > keywords='shdjkashd kasdj d kjdjdjasd'; > title='Title of Page'; > ?> > > <? include(path/to/file/footer.inc) ?> > --- > In the header file I have <? print($pullquote1) ?> > > It doesn't work!!! > > My problem is that I cannot get the variables to print in the included text. > Isn't the include text run through the pre-processor? What am I doing wrong > here? > > I want one pullquote to print in the header fil and one in the footer. I am > going nuts trying to figure out what the problem is! > > Thanks, > > Jeremy > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#54585) next »