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
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.