Jump to content

[SOLVED] IF statment not working :(


jamesxg1

Recommended Posts

<?php
session_start();

require("db/db.php");

$sql = "SELECT * FROM `settings`";
$query = mysql_query($sql);
while ($settings = mysql_fetch_assoc($query)) {
$sitetitle = $settings['sitetitle']; 
$companyname = $settings['companyname']; 
$welcomename = $settings['welcomename']; 
$vone = $settings['vone']; 
$vtwo = $settings['vtwo']; 
$vthree = $settings['vthree']; 
$sitefooter = $settings['sitefooter']; 
$newsletterdet = $settings['newsletterdet']; 
$newletterunset = $settings['newletterunset']; 
$newsletterset = $settings['newsletterset']; 
$sitebanner = $settings['sitebanner']; 
}
?>
<html>
<head>
<title><?php print $sitetitle ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="template/css/styles.css" type="text/css">
<script src="jquery.js" type="text/javascript"></script>
<link href="template/facebox/facebox.css" media="screen" rel="stylesheet" type="text/css"/>
<script src="template/facebox/facebox.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8"> 
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox() 
})
</script> 

</head>

<body bgcolor="#EEEEEE" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0")">
<table width="770" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr> 
    <td style="padding-left:25px" bgcolor="#FF9900" height="100" class="logo"><?php print $companyname ?></td>
  </tr>
  <tr> 
    <td background="template/images/top01.gif" height="23" align="center" class="menu"><a href="#" class="menu">Home</a> 
      - <a href="#" class="menu">Features</a> - <a href="#" class="menu">Downloads</a> - <a href="#" class="menu">Order</a> 
      - <a href="#" class="menu">Press Release</a> - <a href="#" class="menu">FAQ</a> - <a href="#" class="menu">Help 
      Center</a> - <a href="#" class="menu">Links</a> - <a href="#" class="menu">Contact Us</a><?php
   if($_SESSION['logged'] == '1') { 
print("- <a href='../admin/logout.php' class='menu' rel='facebox'>Logout</a>"); 
}
?>
</td>
  </tr>
</table>
<table width="770" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td valign="top" bgcolor="#FFFFFF">
      <table width="100%" border="0" cellspacing="0" cellpadding="15">
        <tr> 
          <td class="title" height="60" background="template/images/title_bg.gif" align="right"><?php print $welcomename ?></td>
        </tr>
        <tr> 
          <td valign="top" class="text"> 
            <p><font color="#333333"><img src="template/images/bullet.gif" width="10" height="8"></font><?php print $vone ?>     <?php
   if($_SESSION['logged'] == '1') { 
print("<a href='admin/vone.php' rel='facebox'>Edit</a>"); 
}
?> </p>
            <p><font color="#333333"><img src="template/images/bullet.gif" width="10" height="8"></font><?php print $vtwo ?>     <?php
   if($_SESSION['logged'] == '1') { 
print("<a href='admin/vtwo.php' rel='facebox'>Edit</a>"); 
}
?> </p>
            <p><font color="#333333"><img src="template/images/bullet.gif" width="10" height="8"></font><?php print $vthree ?>     <?php
   if($_SESSION['logged'] == '1') { 
print("<a href='admin/vthree.php' rel='facebox'>Edit</a>"); 
}
?> </p>
           <p><?php print $sitebanner ?></p>
          </td>
        </tr>
      </table>
    </td>
    <td width="191" bgcolor="#E5E5E5" valign="top"><img src="template/images/top02.gif" width="191" height="87"><br>
      <table width="150" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
<?php

if($newsletterset ==  'Y') {

print("<td valign='top' height='50' class='text'><b>$newsletterdet</b></td>
        </tr><tr><td valign='bottom' height='40'><font size='1' color='#666666' face='Verdana, Arial, Helvetica, sans-serif'><img src='template/images/newsletter.gif' width='122' height='21'></font></td></tr><tr><td valign='top' height='50'><table width='100%' border='0' cellspacing='0' cellpadding='0'><form name='form1' method='post' action=''><tr><td class='text'><font size='1'>Your E-mail Address</font><br><input type='text' name='textfield' size='18'></td></tr><tr><td height='38'><input type='image' border='0' name='imageField' src='template/images/btn_submit.gif' width='58' height='19'></td>");

}

if($newsletterset ==  'N') {

print("$newletterunset");
}
?>
                </tr>
              </form>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table width="770" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td><img src="template/images/bottom_01.gif" width="770" height="6"></td>
  </tr>
  <tr>
    <td bgcolor="#E5E5E5" height="40" align="center"> <font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#999999"><?php print $sitefooter ?></font></td>
  </tr>
</table>
</body>
</html>

 

thats the main code i need this bit to work

 

<?php

if($newsletterset ==  'Y') {

print("<td valign='top' height='50' class='text'><b>$newsletterdet</b></td>
        </tr><tr><td valign='bottom' height='40'><font size='1' color='#666666' face='Verdana, Arial, Helvetica, sans-serif'><img src='template/images/newsletter.gif' width='122' height='21'></font></td></tr><tr><td valign='top' height='50'><table width='100%' border='0' cellspacing='0' cellpadding='0'><form name='form1' method='post' action=''><tr><td class='text'><font size='1'>Your E-mail Address</font><br><input type='text' name='textfield' size='18'></td></tr><tr><td height='38'><input type='image' border='0' name='imageField' src='template/images/btn_submit.gif' width='58' height='19'></td>");

}

if($newsletterset ==  'N') {

print("$newletterunset");
}
?>

Link to comment
https://forums.phpfreaks.com/topic/147685-solved-if-statment-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.