[PHP] Printingt Variables in Included Text
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: --- In the header file I have 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Printingt Variables in Included Text
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 [EMAIL PROTECTED] "Jeremy Bowen" <[EMAIL PROTECTED]> wrote in message 01062010405501.03370@pegasus">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: > > > > pullquote1='Test for pull quote'; > pullquote2='pullquote2 text'; > keywords='shdjkashd kasdj d kjdjdjasd'; > title='Title of Page'; > ?> > > > --- > In the header file I have > > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Printingt Variables in Included Text
Maybe a $ in front of the variables? $pullquote1='Test for pull quote'; $pullquote2='pullquote2 text'; $keywords='shdjkashd kasdj d kjdjdjasd'; Chris Jeremy Bowen wrote: > 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: > > > > pullquote1='Test for pull quote'; > pullquote2='pullquote2 text'; > keywords='shdjkashd kasdj d kjdjdjasd'; > title='Title of Page'; > ?> > > > --- > In the header file I have > > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Chris Fry Quillsoft Pty Ltd Specialists in Secure Internet Services and E-Commerce Solutions 10 Gray Street Kogarah NSW 2217 Australia Phone: +61 2 9553 1691 Fax: +61 2 9553 1692 Mobile: 0419 414 323 eMail: [EMAIL PROTECTED] http://www.quillsoft.com.au You can download our Public CA Certificate from:- https://ca.secureanywhere.com/htdocs/cacert.crt ** This information contains confidential information intended only for the use of the authorised recipient. If you are not an authorised recipient of this e-mail, please contact Quillsoft Pty Ltd by return e-mail. In this case, you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. This e-mail and any attachments may also contain copyright material belonging to Quillsoft Pty Ltd. The views expressed in this e-mail or attachments are the views of the author and not the views of Quillsoft Pty Ltd. You should only deal with the material contained in this e-mail if you are authorised to do so. This notice should not be removed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]