NYCPHP Meetup

NYPHP.org

[nycphp-talk] Can PHP be wraqpped around HTML??

Edward Potter edwardpotter at gmail.com
Tue Jan 15 20:03:16 EST 2008


this is where php gets a bit ugly.

Use echo, print, single quotes, double quotes, escape those
backslashes, use print <<<_EOT_, but now now you have an ugly indent.
I think perl has a bit better sytax for handling the embedding  of
html code:

qq|put all my ugly code here, variables, double quotes, you name it|;

Why can't we do something similar in php after all these years? Maybe
you can?  I just don't know about it.

:-)  ed

On Jan 15, 2008 5:31 PM, Ken Robinson <kenrbnsn at rbnsn.com> wrote:
> Quoting PaulCheung <paulcheung at tiscali.co.uk>:
>
> > This might seem quite trivial or rather silly; But it is causing me absolute
> > havoc. However, each time I update a MySQL record I set an "update
> > indicator" on, the idea being, So as not to update the record more than once.
> > I am trying to wrap PHP coding around HTML coding and not the usual other
> > way around. the question is, is it possible?? If so, what am I doing wrong?
> >
> > here is what I want to do, If update_ind != "u"  submit update
> >
> >
> > <?PHP
> > if (update_ind !=  "u")
> >    { <TD><a href="#" onclick="window.print()"><BUTTON>Print
> > </BUTTON></a><input value="UPDATE" type="submit"></TD>; }
> > ?>
>
> You want to echo the HTML:
>
> <?php
> if if (update_ind !=  "u")
>     echo '<TD><a href="#"
> onclick="window.print()"><BUTTON>Print</BUTTON></a><input
> value="UPDATE" type="submit"></TD>';
> ?>
>
> Ken
>
>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>



-- 
IM/iChat: ejpusa
Links: http://del.icio.us/ejpusa
Blog: http://www.utopiaparkway.com
Follow me: http://www.twitter.com/ejpusa
Karma: http://www.coderswithconscience.com
Projects: http://flickr.com/photos/86842405@N00/
Store: http://astore.amazon.com/httpwwwutopic-20



More information about the talk mailing list