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 5 of 5
  1. #1
    New Coder
    Join Date
    Apr 2004
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question image gallery help

    PHP Code:
    <html>

    <head>
      <title></title>
    </head>

    <body>
    hello
    <?
    // change this to the amount of images ;)
    $image_amount 005;
    // make this the source for the NEXT icon please include the extension
    // eg next.gif
    $nex "something.gif";
    // make this the source for the BACK icon please include the extension
    // eg back.gif
    $bac "something.gif";

    // be careful when editing below this line
    $image $_GET['image'];
    // if there is nothing after the .php set it as no 1
    if (!$image) {
    $image 001;
    }
    // print the image
          
    echo = "<img src=\"ntsk".$image.".gif\">";
      
    // print the nexts etc
    echo "Image ".$image." out of ".$image_amount."";
    if (
    $page != "001" || $page != $image_amount} {

    <
    br>
    $image_new $image++;
    $image_old $image--;
    echo = 
    "<a href=\"gallery.php?image=".$image_old."\"><img src=\"".$bac."\"></a>";
    echo = 
    "<a href=\"gallery.php?image=".$image_new."\"><img src=\"".$nex."\"></a>";

    }elseif (
    $page == "001") {
    echo = 
    "<img src=\"".$bac."\">";
    echo = 
    "<a href=\"gallery.php?image=".$image_new."\"><img src=\"".$nex."\"></a>";
    } elseif (
    $page == $image_amount) {
            echo = 
    "<a href=\"gallery.php?image=".$image_old."\"><img src=\"".$bac."\"></a>";
            echo = 
    "<img src=\"".$nex."\">";
                             }
    echo 
    "<hr color=\"black\" height=\"1\">";





    ?>

    </body>

    </html>
    Please could you tell me what is wrong with this code?
    ...not bad for a thirteen year old

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,095
    Thanks
    11
    Thanked 101 Times in 99 Posts
    I gave up after the fourth or fifth parse error..

    if your browser is not showing you the errors add
    <?php error_reporting(E_ALL);?>
    to the top of your script ... they are all simple parse errors

    couple of hints ...

    echo = "
    ($page != "001" || $page != $image_amount}
    <br> (line31)
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    New Coder
    Join Date
    Apr 2004
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts
    lol how the hell did i manage them , but the error command thing is not working
    ...not bad for a thirteen year old

  • #4
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,095
    Thanks
    11
    Thanked 101 Times in 99 Posts
    Quote Originally Posted by aspdude2004
    ....but the error command thing is not working

    try at the very top of your script

    PHP Code:
    <?
    error_reporting
    (E_ALL);
    ini_set("display_errors",1);
    ?>
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #5
    New Coder
    Join Date
    Apr 2004
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts
    am i getting any where?

    PHP Code:

    <html>

    <head>
      <title></title>
    </head>

    <body>


    <?
    error_reporting
    (E_ALL);
    ini_set("display_errors",1);

      
    // change this to the amount of images ;)

      
    $image_amount 005;
      
    // make this the source for the NEXT icon please include the extension
      // eg next.gif
      
    $nex "something.gif";
      
    // make this the source for the BACK icon please include the extension
      // eg back.gif
      
    $bac "something.gif";

      
    // be careful when editing below this line
      
    $image $_GET['image'];
      
    // if there is nothing after the .php set it as no 1
      
    if (!$image) {
      
    $image 001;
      }
               
    // print the image
               
    echo "<img src='ntsk".$image.".gif'>";
                 
    // print the nexts etc
                 
    echo "Image ".$image." out of ".$image_amount;
                 if (
    $page != "001" or $page != $image_amount) {

                 echo 
    "<br>";

                             
    $image_new $image++;
                             
    $image_old $image--;
                             echo 
    "<a href=\"gallery.php?image=".$image_old."\"><img src='".$bac."'></a>";
                             echo 
    "<a href=\"gallery.php?image=".$image_new."\"><img src='".$nex."'></a>";

                             } elseif (
    $page == "001") {
                             echo 
    "<img src='".$bac."'>";
                             echo 
    "<a href=\"gallery.php?image=".$image_new."\"><img src='".$nex."'></a>";
                             } elseif (
    $page == $image_amount) {
                                     echo 
    "<a href=\"gallery.php?image=".$image_old."\"><img src='".$bac."'></a>";
                                             echo 
    "<img src='".$nex."'>";
                                                 }
                                                 echo 
    "<hr color=\"dark\" height=\"1\">";





                      
    ?>

    </body>

    </html>
    I realised that 'echo = ""' was in the previous one god im stupid today, however this script is still not working and the error thing is still failing to work... even though i tried it before the first <html> tag and where it is now !!! Can you help me please
    ...not bad for a thirteen year old


  •  

    Posting Permissions

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