Posted by Shelly on 07/17/05 14:27
\"Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message
news:8t6kd1565d7i3saln8tjhth9fm2prerhmn@4ax.com...
>I noticed that Message-ID: <oq2dndVvafIpRETfRVn-og@comcast.com> from
> Shelly contained the following:
>
>>Why do the php code lines show up in the output?
>
> At a guess you haven't put <?php and ?> around the code in decomp.inc
>
> When doing an include or a require you effectively drop out of php. So
> what you really have is:
>
> ?>
> $num = $_SESSION['num'];
> $var1 = $_SESSION['var1'];
> <?php
>
> hence the code is simply treated as plain html
Makes sense. No, I didn't because I thought includes worked the way they do
in C, C++, Java, etc. Looking at the my other include for db stuff (that
was set up in Connections in Dreamweaver) it has the bracketing. What is
interesting is I use that code as:
<?php require_once("dbLoginStuff.php"); ?>
and the dbLoginStuff.php has
<?php stuff ?>
I didn't notice this before, but this would give
<?php <?php stuff ?> ?>
if it worked like other includes.
Thanks.
Shelly
[Back to original message]
|