Image Code Nyone?

Started on the old forum in September 2007 · view the original in the archive · old links redirect here

10 replies · 1,027 views · started 19 years ago · 1 min read

3 participants
Guest #1

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

WhiteWarrior Principal · 1,419 posts #2

do this

echo "<a href=\"YOURPGE.php\"><img src=\"images/home.gif\" alt=\"*\"/>PAGENAME</a>";
nclemale36 Lead · 537 posts #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...

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

Guest #4

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

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

Code anyone?? External image (may be gone)

blackhowk Senior · 411 posts #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...

look into zip, i dont understand all what you want, but i think that is the answer

Attachments: wimg.zip
Guest #6

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

index.php file CODE<?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> "; ?>

wallpaper.php file is CODE<?php echo "<img src=\"image1.gif\" alt =\"image\" border =\"0\"> "; echo "<a href=\"fun.php\"> Back to home</a>"; ?>

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

blackhowk Senior · 411 posts #7
<?php if(!isset($_GET['to'])) $_GET['to'] = ''; switch($_GET['to']) { case ''; 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 'wall_1'; echo "<img src=\"large_image_1.jpg\" alt =\"image\" border =\"0\">"; break; case 'wall_2'; echo "<img src=\"large_image_2.jpg\" alt =\"image\" border =\"0\">"; } ?>

you must create for each large image one case. see attach for more.

Attachments: wimg2.zip
Guest #8

ThankYou Blackhowk, it worked perfect. External image (may be gone)

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

blackhowk Senior · 411 posts #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['type'])) $_GET['type'] = ''; switch($_GET['type']) { case ''; $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['img']."\"><img src=\"dots/down.gif\" border =\"0\" /> "; } break; case 'wall'; function selfURL() { $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : ""; $protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s; $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]); return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI']; } function strleft($s1, $s2) { return substr($s1, 0, strpos($s1, $s2)); } //print(selfURL()); $self = selfURL(); $space='images/'; $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.

Attachments: 100images.zip

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close