Jump to content
MakeWebGames

Recommended Posts

Posted

hello

i need help on my userimages.php file .

here is what the file is for

when i go to that file its showing the images i uploaded and when i click on a image it needs to show a popup but that popup is not working

here's the userimages file

 

<?php
   /*------------includes--------------*/
   include ('./includes/connections.php');
   include ('./includes/brain_file.php');
   include ('./includes/style_top.php');
   /*------------includes--------------*/
   $_GET['XID'] = abs(intval($_GET['XID']));
   echo "<center><main>Images</main><hr width = '75%'>";
   if(!$_GET['XID'])
   {
     echo "Error, Invalid ID!
           <hr width = '75%'>><a href=\"javascript:history.back();\">Back</a><hr width = '75%'>";
           include ('./includes/style_bottom.php');
           exit();
   }
   else
      {
       if($_GET['XID'] == $_SESSION['playerid'])
       {
          echo "><a href='preferences.php?action=newpic'>Upload images</a><hr width = '75%'>";
       }
       $q_ry = "SELECT  `i_id`,`i_playerid`,`i_image`,`i_profile`
                FROM `member_images`
                WHERE `i_playerid` = '".mysql_real_escape_string($_GET['XID'])."'";

      $any = mysql_query($q_ry);
      if(!mysql_num_rows($any))
      {
     echo "Error, This user has no images uploaded.
           <hr width = '75%'>><a href=\"javascript:history.back();\">Back</a><hr width = '75%'>";
           include ('./includes/style_bottom.php');
           exit();
      }
      else
         {
            $id = 0;
            echo "<table width = '75%' class = 'rounded' cellpadding = '10'><tr>";
            $num = 0;
            while($i = mysql_fetch_array($any))
            {
                      $id++;
                      $imgcheck = array();
                      $imgcheck = "images/uploads/id".$_GET['XID']."/".$i['i_image']."";
                      $size = array();
                      $size = getimagesize($imgcheck);
                      if($size) 
                      {
                      echo "<td align = 'center'>
                            <span class = 'openPopup".$id."' rel = 'popup' id = '".$id."'>
                            <img src = '".$imgcheck."' width = '160px'></span>";

                      echo "</td>";
                      } 
                      else 
                         {
                         // error
                         echo "<td align = 'center'><font color = 'red'><b>Error while loading image</b></font>.<td/>";
                         }
             $num++;
            if($num == '3')
            {
             echo "</tr><tr>";
             $num = 0;
            }
            }
            echo "</tr></table>
            <hr width = '75%'>><a href='profile.php?XID=".$_GET['XID']."'>Back</a><hr width = '75%'>";
         }
      }
   include ('./includes/style_bottom.php');
       $q_ry = "SELECT  `i_id`,`i_playerid`,`i_image`,`i_profile`
                FROM `member_images`
                WHERE `i_playerid` = '".mysql_real_escape_string($_GET['XID'])."'";

      $any = mysql_query($q_ry);
      if(!mysql_num_rows($any))
      {
      //Nothing to load
      }
      else
         {
            $id = 0;
            while($i = mysql_fetch_array($any))
            {
                      $idxx;
                      $imgcheck = array();
                      $imgcheck = "images/uploads/id".$_GET['XID']."/".$i['i_image']."";
                      $size = array();
                      $size = getimagesize($imgcheck);
                      if($size) 
                      {      
                       echo "<div class = 'openpopup' id = 'popup".$id."'>
                         ".round_table('435')."
                         <table width = '100%' border = '0' cellspacing = '0'>
                         <tr bgcolor = '#999999'><td align = 'right'><span id = '".$id."' rel = 'closepopup'>X</span></td></tr>
                         <td align = 'center'>
                            <a href='viewimage.php?i=".$i['i_id']."&XID=".$_GET['XID']."'>
                            <img src = '".$imgcheck."' width = '100%'></a>
                            </td>
                         </table>
                         ".end_round()."
                                  </div>";
                      } 
                      else 
                         {
                         //Nothing, Image error
                         }
                      }
                }
?>

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.   Paste as plain text instead

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