Image Code Nyone?

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

    Image Code Nyone?

    Hi.

    Help me with this...

    When the visitor, clicks on the image link, i want him to be transferred him into a page with the image....something like

    http://mysite.com/wallpapers/view.php?img=0097.jpg

    I want to place links to the home, back and a ad unit, can u give me the code for view.php or anything similar???


    Thankyou...

    #2
    do this

    Code:
    echo "<a href=\"YOURPGE.php\"><img src=\"images/home.gif\" alt=\"*\"/>PAGENAME</a>";

    Comment


      #3
      Hi.

      Help me with this...

      When the visitor, clicks on the image link, i want him to be transferred him into a page with the image....something like

      http://mysite.com/wallpapers/view.php?img=0097.jpg

      I want to place links to the home, back and a ad unit, can u give me the code for view.php or anything similar???
      Thankyou...[/b]

      so your not spamming your servers then. ya packages are bit pants. no mysql and no php . hmmm
      Wapchat4u


      Topsites4u

      Comment


        #4
        so your not spamming your servers then. ya packages are bit pants. no mysql and no php . hmmm[/b]

        Hi. I was just referring my site as mysite.com. My host includes php and mysql.

        Code anyone??

        Comment


          #5
          Hi.

          Help me with this...

          When the visitor, clicks on the image link, i want him to be transferred him into a page with the image....something like

          http://mysite.com/wallpapers/view.php?img=0097.jpg

          I want to place links to the home, back and a ad unit, can u give me the code for view.php or anything similar???
          Thankyou...[/b]

          look into zip, i dont understand all what you want, but i think that is the answer
          Attached Files
          http://ngeo.ro

          Comment


            #6
            Thank you Blackhowk, this was almost the script I was looking for.

            index.php file
            <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
            echo "<a href=\"wallpapers.php?image1.gif\">Pic 1</a>
            ";
            echo "<a href=\"wallpapers.php?image2.gif\">Pic 2</a>
            ";
            echo "<a href=\"wallpapers.php?image3.gif\">Pic 3</a>
            ";
            ?></div>

            wallpaper.php file is
            <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
            echo "<img src=\"image1.gif\" alt =\"image\" border =\"0\">
            ";
            echo "<a href=\"fun.php\">
            Back to home</a>";
            ?></div>


            when i click on pic1, pic2 or pic3 it goes to image1.gif

            What should be edited in wallpaper.php so that the respective image loads...

            Thankyou

            Comment


              #7
              <?php
              if(!isset($_GET[&#39;to&#39;])) $_GET[&#39;to&#39;] = &#39;&#39;;
              switch($_GET[&#39;to&#39;]) {
              case &#39;&#39;;
              echo "<a href=\"index.php?to=wall_1\"><img src =\"thumb_1.gif\" alt =\"download\" border =\"0\"></a>";
              echo "
              ";
              echo "<a href=\"index.php?to=wall_2\"><img src =\"thumb_2.gif\" alt =\"download\" border =\"0\"></a>";


              break;
              case &#39;wall_1&#39;;
              echo "<img src=\"large_image_1.jpg\" alt =\"image\" border =\"0\">";


              break;
              case &#39;wall_2&#39;;
              echo "<img src=\"large_image_2.jpg\" alt =\"image\" border =\"0\">";


              }

              ?>




              you must create for each large image one case. see attach for more.
              Attached Files
              http://ngeo.ro

              Comment


                #8
                ThankYou Blackhowk, it worked perfect.

                I have 100&#39;s of image files, is there a better way or should I go on adding each case???

                Comment


                  #9
                  Something like this

                  http://simpsoncrazy.com/wallpapers.shtml

                  when i click on a wallpaper, it goes to http://simpsoncrazy.com/wallpapers/view.ph...psons1_1024.gif

                  a code similar to view.php

                  Comment


                    #10
                    for this you need some sql ... in order to insert name of picture in database.
                    http://ngeo.ro

                    Comment


                      #11
                      <?php

                      $localhost = "localhost"; // host name
                      $root = "root"; // host username
                      $pass = ""; // host password


                      $link = mysql_connect("$localhost", "$root", "$pass");
                      if(!$link)
                      { echo "No SQL" .mysql_error();
                      }

                      $db= "100images";




                      if(!isset($_GET[&#39;type&#39;])) $_GET[&#39;type&#39;] = &#39;&#39;;
                      switch($_GET[&#39;type&#39;]) {
                      case &#39;&#39;;

                      $select_db = mysql_select_db($db);
                      if (!$select_db)
                      {
                      echo " No DB " .mysql_error();
                      }




                      $sql = "SELECT `img` FROM `images`";

                      $results = mysql_query($sql);

                      while ($row = mysql_fetch_assoc($results))
                      // list start
                      {

                      echo "<a href =\"index.php?type=wall&amp;".$row[&#39;img&#39;]."\"><img src=\"dots/down.gif\" border =\"0\" />
                      ";
                      }




                      break;

                      case &#39;wall&#39;;



                      function selfURL()
                      {
                      $s = empty($_SERVER["HTTPS"]) ? &#39;&#39;
                      : ($_SERVER["HTTPS"] == "on") ? "s"
                      : "";
                      $protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
                      $port = ($_SERVER["SERVER_PORT"] == "80") ? ""
                      : (":".$_SERVER["SERVER_PORT"]);
                      return $protocol."://".$_SERVER[&#39;SERVER_NAME&#39;].$port.$_SERVER[&#39;REQUEST_URI&#39;];
                      }
                      function strleft($s1, $s2)
                      {
                      return substr($s1, 0, strpos($s1, $s2));
                      }
                      //print(selfURL());

                      $self = selfURL();
                      $space=&#39;images/&#39;;
                      $string = preg_replace("/index\.php\?type=wall&/", $space, $self);
                      echo "<img src =\"$string\">";




                      }


                      ?>



                      look into attach.
                      you may need to edit this line $string = preg_replace("/index\.php\?type=wall&/", $space, $self); to see the picture.
                      Attached Files
                      http://ngeo.ro

                      Comment

                      Working...
                      X