Re: Re: PHP in HTML code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First of all, i recommend the use of normal php tags (<?php ...  ?>) because
the short tags are atm marked as* **DEPRECATED*.

You should also echo your values to the page, instead using the shortcut <?=
(stop being a lazy ass! :P):

<tr>
<td align="left"><?php echo $_SESSION['scripture_text']; ?></td>
</tr>

--------

<input type="text" name="reservation_date" value="<?php echo
$_GET['rdate'];  ?>" readonly="">

remember that between tags, we have normal php code.

Rewards
_______________________________
Jorge Gomes


2010/3/13 David Robley <robleyd@xxxxxxxxxxx>

> Martine Osias wrote:
>
> > An HTML/PHP code migrated to a different hosting platform seems to behave
> > differently. The PHP statements within HTML fields or within tables  does
> > not execute
> >
> > PHP within table:
> >
> > <tr>
> >  <td
> >  align="left"><?="&laquo;".$_SESSION['scripture_text']."&raquo;"?></td>
> >  </tr>
> >
> > This PHP code doesn't print in the HTML page.
> >
> > PHP within form field:
> >
> > <input type="text" name="reservation_date" value="<?=$_GET['rdate'];?>"
> > readonly="">
> >
> > This PHP code shows on the page when it shouldn't. The same variable is
> an
> > input and an output in this form:
> >
> > ********************************************
> <snip code>
> >
> > Are there times when the <? statements in HTML code don't execute?
>
> Yes - when short_open_tag is disabled in the config. See
> http://www.php.net/manual/en/ini.core.php#ini.short-open-tag for more
> info.
>
> I'd suggest you move away from using short tags, if for no other reason
> than
> portability.
>
>
> Cheers
> --
> David Robley
>
> A conclusion is simply the place where you got tired of thinking.
> Today is Boomtime, the 72nd day of Chaos in the YOLD 3176.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux