Re: [Nolug] Dynamic Text

From: scotth_at_scottharney.com
Date: Mon, 08 Mar 2004 23:38:15 -0600
Message-ID: <87eks21sxk.fsf@minorthreat.local.lan>

"Jeff Lee" <jeffreydavidlee@hotmail.com> writes:

include() includes at that point in the file. There's nothing
stopping you from making a file like:
<p> This is a paragraph
<p> So is this with <b> bold</b> text
<p> and some <?php echo $variable ?> dynamic code

and doing this in your filename.php:
<body>
<?php include("includefile.inc"); ?>
</body>

It's pretty easy to roll your own site templates this way:

<?php
  include("header.inc");
  include("sidebar.inc");
?>
 (some various html with maybe some other php code interspersed
<?php
  include("footer.inc");
?>

The headers and footers and other repeating elements can be
interspersed with html and php code of course. They can even be
dynamic based on some user login credentials pulled from a database
and tracked in a cookie.

> Is it possible to do something like this:
>
> Have one long paragrah of data with parts that are changeable but still have
> the paragraph be stored in the includes.inc file
>
> Like:
>
> $someemail = "jeff@think-solutions.com";
>
> $sometext = "This is some sample text which I want to have other things
> included in." $someemail "is my work email address etc.";
>
> SO THAT it would print this:
> This is some sample text which I want to have other things included in.
> jeff@think-solutions.com is my work email address etc.
>
> ----- Original Message -----
> From: <scotth@scottharney.com>
> To: <nolug@joeykelly.net>
> Sent: Monday, March 08, 2004 1:24 PM
> Subject: Re: [Nolug] Dynamic Text
>
>
>> "Jeff Lee" <jeffreydavidlee@hotmail.com> writes:
>>
>> > I figured out about the tag closing on the first line but it doesnt work
> for
>> > the last line. When I put the tag there it shows up in the site. I got
> it
>> > working the way I want. Thank you all for your help. Now next what I
> need to
>> > learn how to do is make that includes.inc file into a add/remove page so
>> > that the client can add/remove his own products when he wants to.
>>
>> having the webserver write to files can be tricky to do from a security
>> standpoint. At this point, I'm going to recommend you get a good book
>> on php programming and take a visit to the php web site as well.
>> mysql and php programming from addison wesley is quite good.
>>
>> php interfaces with a lot of different kinds of databases which is
>> a good way to do a dynamic site. mysql is a very popular choice.
>> Another possibilty is sqlite interfacing with php. http://sqlite.org
>> and http://www.php.net/manual/en/ref.sqlite.php have the goods.
>>
>>
>> There's nothing stopping you from using multiple "include" statements
>> to pull from multiple files.
>>
>> --
>> Scott Harney<scotth@scottharney.com>
>> "...and one script to rule them all."
>> gpg key fingerprint=7125 0BD3 8EC4 08D7 321D CEE9 F024 7DA6 0BC7 94E5
>> ___________________
>> Nolug mailing list
>> nolug@nolug.org
>>
> ___________________
> Nolug mailing list
> nolug@nolug.org
>

-- 
Scott Harney<scotth@scottharney.com>
"Asking the wrong questions is the leading cause of wrong answers"
gpg key fingerprint=7125 0BD3 8EC4 08D7 321D CEE9 F024 7DA6 0BC7 94E5
___________________
Nolug mailing list
nolug@nolug.org
Received on 03/08/04

This archive was generated by hypermail 2.2.0 : 12/19/08 EST