Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP help, image problems

    alright ive got two php codes, one after another on the same page, one of the codes has all the images showing, but the other only shows the text. check here to see what i mean: http://www.maftystudios.com/portfolio.php

    ok so now another problem arises, i want the images to open up in a small pop up window, so i created a popup.php file with a code to for the images. but onyl some work, and i need to know how to get a scroll bar on one. if codes are needed i can post all the php codes used on the image page and on the popup window page

  • #2
    New Coder
    Join Date
    Mar 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well i figure youll need the php code to help me at all so heres the code im using for the popup window
    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title><?php 
    $user 
    "USERNAME";
    $password "PASSWORD";
    $db "DATABASE";
    $table "portfolio";
    $id $_GET['id']; 
    $con mysql_connect("localhost",$user,$password);
    mysql_select_db($db,$con);
    $sql "SELECT * FROM $table WHERE `id` = '$id' LIMIT 1";
    $result mysql_query($sql) or die("Error: ".mysql_error());
    while(
    $row mysql_fetch_array($result)){
    echo 
    $row[0];
    }
    ?> </title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="imagetoolbar" content="no" />
    <STYLE type="text/css"> 
    <!--

    body {
    scrollbar-face-color:00314E;
    scrollbar-highlight-color:06456A;
    scrollbar-3dlight-color:06456A;
    scrollbar-darkshadow-color:06253C;
    scrollbar-shadow-color:06253C;
    scrollbar-arrow-color:76B0D0;
    scrollbar-track-color:071E2F;
    }
    -->
    </STYLE>
    </head>

    <body bgcolor="#000000" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
    <?php 
    $user 
    "USERNAME";
    $password "PASSWORD";
    $db "DATABASE";
    $table "portfolio";
    $id $_GET['id'];

    $con mysql_connect("localhost",$user,$password);
    mysql_select_db($db,$con);
    $sql "SELECT * FROM $table WHERE `id` = '$id' LIMIT 1";
    $result mysql_query($sql) or die("Error: ".mysql_error());
    while(
    $row mysql_fetch_array($result)){
    echo 
    "<img src='jpegs/$row[2].jpg' width='$row[5]' height='$row[4]' scrollbar='$row[6]'>";
    }
    ?>
    </body>
    </html>

  • #3
    New Coder
    Join Date
    Mar 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    and the two php codes im using in my image gallery are:

    PHP Code:
    <?php
    $con 
    mysql_connect("localhost","USERNAME","PASSWORD");
    $db mysql_select_db("DATABASE",$con);
    $sql "SELECT * FROM `portfolio` ORDER BY `id` DESC";
    $result mysql_query($sql) or die("Error: ".mysql_error());
    while(
    $row mysql_fetch_array($result)){
    $ree "popup.php?id=$row[3]";
    $title $row[0];
    $width $row[5];
    $height $row[4];
    $scrollbar $row[6];
    $javascript "javascript:MM_openBrWindow('$ree','$title','width=$width,height=$height,scrollbar=$scrollbar')";
    echo 
    "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
    echo 
    "<tr>";
    echo 
    "<td><font color='#FFFFFF' size='2' face='Geneva, Arial, Helvetica,
    sans-serif'>&nbsp;&nbsp; $row[0]</font></td>"
    ;
    echo 
    "</tr>";
    echo 
    "<tr>";
    echo 
    "<td><a href=$javascript><img src='jpegs/$row[1].jpg' width='250'
    height='70' hspace='4' border='0'></a></td>"
    ;
    echo 
    "</tr>";
    echo 
    "</table><br>";
    }
    ?>
    <br> (i use a break inbetween the two codes)

    PHP Code:
    <?php
    $con 
    mysql_connect("localhost","USERNAME","PASSWORD");
    $db mysql_select_db("DATABASE",$con);
    $sql "SELECT * FROM `portfolio2` ORDER BY `id` DESC";
    $result mysql_query($sql) or die("Error: ".mysql_error());
    while(
    $row mysql_fetch_array($result)){
    $ree "popup.php?id=$row[3]";
    $title $row[0];
    $width $row[5];
    $height $row[4];
    $scrollbar $row[6];
    $javascript "javascript:MM_openBrWindow('$ree','$title','width=$width,height=$height,scrollbar=$scrollbar')";
    echo 
    "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
    echo 
    "<tr>";
    echo 
    "<td><font color='#FFFFFF' size='2' face='Geneva, Arial, Helvetica,
    sans-serif'>&nbsp;&nbsp; $row[0]</font></td>"
    ;
    echo 
    "</tr>";
    echo 
    "<tr>";
    echo 
    "<td><a href=$javascript><img src='jpegs/$row[1].jpg' width='250' height='70' hspace='4' border='0'></a></td>";
    echo 
    "</tr>";
    echo 
    "</table><br>";
    }
    ?>

  • #4
    New Coder
    Join Date
    Mar 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    *bump* anyone


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •