Whats Wrong With This Code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Whats Wrong With This Code

    Code:
     $nopl = mysql_fetch_array(mysql_query("SELECT sex, birthday, location FROM ibwf_users WHERE id='".$who."'"));
      $uage = getage($nopl[1]);
      if($nopl[0]=='M')
      {
        $usex = "Male";
      }else if($nopl[0]=='F'){
        $usex = "Female";
      }else{
        $usex = "Shemale";
      }
      $nopl[2] = htmlspecialchars($nopl[2]);
      echo "A/S/L: [b]$uage/$usex/$nopl[2][/b]
    ";
    it keep on saying my members are shemale

    #2
    Code:
    $avlink = getavatar($who);
      if ($avlink=="")
      { 
        $sex = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$who."'"));
        if($sex[0]=='M')
             {
          echo "
    <img src=\"images/nophotoboy.gif\" alt=\"avatar\"/>
    ";
        }else if($sex[0]==&#39;F&#39;)
              {
                echo "
    <img src=\"images/nophotogirl.gif\" alt=\"avatar\"/>
    ";
              }else{
                     echo "
    <img src=\"images/nopic.jpg\" alt=\"avatar\"/>
    ";
                   }
      }else{
      echo "
    <img src=\"$avlink\" alt=\"avatar\"/>
    
    ";
      }

    i wona use this in online list who can fix it for me to be 15x15 next to the user name please

    Comment


      #3
      <div class='quotetop'>QUOTE (Numb @ Jan 6 2009, 06:56 PM) <{POST_SNAPBACK}></div>
      Code:
       $nopl = mysql_fetch_array(mysql_query("SELECT sex, birthday, location FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
         $uage = getage($nopl[1]);
         if($nopl[0]==&#39;M&#39;)
         {
           $usex = "Male";
         }else if($nopl[0]==&#39;F&#39;){
           $usex = "Female";
         }else{
           $usex = "Shemale";
         }
         $nopl[2] = htmlspecialchars($nopl[2]);
         echo "A/S/L: [b]$uage/$usex/$nopl[2][/b]
      ";
      it keep on saying my members are shemale[/b]
      that because they do not define if they are female or male in thier profiles

      Comment


        #4
        Nope when i check the profile it say male or female except on the main menu it say shemale

        Comment


          #5
          turn globals on again or
          type

          $sex = $_POST["sex"];

          or whatever it is on registration

          Comment


            #6
            Try this code
            <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>$uage = getage($nopl[1]);

            if($nopl[0]==&#39;M&#39;)

            {

            $usex = "Male";

            }else if($nopl[0]==&#39;F&#39;){

            $usex = "Female";

            }else{

            $usex = "Ladyboy";

            }
            $nopl[2] = htmlspecialchars($nopl[2]);
            echo "Age: $uage
            ";
            echo "Sex: $usex
            ";
            </div>

            Comment


              #7
              Code:
              $uage = getage($nopl[1]);
              
                if($nopl[0]==&#39;M&#39;)
              
                {
              
                  $usex = "LadyBoy";
              
                }else if($nopl[0]==&#39;F&#39;){
              
                  $usex = "Female";
              
                }else{
              
                  $usex = "Male";
              
                }
              this will now work that it say its male and female

              Comment

              Working...
              X