NYCPHP Meetup

NYPHP.org

[nycphp-talk] include "<?php" in data

Analysis & Solutions danielc at analysisandsolutions.com
Mon Nov 3 22:35:07 EST 2003


On Mon, Nov 03, 2003 at 10:02:33PM -0500, Michael Southwell wrote:
> At 09:07 PM 11/3/2003, you wrote:
> >
> >$data = 'blah blah<br /><' . "?php popbig('holster'); ?" . '>';
> 
> hmmm, thanks but this writes it out as data (not displayed because of the 
> <> but in the source).  So it's there but it's not processed.  I fixed it 
> by replacing the function call with the actual text of the function.  This 
> seems a bit clumsy but at least it works.

Wait.  I'm confused as to what you're doing.

I thought you were using this script to generate a PHP page which THEN got 
browsed.  Now, it seems the script you're writing is the browsed page 
itself.

In this case, you need to do something along these lines, depending again 
on what you're trying to do...

If you're trying to stick the string returned by popbig() (assuming you're
returning a string, and not using the function just to echo out strings)
into $data...

$data = 'blah blah<br />' . popbig('holster');

By the way, don't forget to put in means for people to examine your photos 
if they don't have JavaScript activated.


> A word of explanation:  I have some very similar pages which I'm converting 
> to one page, with various display data in arrays and choosing which array 
> by getting which one from the link to it.

Putting page contents in an array sounds wasteful.

Store each page as a file.  Store common headers and footers in two
separate files.  Include the headers/footers at the top/bottom of each 
page.  Then, in the body of each page, include your popbig() function as 
needed.

--Dan

-- 
     FREE scripts that make web and database programming easier
           http://www.analysisandsolutions.com/software/
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7th Ave #4AJ, Brooklyn NY    v: 718-854-0335   f: 718-854-0409



More information about the talk mailing list