Re: Re: Can If Else statements be split into code blocks??

From: Date: Wed, 14 Nov 2001 13:26:20 +0000
Subject: Re: Re: Can If Else statements be split into code blocks??
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-74594@lists.php.net to get a copy of this message
If someone has already replied to this I apploigize for a double post. You need to put in brackets after the if statement and end bracket before the else and then another open after the else, lastly you need to close with a bracket. Example: > > <?php > > if (strstr($DomResults,$Match)) { > > print "Congratulations! $domain.$suffix is available!"; > > ?> > > <form method="POST" action="step2.asp" > > name="form2"> > > <p><input type="submit" value="Register" > > name="B1"></p> > > </form> > > > > <?php > > } else { > > print "Sorry, $domain.$suffix is already taken."; > > }?> I hope this help. PHP is pretty easy, its just some differences that you need to get used to. Good luck. --- Brad Melendy <brad@techkno.com> wrote: > Ok, I figured out that just using echo seems to be the best way to do this > under PHP. In ASP, you can end your code block and start in with HTML, but > I couldn't get that to work with PHP. However, I was able to just use the > echo statement to get the conditional HTML I wanted to show up when the > proper condition was met in the If Else statement. > > ....Brad > > "Brad Melendy" <brad@techkno.com> wrote in message > news:20011113091603.74980.qmail@pb1.pair.com... > > Hello, > > I'm trying to execute some HTML in an IF ELSE statement. I'm trying > > something like: > > > > <?php > > if (strstr($DomResults,$Match)) > > print "Congratulations! $domain.$suffix is available!"; > > ?> > > <form method="POST" action="step2.asp" > > name="form2"> > > <p><input type="submit" value="Register" > > name="B1"></p> > > </form> > > > > <?php > > else > > print "Sorry, $domain.$suffix is already taken."; > > ?> > > > > Basically, it works great without the form I'm trying to insert, but with > > the form after the IF statement, it fails. Is what I want to do against > the > > rules? I'm converting an ASP script I have to PHP and I have it all > working > > under ASP. That means it should be eaiser with PHP right? ;-) Thanks in > > advance. > > > > ...Brad > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > ===== Dan McCullough ------------------------------------------------------------------- "Theres no such thing as a problem unless the servers are on fire!" h: 603.444.9808 w: McCullough Family w: At Work __________________________________________________ Do You Yahoo!? Find the one for you at Yahoo! Personals http://personals.yahoo.com

« previous php.general (#74594) next »