PDA

View Full Version : what should i DO??



hessan
August 3rd, 2001, 15:00
hi
i have 200 images.
i need a script that makes a page for each of them and there are numbers of pages on the bottom of the screen to choose from. is this possible??

niv
August 3rd, 2001, 16:05
that's fairly simple.

name the images 1 to 200 and place their proper extension on them, if you can make them uniform as in one file format, that's a lot better:



<html>
<head>
<title>Image #<? echo $num; ?></title>
</head>
<body bgcolor="#ffffff">
<table width="100%" height="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="100%" valign="center" align="center">
<?
# make them all jpeg or gif if possible
echo("<img src=\"$num.jpg\">");
?>
<br>
Image #<? echo $num; ?>
</td>
</tr>
</table>
</body>
</html>

hessan
August 3rd, 2001, 16:45
why is this showing the same thing??
http://gherti.badpenguin.net/a/viewer.php

niv
August 3rd, 2001, 16:53
don't you know how to set variables in PHP? :p

eiyiyi, i'll revamp it:



<? if (!$num) $num=1; ?>
<html>
<head>
<title>Image #<? echo $num; ?></title>
</head>
<body bgcolor="#ffffff">
<table width="100%" height="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="100%" valign="center" align="center">
<?
# make them all jpeg or gif if possible
echo("<img src=\"$num.jpg\">");
?>
<br>
<?
if ($num > 0) echo("<a href=\"?num=" . $num-1 . "\"><b><</b></a>");
?>
&nbsp;<? echo $num;
if ($num > 0) echo("<a href=\"?num=" . $num-1 . "\"><b><</b></a>");
?>
</td>
</tr>
</table>
</body>
</html>


i suggest you get the PHP documentation or a book, even you should know how to do this, it's too simple. :rolleyes:

hessan
August 3rd, 2001, 16:54
sorry man im not that pro
what do these colors mean?

niv
August 3rd, 2001, 16:57
the colors are just a guide.

hessan
August 3rd, 2001, 17:11
some thing is wrong plz look
http://gherti.badpenguin.net/a/viewer2.php

hessan
August 3rd, 2001, 18:42
heeeeeeeeeeeeeeeeeeeeellllllllllllllpppppppppppppppp

hessan
August 3rd, 2001, 18:44
I DID WHAT YOU SAID BUT SOME THING IS WRONG
http://gherti.badpenguin.net/a/viewer2.php

Dusty
August 3rd, 2001, 18:56
I see you're in a hurry :). I don't know what Needscgispac -- um, whatever his name is now (why didn't you change it to Gotcgispace?) -- was thinking when he wrote this:


<?
if ($num > 0) echo("<a href=\"?num=" . $num-1 . "\"><b><</b></a>");
?>
&nbsp;<? echo $num;
if ($num > 0) echo("<a href=\"?num=" . $num-1 . "\"><b><</b></a>");
?>

But it doesn't make any sense at all. Try this instead:


<?php

if($num>0){
print "<a href=\"?num=".($num-1)."\"><b>&lt;- last</b></a> &nbsp; <a href=\"?num=".($num+1)."\"><b>next - &gt;</b></a>";
}

?>

Dusty
August 3rd, 2001, 19:06
Oh, his also printed the current image number, to do that with mine change:

&amp;nbsp;

To:

&amp;nbsp;".$num."&amp;nbsp;

You should also add:

if($num>200){$num=1}

After his:

<? if (!$num) $num=1;

That way, once they've seen the last image they'll be taken back to the first and they won't just "run out" of images.

hessan
August 3rd, 2001, 19:48
thanks:cool:

niv
August 3rd, 2001, 20:40
Originally posted by Dusty
I see you're in a hurry :). I don't know what Needscgispac -- um, whatever his name is now (why didn't you change it to Gotcgispace?) -- was thinking when he wrote this:



whoops...i meant:


<?
if ($num > 0) echo("<a href=\"?num=" . ($num-1) . "\"><b>&lt;</b></a>");
?>&nbsp;<? echo $num . "&nbsp;";
if ($num < 200) echo("<a href=\"?num=" . ($num+1) . "\"><b>&gt;</b></a>");
?>

:o

Dusty
August 3rd, 2001, 20:47
if ($num < 200) echo("<a href=\"?num=" . ($num-1) . "\"><b>&gt;</b></a>");I think you've still got a little problem, there... :p

niv
August 3rd, 2001, 20:48
Originally posted by Dusty
I think you've still got a little problem, there... :p

this is what happens when you get three hours of sleep :o

Bruce
August 3rd, 2001, 22:01
Originally posted by Hayama-kun


this is what happens when you get three hours of sleep :o

Wow, I wish I could get tht much sleep.

hessan
August 4th, 2001, 11:38
ok, i did what you guys told me and its great
but is there a way that people can enter a number and it jumps to that image??

niv
August 4th, 2001, 11:41
<form action="url of that php file" method="get">
<input type="text" value="" name="num" size="3" maxlength="3">
<input type="submit" value="Go">
</form>


add this in there ;)