RE: [PHP] if then statement
| From: | Jennifer Goodie | Date: | Mon, 21 Apr 2003 23:19:08 +0000 |
| Subject: | RE: [PHP] if then statement | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144741@lists.php.net to get a copy of this message | ||
So it is still in one script (file), just in different opening and closing
tags?
<?php
if($blah == 'blerg'){
?>
<!-- a bunch of html goes here -->
<?php
}else{
?>
<!-- different html goes here -->
<?php
}
?>
I would suggest actually learning PHP and not relying on Dreamweaver to do
it for you because WSYWIG code doesn't seem like the smart choice since it
is bloated and convoluted and relying on it keeps you from knowing how to do
even the simplest things on your own, but maybe that's just me.
> -----Original Message-----
> From: Tim Haskins [mailto:tim@copiousdg.com]
> Sent: Monday, April 21, 2003 4:15 PM
> To: php-general@lists.php.net
> Subject: [PHP] if then statement
>
>
> for the life of me I cannot figure out how to do the following:
> (below not correct syntax, just the idea)
>
> If x == 1 then
> show something
> else
> show this
> end
>
> Now I don't want it all in one PHP script. I need it so that in
> dreamweaver, when I open the document, I see the opening IF PHP
> tag then my
> text of "show something", then the ELSE tag, my text of "show this", then
> the END tag. Now I can do this with asp(which I'm familiar
> with), but I am
> having difficulties trying to figure out a similar way in php. Any ideas?
>
> Thanks!!
>
> --
> tbo