if statement in a td??

  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

ok, i got this in a td

PHP Code: [ Select ]
      <?
 
    if($conn) { print ("<div align=left><strong>Installation
 
       Complete!</strong> </div>");
 
      } else {
 
      print ("<div align=left><strong>ERROR!</strong> </div>");
 
      ?>
  1.       <?
  2.  
  3.     if($conn) { print ("<div align=left><strong>Installation
  4.  
  5.        Complete!</strong> </div>");
  6.  
  7.       } else {
  8.  
  9.       print ("<div align=left><strong>ERROR!</strong> </div>");
  10.  
  11.       ?>


whats the prob there? should work shouldnt it? then i got a prob as well here:

PHP Code: [ Select ]
  <? if($conn) {
 
     print("<div align=center><br>
 
       <br>
 
       <br>
 
       <b><font size=2 face=Verdana, Arial, Helvetica, sans-serif>Please now delete the <i>install</i>
 
       directory and close all browser windows.</font></b> </div>");
 
      } else {
 
      print("<div align=center><br>
 
       <br>
 
       <br>
 
       <b><font size=2 face=Verdana, Arial, Helvetica, sans-serif>Please go back and make sure all the fields you had put in is correct.  It seems that the database details were incorrect.</font></b> </div>"); ?>
  1.   <? if($conn) {
  2.  
  3.      print("<div align=center><br>
  4.  
  5.        <br>
  6.  
  7.        <br>
  8.  
  9.        <b><font size=2 face=Verdana, Arial, Helvetica, sans-serif>Please now delete the <i>install</i>
  10.  
  11.        directory and close all browser windows.</font></b> </div>");
  12.  
  13.       } else {
  14.  
  15.       print("<div align=center><br>
  16.  
  17.        <br>
  18.  
  19.        <br>
  20.  
  21.        <b><font size=2 face=Verdana, Arial, Helvetica, sans-serif>Please go back and make sure all the fields you had put in is correct.  It seems that the database details were incorrect.</font></b> </div>"); ?>
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

at a glance, you've left the last } off both statements. They should be:
PHP Code: [ Select ]
<?
 
if(something) {
 
   do something...
 
} else {
 
   do something else...
 
}< - - this one's missing
 
?>
 
 
  1. <?
  2.  
  3. if(something) {
  4.  
  5.    do something...
  6.  
  7. } else {
  8.  
  9.    do something else...
  10.  
  11. }< - - this one's missing
  12.  
  13. ?>
  14.  
  15.  
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

Yup, that's what I was gonna say too, but for future reference Nem, it usually helps to post the actual error you're getting in case the problem isn't so obvious :)
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

whoops :$

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 117 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.