SitePoint Sponsor

User Tag List

Results 1 to 19 of 19
  1. #1
    SitePoint Zealot
    Join Date
    May 2002
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    i think i messed up somewhere Warning: Failed opening '' for inclusion (include_path=

    somehow i fouled up somewhere...and i don't know how to fix it, and i'm not very good with debugging...

    most likely it's a simple mistake...but i don't

    this is what i have:
    PHP Code:
    <html>
    <head>
    <?
       
    if (!$p)  {
      
    $title " f a m i l y ";
       }
     if (
    $p == "image") {
       include(
    $image_tbn_link);
       
    $title " f a m i l y ";
       }
       
    ?>
    <title><?=$title?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <style>
    .border {border-collapse: collapse}
    </style>
    <?php
    $connection 
    mysql_connect("localhost","","")
        or die(
    "Couldn't make connection.");
        
    $db mysql_select_db("gallery"$connection
        or die(
    "Couldn't select database");
        
    $sql "select * from gallery where catagory_type = 'family'";
        
    $sql_result mysql_query($sql,$connection)
        or die(
    "Couldn't execute query.");
        
    ?>
    <body bgcolor="#6699CC">
    <table width="100%" border="0">
      <tr>
        <td width="42%"> 
          <table border=1  bordercolor="#000000" class="border">

    <?
    while ($row mysql_fetch_array($sql_result)) {

        
    $image_link $row["image_link"];
        
    $image_tbn_link $row["image_tbn_link"];
        
    $image_title  $row["image_title"];
        
    $image_comment $row["image_comment"];
        
    $camera_type $row["camera_type"];
        
    $film_speed $row["film_speed"];
        
    $aperature $row["aperature"];
        
    $shutter_speed $row["shutter_speed"];
        
    $catagory_type $row["catagory_type"]; ?>
        
        <tr> 
        <td rowspan="6"><a href="<? print "$PHP_SELF?p=image"?>"><img src="http://localhost/public/<? echo "$image_tbn_link?>" border="0" width="100" height="75"></a></td>
        <td>&nbsp;<b>title:&nbsp;</b></td>
        <td>&nbsp;<? echo "$image_title?></b>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    <?
        
    ;}
    ?>
    </table>
     </td>
        <td width="58%"><a href="http://localhost/public/<?=$image?>"></a></td>
      </tr>
    </table>
    </body>
    </html>
    and what it's suppose to do is your presented with images on the left side of the page with some info next to it

    [title]
    [image][comment]
    [camera]

    and what it's suppose to do is when you click on the [image]
    it should then show the image slightly bigger further over on the page

    [title]
    [image][comment] [image]
    [camera]

    and that far right image would then be linked to something else (like another page)...

    but when i click on the left image it does this too me

    Warning: Failed opening '' for inclusion (include_path='.;C:\phpdev5\php\includes;C:\phpdev5\php\class') in c:\phpdev5\www\public\gallery\image3.php on line 9
    line 9 is
    PHP Code:
    include($image_tbn_link); 
    any help???
    i want to be a nerd....

  2. #2
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    That error lets you know that it cannot open the file that you are pointing to.

    What exactly is $image_tbn_link? What is its value?

  3. #3
    SitePoint Zealot
    Join Date
    May 2002
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i know what the value is suppose to be...

    it should be /gallery/thbn_size/filename.jpg that's the value in the db for that variable

    i mean that's what it has for the value of the left side image, because that one works...

    so i'm guessing it's not passing that value up to the top properly...but how do i print out what it is passing? like to debug it?
    i want to be a nerd....

  4. #4
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    echo $image_tbn_link
    Put that in right before the include statement. I would comment out the include statement.

  5. #5
    SitePoint Zealot
    Join Date
    May 2002
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    okay i did that...and now it does nothing...

    so i guess that means it's not passing the var up to the top. why is that?
    i want to be a nerd....

  6. #6
    SitePoint Zealot
    Join Date
    May 2002
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    alright, i put it up for everyone to see...

    here's the page
    http://vr6stress.vwmafia.net/image4.php

    here's the html
    http://vr6stress.vwmafia.net/output.htm

    here's the mysql info http://vr6stress.vwmafia.net/output2.htm

    see if anyone of you can make it out...
    i want to be a nerd....

  7. #7
    jigga jigga what? slider's Avatar
    Join Date
    Oct 2002
    Location
    Utah (USA)
    Posts
    309
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One question I have (I haven't looked at the files you posted yet) is why are you including a jpeg file?
    $slider = 'n00b';

  8. #8
    SitePoint Zealot
    Join Date
    May 2002
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    when you click on the small image, i want it to load a bigger image on the right side....it's really that i have to have an include if i can do it a different way...i just want to load it on the same page, not a new page persay

    index.php [click on link] index.php?p=image vs. index.php [click on link] image.php
    i want to be a nerd....

  9. #9
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Try setting the variable....

    like
    PHP Code:
    $image_tbn_link "path to image";
    echo 
    $image_tbn_link
    and see what that does.

  10. #10
    SitePoint Zealot
    Join Date
    May 2002
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, well that works, the only problem is, it's static...i mean i need the "path to image" to come from the query...


    how do i pass the $image_tbn_link variable from the query up to the 'include'?
    i want to be a nerd....

  11. #11
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    See the problem is that you are setting the variable after you try to use it. You are setting it here:
    PHP Code:
    while ($row mysql_fetch_array($sql_result)) {

        
    $image_link $row["image_link"];
        
    $image_tbn_link $row["image_tbn_link"];
        
    $image_title  $row["image_title"];
        
    $image_comment $row["image_comment"]; 
    When it needs to be set here:
    PHP Code:
    <?
       
    if (!$p)  {
      
    $title " f a m i l y ";
       }
     if (
    $p == "image") {
       include(
    $image_tbn_link);
       
    $title " f a m i l y ";
       }
       
    ?>
    You need to do the SQL query at the top so that you can use that variable.

  12. #12
    SitePoint Zealot
    Join Date
    May 2002
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i can't move it to the top, because it's all wrapped up with the table...

    well crap what do i do then?

    is it possible to move the stuff where the includes are lower down?
    i want to be a nerd....

  13. #13
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Yes, you can move the includes to anywhere in your code. It is not required to be at the top

  14. #14
    SitePoint Zealot
    Join Date
    May 2002
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    okay i moved it all at the top, but i ran into a few problems...

    it's not puting the info where i want it, and it's puting info on both spots...

    here's the example:
    http://vr6stress.vwmafia.net/image5.php

    here's my code:
    http://vr6stress.vwmafia.net/output3.htm

    shouldn't it be putting the link once, coinciding with each each clicked, to where the <?=$image?> is located?
    i want to be a nerd....

  15. #15
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    The reason is because the
    PHP Code:
    $image_tbn_link 
    is inside of the while loop.... So everytime the loop iterates it places the link again. Does that make sense?

  16. #16
    SitePoint Zealot
    Join Date
    May 2002
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes that does make sense....but does that mean, i need to do that portion outside the loop at the bottom of the page (code wise)?

    after <? ;} ?> bit?

    i hate to sound so stupid with all of this, but i really am it seems...
    i want to be a nerd....

  17. #17
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    No you aren't stupid. You are learning.... No big deal

    But yes, you need to put that portion outside of the loop, that way it doesn't get called on each iteration.

  18. #18
    SitePoint Zealot
    Join Date
    May 2002
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for making me feel batter about my lack of knowledge...that's nice...lol


    and i did some messing around with the code and came up with something very close to what i want, but it's not...lol

    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <?php
    $connection 
    mysql_connect("localhost","","")
        or die(
    "Couldn't make connection.");
        
    $db mysql_select_db("gallery"$connection
        or die(
    "Couldn't select database");
        
    $sql "select * from gallery where catagory_type = 'family'";
        
    $sql_result mysql_query($sql,$connection)
        or die(
    "Couldn't execute query.");
        
    while (
    $row mysql_fetch_array($sql_result)) {

        
    $image_link $row["image_link"];
        
    $image_tbn_link $row["image_tbn_link"];
        
    $image_title  $row["image_title"];
        
    $image_comment $row["image_comment"];
        
    $camera_type $row["camera_type"];
        
    $film_speed $row["film_speed"];
        
    $aperature $row["aperature"];
        
    $shutter_speed $row["shutter_speed"];
        
    $catagory_type $row["catagory_type"];
        
        
    $title $catagory_type;

       
    ?>
    <title><?=$title?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <style>
    .border {border-collapse: collapse}
    </style>

    <body bgcolor="#6699CC">
    <table width="100%" border="0">
      <tr>
        <td width="458"> 
          <table width="427" border=1  bordercolor="#000000" class="border">
            <tr> 
              <td width="100" rowspan="6"><a href="<? print "$PHP_SELF?p=image"?>"><center><img src="<? echo "$image_tbn_link?>" border="0" width="100" height="75"></center></a></td>
              <td width="151"><b>title:&nbsp;</b></td>
              <td width="154"><div align="center"><? echo "$image_title?>
                </div></td>
            </tr>
            <tr> 
              <td><strong>comment:</strong></td>
              <td><div align="center"><? echo "$image_comment?> </div>
                </td>
            </tr>
            <tr> 
              <td><strong>camera:</strong></td>
              <td><div align="center"><? echo "$camera_type?> </div></td>
            </tr>
            <tr> 
              <td><strong>iso:</strong></td>
              <td><div align="center"><? echo "$film_speed?> </div></td>
            </tr>
            <tr> 
              <td><strong>aperature:</strong></td>
              <td><div align="center"><? echo "$aperature?> </div></td>
            </tr>
            <tr> 
              <td><strong>shutter speed:</strong></td>
              <td><div align="center"><? echo "$shutter_speed?> </div></td>
            </tr>
          </table>


     </td>    
     <td width="500"><? 
        
    if (!$p)  {
      
    $title " f a m i l y ";
       }
       
     if (
    $p == "image") {
       echo 
    "<a href=\"$image_link\"><img src=\"$image_tbn_link\" border=\"0\"></a>";
       
       }
       
    ?><?=$image?></td>
      </tr>
     <? }; ?>
    </table>
     
    </body>
    </html>
    nets me something very close:
    http://vr6stress.vwmafia.net/image6.php

    but it does the larger thumbnail for each image, and i only want the one clicked...

    do i need to assign a $var to something so when it's clicked it only shows one? i knows it's due to the loop, but i tried ending the loop before it and it screws up the table, and then when it's out of the loop it only shows the last item in the database...
    i want to be a nerd....

  19. #19
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Yes, I would set a variable to a certain value... if it doesn't equal the right image, it doesn't get shown. Wow, that reads weird, does it make any sense?


Bookmarks

Posting Permissions

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