Jump to content

if a or b do this elseif c do something else


conan318

Recommended Posts

it should be pretty simple. if member type == Gold or silver echo from a

if $member== client echo form b.

 

the query is working as i can echo out $member and display the member type before the if statement.

after the if statement no variables will echo out.

 

Gold is with a capital G and silver is not in the database.

 

$data=mysql_query(" SELECT * FROM members WHERE email='$myusername' and password='$mypassword'")or die (mysql_error());
while ($info=mysql_fetch_array($data)){

$member=$info['member_type'];
$email=$info['email'];
$frist=$info['fname'];
$last=$info['lname'];
$country=$info['country'];
$add=$info['address'];
$state=$info['state'];
$zip=$info['zip'];

}

  echo $member;
  echo $frist;
?>



<html xmlns="http://www.w3.org/1999/xhtml">  
<head>  
<title>3designbreif.com | Create profile</title>  
<link rel="stylesheet" type="text/css" href="../css/3lance.css" media="all" /> 
</head>  
<body>  

<div class="content" style="background-image:url(../img/3lancecreatep.png);">
<div id="update">
<?php 
echo "welcome ".$email." Please Change your password and comfirm details.";
echo "<br/>";
?>
<?php
if($member=='Gold' || $member=='silver'){
?>
<form action="../php/update.php" method="post">

<div style="clear:both;"></div>

<label for='password'>Password</label><input type="password" name="password" />
<div style="clear:both;"></div>
<label for='password2'>Comfirm Password</label><input type="password" name="password2" />
<div style="clear:both;"></div>
<label for="name">Name</label><input type="text" name="name" value="<?php $frist?>"/>
<div style="clear:both;"></div>
<label for="lname">Last Name</label><input type="text" name="lname" value="<?php $last?>" />
<div style="clear:both;"></div>
<label for="address">Address</label><input type="text" name="address" value="<?php $add?>" />
<div style="clear:both;"></div>
<label for="state">State</label><input type="text" name="state" value="<?php $state?>" />
<div style="clear:both;"></div>
<label for="country">Country</label><input type="text" name="country" value="<?php $country?>" />
<div style="clear:both;"></div>
<label for="zip">Zip</label><input type="text" name="zip"value="<?php $zip?>" />
<div style="clear:both;"></div>

<?php
}

if($member=='client'){
echo $member;
?>

<form action="../php/update2.php" method="post">

<div style="clear:both;"></div>

<label for="password">Password</label><input type="password" name="password" />
<div style="clear:both;"></div>
<label for="password2">Comfirm Password</label><input type="password" name="password2" />
<div style="clear:both;"></div>
<label for="name">Name</label><input type="text" name="name" value="<?php echo $frist;?>" />
<div style="clear:both;"></div>
<label for="lname">Last Name</label><input type="text" name="lname" value="<?php echo $last;?>" />
<div style="clear:both;"></div>
<label for="address">Address</label><input type="text" name="address" value="<?php echo $add;?>" />
<div style="clear:both;"></div>
<label for="state">State</label><input type="text" name="state" value="<?php echo $state;?>" />
<div style="clear:both;"></div>
<label for="country">Country</label><input type="text" name="country" value="<?php echo $country;?>" />
<div style="clear:both;"></div>
<label for="zip">Zip</label><input type="text" name="zip"value="<?php echo $zip;?>" />
<div style="clear:both;"></div>	

<?php
}
?>

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.