/    Sign up×
Community /Pin to ProfileBookmark

Ness is at something again… Image gallery

Hi !!!
Today, I’ll start coding that memo system I was talking about a few days ago.
But, suddenly, I came up with an idea for my image gallery :
I’m sure it has been done already, but I was wondering :
would it be possible to store all images in a SQL db, and also the text that goes with them, so that I wouldn’t have to make a page for each image, but rather just send parameters when the user clicks on the thumbnails ?

Then, when the user views an image, is it possible to have a “next ” and “previous” button that would load the next or previous image in the db ?
I think I’m going to need a few advice on this one, cause I don’t know at all how to start…

It would be something like that : [url]http://enfantsdelo.free.fr/eli.htm[/url]
but done in php.
( don’t really pay attention to the ugliness of the page, it’s old, and the css is missing )

Thanks for the help !!!!

to post a comment
PHP

73 Comments(s)

Copy linkTweet thisAlerts:
@NogDogAug 05.2005 — My recommendation is to store the images in a directory. Then in the database, include the image filename as one of the gallery table's columns. Then if, for example, you want to display image number 3:
[code=php]
$query = "SELECT title,description,file FROM images WHERE img_nbr=3";
$result = mysql_query($query) or die("SQL error: " . mysql_error());
if($row = mysql_fetch_assoc($result))
{
echo "<h3>{$row['title']}</h3>n";
echo "<p><img src='img/{$row['file']}' alt='{$row['title']}'></p>n";
echo "<p>{$row['description']}</p>n";
}
[/code]
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 05.2005 — Ok, great !!! That's exactly what I need. Thanks a lot !!!!! ( I hope I can manage that... )

But how do you do the "next" and "previous" things ?

Of course, i could add a line in my db that would correpond to each image with the next and previous, but I'm sure there is an easier way...

And another question... where do I put this great php code ? I'm going to have a page with all thumbnails, and... what is the code to display the bigger images ?

I mean, how does the code know that if i click thumbnail 1, I want to display image 1 ???

Thanks a lot for your help, Nog !!!
Copy linkTweet thisAlerts:
@rch10007Aug 05.2005 — check this link:

http://sourceforge.net/projects/easyphpalbum

here is the working version:

http://easyphpalbum.sourceforge.net/

i recommend this if you are starting out.
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 05.2005 — thanks, but i like doing things on my own... I found a very detailed tutorial, I'm going to try it, and see if I manage to go somewhere with it... ?
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 05.2005 — Nog, if I do a page, let's call it image.php, and I have another page, index.php with all my thumbnails displayed on it, how can I pass the variable to the page image.php ?

I understand how to do the image.php file, as you explained in your post, with the title, description, and all, but how do I pass those variables to the page ?

Do you think I could do something like that :

<a href="http://mysitename.com/image.php?img_nbr=2"><img src="mythumbnaili.jpg" alt="whatever"></a>

I'm lost.... Should I pass all the variables, or only one would suffice ?
Copy linkTweet thisAlerts:
@aznchong91Aug 05.2005 — That should work but don't forget that in the page image.php, you actually do some processing with the GET variable. Example:

<?php

$img_nbr=$_GET[img_nbr];

if ($img_nbr=='1')

{

echo "<img src="mypicture1.jpg" alt="whatever">

exit();

}

elseif ($img_nbr=='2')

........

Understand?
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 05.2005 — Yeah, I understand what you mean, but isn't there an easier way to do it ?

I expect to have lots of images, so I don't really want to do "elseif" for each image...

The purpose of having this database was to specify the name or number of the image somewhere, and then, have a script do it all, like NogDog suggested.

Is it possible to have a script get the imahe number, and then, display everything accordingly ? So that I would have ONE very simple page to display all my images ?

I plan to use this script on my website, where I have less than 100 images, but I'll also need it for something with over 1000 images... ?
Copy linkTweet thisAlerts:
@aznchong91Aug 05.2005 — Well, I am not sure. I don't know but maybe you could have something like this:

<?php

$imgname='imgname'.$_GET['img_nbr'].'.jpg';

?>

<img src=<?php $imgname; ?> alt="whatever">
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 05.2005 — yeah, I mean... If I wanted a very simple image gallery, it would be easier...

But I need a title, a description, an alt to the image source, a previous and next links... I'm aware it's not easy, though.

Your little script seems nice, i don't know if it works, though. If it does, it would solve my problem ?

And the Get image number thingy would get the image number from the address bar ?

¨The biggest problem for me is figuring out how to have the index.php page ( with the thumbnails ) and the image.php page communicate...
Copy linkTweet thisAlerts:
@aznchong91Aug 05.2005 — Yeah, its called a GET variable which is carried through the address.

For the title, description, alt and stuff, just add some sql to my 'little script':

<?php

$conn=mysql_connect('','','');

$imgname='imgname'.$_GET['img_nbr'].'.jpg';

$imgtitle=mysql_result(mysql_query('select title from table_blah where '$imgnbr'='$_
GET['img_nbr']',$conn),0);

$imgdesc=mysql_result(mysql_query('select desc from table_blah where '$imgnbr'='$_GET['img_nbr']',$conn),0);

...etc...

echo $imgtitle;

...

?>

<img src=<?php $imgname; ?>>

IF it works...

<?php echo $imgdesc; ?>
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 05.2005 — Ok, thanks !!!

I'll try it ASAP !!! ?
Copy linkTweet thisAlerts:
@aznchong91Aug 05.2005 — You're welcome. Don't blame me if it doesn't work though!!! ?
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 05.2005 — I won't !!!

I don't know if I'll have time to test it before tomorrow, but I'll try it as soon as I have time to !

I'm really eager to see if it works...
Copy linkTweet thisAlerts:
@aznchong91Aug 05.2005 — Post the results! I want to know if my really bad and lots of syntax errors skills can actually do something like this! ?
Copy linkTweet thisAlerts:
@BeachSideAug 05.2005 — Heh you could always make a class then all the info would be contained within that so you could feasibly have
[code=php]
while ($i < $imageClass->Fields('total_rows')) {
echo '<img src="' . $imageClass->Fields('img_thumb_src') . '" width="' . $imageClass->Fields('img_width') . '" height="' . $imageClass->Fields('img_height') . '" alt="' . $imageClass->Fields('img_alt') . '"><a href="' . $_SERVER['PHP_SELF'] . '?img_id=' . $imageClass->Fields('img_id') . '" class="someclass">' . $imageClass->Fields('img_text') . "</a>rn";
}
[/code]


Then you have the connection in the class that gathers all this information and dynamically creates all your thumbnails that are referenced in the db.
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 05.2005 — Ok, so I get a unexpected T_variable on line 10 :

here is my script : ( I modified it a bit )
[code=php]
<?php
// SQL database Variables
$hostname="sql.free.fr";
$user="myusername";
$pass="mypasswd";
$dbase="enfantsdelo";
$connection = mysql_connect("$hostname" , "$user" , "$pass");
$db = mysql_select_db($dbase , $connection);

$imgname=mysql_result(mysql_query('select file from image where '$id'='$_GET['id']',$connection'),0);
$imgtitle=mysql_result(mysql_query('select title from image where '$id'='$_GET['id']',$connection'),0);
$imgdesc=mysql_result(mysql_query('select desc from image where '$id'='$_GET['id']',$connection'),0);

echo $imgtitle;

?>
<img src=<?php $imgname; ?>>

<?php echo $imgdesc; ?>
[/code]


Basically, I created a table called image, with 4 fields : id ( that contains the image id ), file ( with the file name ), title, and desc ( description ).

I saw a syntax error ( i guessed it was one ) and corrected it : you left out a ' in the query. i hope I put it back in the right place.

any idea why it doesn't work ???

To Beach :

Hi !!! Actually, I don't need to create the thumbnails, because I'm going to do them in Photoshop, focusing on a part of the image, and they will have also different filter colors, so I really have to do them by hand.

I saw your movies : nice ones !!! ( although I couldn't access to some of them, cause a password was needed... )

Edit : oh, and line 10 is the first line with a query.
Copy linkTweet thisAlerts:
@aznchong91Aug 05.2005 — You put a ' after $connection. Remove that.
Copy linkTweet thisAlerts:
@BeachSideAug 05.2005 — it should be something like this Ness
[code=php]
$imgname = mysql_result(mysql_query('SELECT file FROM image WHERE '.$_GET['id'].'='id'',$connection));
[/code]
Copy linkTweet thisAlerts:
@rch10007Aug 05.2005 — decided you needed a change too huh Beach! lol - Go DJ!
Copy linkTweet thisAlerts:
@BeachSideAug 05.2005 — LOL ya... I gotta find some good records. I gotta spin next weekend at a party ?
Copy linkTweet thisAlerts:
@rch10007Aug 05.2005 — Cool, kill em'

I finally have internet at home now that I'm settling in to the "new place" so I will be raiding the forum with my $.02. lol

Although, I will probably miss seeing you logged in very often since I'm on the other side of the globe. No worries, I will have lots to ask about.
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 05.2005 — Kay, guys ! Thanks a lot !!

I fixed it, but now I get...

THAT : :eek:

Warning: Wrong parameter count for mysql_result() in /var/www/free.fr/a/d/enfantsdelo/image.php on line 10

Warning: Wrong parameter count for mysql_result() in /var/www/free.fr/a/d/enfantsdelo/image.php on line 11

Warning: Wrong parameter count for mysql_result() in /var/www/free.fr/a/d/enfantsdelo/image.php on line 12

What is it ?


that's my script right now :
[code=php]
$imgname = mysql_result(mysql_query('SELECT file FROM image WHERE '.$_GET['id'].'='id'',$connection));
$imgtitle = mysql_result(mysql_query('SELECT title FROM image WHERE '.$_GET['id'].'='id'',$connection));
$imgdesc = mysql_result(mysql_query('SELECT desc FROM image WHERE '.$_GET['id'].'='id'',$connection));
[/code]
Copy linkTweet thisAlerts:
@aznchong91Aug 05.2005 — you need a ,0 in the mysql_result:

mysql_result(mysql_query('select...',$connection)[B],0[/B])
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 05.2005 — Okay, I fixed it, and now, I get that...

Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 2 in /var/www/free.fr/a/d/enfantsdelo/image.php on line 10

Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 3 in /var/www/free.fr/a/d/enfantsdelo/image.php on line 11

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /var/www/free.fr/a/d/enfantsdelo/image.php on line 12

Arrrgggghhh, what the hell is that !!!!!!
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — Try this:

mysql_result(mysql_query('SELECT file FROM image WHERE '$_GET['id']'='id''',$connection),0);

Basically, remove the dots before the GET, and remove the slashes for id and add a ' after id.

Also, make sure your database is actually populated.
Copy linkTweet thisAlerts:
@scriptKiddieAug 06.2005 — will POST method work or it has to be GET . Dont u need to specify that it is a FORM to use these methods.
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — It isn't a form. It is added into the url.

http://random.random.com/image.php[B]?img_nbr=1[/B]
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — that's what I get know...

Parse error: parse error, unexpected T_VARIABLE in /var/www/free.fr/a/d/enfantsdelo/image.php on line 10

of course my database is populated... lol !!!
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — What's the script right now?
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — [code=php]
<?php
// SQL database Variables
$hostname="sql.free.fr";
$user="username";
$pass="passwd";
$dbase="enfantsdelo";
$connection = mysql_connect("$hostname" , "$user" , "$pass");
$db = mysql_select_db($dbase , $connection);

$imgname = mysql_result(mysql_query('SELECT file FROM image WHERE '$_GET['id']'='id'',$connection),0);
$imgtitle = mysql_result(mysql_query('SELECT title FROM image WHERE '$_GET['id']'='id'',$connection),0);
$imgdesc = mysql_result(mysql_query('SELECT desc FROM image WHERE '$_GET['id']'='id'',$connection),0);

echo $imgtitle;

?>
<html>
<title>no title</title>
<head></head>

<body>
<img src=<?php $imgname; ?>>

<?php echo $imgdesc; ?>
</body>
</html>
[/code]

also, I removed one ', because I add one too much, and the code was all messed up.

By reading a bit about this "unable to jump on row 0", it appears that the query isn't returning anything.

I have the impression the previous code was right ( the one with the dots around GET ) but that the query is wrong, somehow...

I'm getting crazy... why ??? WHY ??? ?
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — dont add the dots.

'.$_get['id'].'

should be just

'$_GET['id']'
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — No no, I didn't add them. I uploaded the wrong thing. I edited it.

It doesn't work, I have the unexpected T_VARIABLE on line 10. The query doesn't go any furhter, because it gets stuck on this error, that's why I have only one error.

But the query doesn't return anything...
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — so whats the current code?
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — I edited it, it's in the previous post I did.
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — O right, for the where part it should be:

'$_GET['id']'='[B]$[/B]id'
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — Ok... same problem here : unexpected T_Variable in line 10...

Do you think I'd better call the dots back ?
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — ok, try this. Before the mysql stuff, add this line:

$getid=$_GET['id'];

And then change the '$_GET['id']' in the mysql_query to just '$getid'.

Then post the results and code.
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — $getid=$_GET['id'];

$imgname = mysql_result(mysql_query('SELECT file FROM image WHERE '$getid'='$id'',$connection),0);

$imgtitle = mysql_result(mysql_query('SELECT title FROM image WHERE '$getid'='$id'',$connection),0);

$imgdesc = mysql_result(mysql_query('SELECT desc FROM image WHERE '$getid'='$id'',$connection),0);


unexpected t_variable, but on line 12, this time ( still the first line of the query... )

I'm getting desperate, and I feel guilty for all the help you're giving me...
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — sorry, I've got to go, but I'll be back soon... This image gallery won't see me defeated !!!! è__é
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — Do you actually have a $id variable?!?!?!?

And don't mind about feeling guilty. This is what forums are for, right?
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — sorry, I've got to go, but I'll be back soon... This image gallery won't see me defeated !!!! è__é[/QUOTE]

lol. What exactly is the $id variable?
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — Actually, what is your database table format?

Title | Name | Description| or what?
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — I'm back for five minutes...

The table is :

Id | File | Title | Desc

Maybe it's better if I also give you the code for calling the image.php page :

<a href="http://enfantsdelo.free.fr/image.php?id=1"><img src="http://enfantsdelo.free.fr/Images/persos/eliflo.jpg" alt="whatever"></a>

What I have in my db :

1 | http://enfantsdelo.free.fr/Images/persos/eliflo.jpg | Eli by Floriane | a quick description about the image

and also the same thing for another image, with the id field set to 2...

Maybe I should just call my variables something else ?
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — the mysql_queryies should be:

mysql_query('SELECT title FROM image WHERE ID='$getid'',$connection),0);

That should work.
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — Also, I think the <img src part should be:

<img src=[B]'[/B]<?php echo $imgname; ?>[B]'[/B]>
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — Post your current code as soon as possible so I can see if you have made all my suggested changes!
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — I'm still getting the t variable parse error....

I'm doomed...
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — code please
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — [code=php]
<?
// connection stuff here
$connection = mysql_connect("$hostname" , "$user" , "$pass");
$db = mysql_select_db($dbase , $connection);

$getid=$_GET['id'];

$imgname = mysql_result(mysql_query('SELECT file FROM image WHERE ID='$getid'',$connection),0);
$imgtitle = mysql_result(mysql_query('SELECT title FROM image WHERE ID='$getid'',$connection),0);
$imgdesc = mysql_result(mysql_query('SELECT desc FROM image WHERE ID='$getid'',$connection),0);

?>
<html>
<title>no title</title>
<head></head>

<body>
<p><?php $imgtitle; ?></p>
<img src='<?php echo $imgname; ?>'>

<?php echo $imgdesc; ?>
</body>
</html>
[/code]


the code...

Why does this stupid parse error always appears ??? :mad:
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — Okay, try this. In the mysql_queries, use " before the select part and at the end.

mysql_query("SELECT file FROM image WHERE ID='$getid'",$connection),0);

Just as a note, for the next and previous things, you would just need the url to be

http://mysite.com/images.php?img_nbr='$getid'+1

and

http://mysite.com/images.php?img_nbr='$getid'-1
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — oh oh oh !!! Improvment, here !!! Definately !!!!

The image shows, but I don't get the image description or the title...

But the image is here !!!

Here is the error I get :

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /var/www/free.fr/a/d/enfantsdelo/image.php on line 14

Line 14 is the description query
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — Well, I don't know. Full code again?

It could be that the description ... but never mind. The title should show...
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — [code=php]
$getid = $_GET['id'];

$imgname = mysql_result(mysql_query("SELECT file FROM image WHERE ID='$getid'",$connection),0);
$imgtitle = mysql_result(mysql_query("SELECT title FROM image WHERE ID='$getid'",$connection),0);
$imgdesc = mysql_result(mysql_query("SELECT desc FROM image WHERE ID='$getid'",$connection),0);

?>
<html>
<title>no title</title>
<head></head>

<body>
<p><?php $imgtitle; ?></p>
<img src='<?php echo $imgname; ?>'>

<?php echo $imgdesc; ?>
<a href="http://enfantsdelo.free.fr/image.php?id='$getid'+1">Next</a>

</body>
</html>
[/code]


Oh, and I tested the next image thing... I get the "unable to jump to row 0..."

?
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — Ok, I fixed the description thing, it was just a syntax problem...

the variable was called "desc", which is a php keyword, or something similar...

So, for now, it works fine !!! ( except the next and previous thing )
Copy linkTweet thisAlerts:
@rch10007Aug 06.2005 — '$getid'='$id''

you are putting " after $id instead of '

also, i don't think you have to put a variable in quotes, do you? '$getid' --> $getid
Copy linkTweet thisAlerts:
@rch10007Aug 06.2005 — nevermind you fixed it
Copy linkTweet thisAlerts:
@rch10007Aug 06.2005 — will this work, '$getid+=1', instead of '$getid'+1
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — I got it !!!!!!!

Waaoaoooom, it's working, it's ALIVE !!!! lol !!!!!

Here is the code, for everybody to use if they need to :

[code=php]
<?php
// SQL database Variables
$hostname="";
$user="";
$pass="";
$dbase="";
$connection = mysql_connect("$hostname" , "$user" , "$pass");
$db = mysql_select_db($dbase , $connection);

$getid = $_GET['id'];

$imgname = mysql_result(mysql_query("SELECT file FROM image WHERE ID='$getid'",$connection),0);
$imgtitle = mysql_result(mysql_query("SELECT title FROM image WHERE ID='$getid'",$connection),0);
$imgdesc = mysql_result(mysql_query("SELECT des FROM image WHERE ID='$getid'",$connection),0);

?>
<html>
<title>no title</title>
<head></head>

<body>
<?
echo "<p>" .$imgtitle. "</p>";
echo "<img src=" .$imgname. ">";
echo "<p>" .$imgdesc. "</p>";
echo "<a href=http://enfantsdelo.free.fr/image.php?id=".($getid+1).">Next</a>";
?>
</body>
</html>
[/code]


A VERY big Thank You to everybody, and especially to aznchong91, who spend so much time to help me !!!!

aznchong91, I'm going to add you to my site and give you credit for the help on the gallery.
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — will this work, '$getid+=1', instead of '$getid'+1[/QUOTE]
thanks, rch10007, I fixed it... It was just a matter of syntax. I posted it for everybody to see the full code ?

Thanks for your help !
Copy linkTweet thisAlerts:
@rch10007Aug 06.2005 — cool - i can't wait til the day i am actually a help to people, lol

i'm working on it though
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — I don't think I'll ever be a help to people in php... lol !!!

Though, I know quite a lot about CSS, so I try to help people in that way, and I also hang around the website review subforum a lot...
Copy linkTweet thisAlerts:
@rch10007Aug 06.2005 — good, now i know who to ask about css problems!! lol

i am tackling that monster right now.
Copy linkTweet thisAlerts:
@aznchong91Aug 06.2005 — Glad I was of help, Ness_du_Frat! I learned a lot in the process too! (and I got a lot of posts ?)
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — I'm back for some questions !!!

Is there a way the script can count the number of images in the database, and NOT propose a previous, when it's the first image, or Next, when it's the last one ????

It would be absolutely great !!!!
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 06.2005 — So, I figured out how to get the number of images in the db, that was pretty easy.

Now, my code looks like that :

[code=php]
<?php
// SQL database Variables
$hostname="";
$user="";
$pass="";
$dbase="";
$connection = mysql_connect("$hostname" , "$user" , "$pass");
$db = mysql_select_db($dbase , $connection);

$getid = $_GET['id'];

$imgname = mysql_result(mysql_query("SELECT file FROM image WHERE ID='$getid'",$connection),0);
$imgtitle = mysql_result(mysql_query("SELECT title FROM image WHERE ID='$getid'",$connection),0);
$imgdesc = mysql_result(mysql_query("SELECT des FROM image WHERE ID='$getid'",$connection),0);
$retour = mysql_query('SELECT COUNT(*) AS imgnb FROM image');
$donnees = mysql_fetch_array($retour);
$nbre = $donnees['imgnb'];
?>
<html>
<?
echo "<title>" .$imgtitle. "</title>"; ?>

<head></head>

<body>
<?
echo "<p>" .$imgtitle. "</p>";
echo "<img src=" .$imgname. ">";
echo "<p>" .$imgdesc. "</p>";
echo "<p><a href=http://enfantsdelo.free.fr/image.php?id=".($getid-1).">Previous</a>";
echo "&nbsp;|&nbsp;";
echo "<a href=http://enfantsdelo.free.fr/image.php?id=".($getid+1).">Next</a></p>";
echo "<p>There are ".$nbre." images in the db</p>";
?>
</body>
</html>
[/code]


I don't need to display the image number, I did it to test the piece of code.

Now, do you think I could do an if statement to check if $getid+1 is equal to the total amount of images in the db, and then provide an alternative code ?

Same if $getid-1 is equal to 0 ?

mm... just need a piece of advice on this one, to tell me if I'm going in the right direction...
Copy linkTweet thisAlerts:
@scriptKiddieAug 07.2005 — i want to know how can i send 2 values across using this method.

<a href='imgMain.php?itemType=kurti'>Kurtis</a>

i want to send another value(itemMat) to the imgMain website.
Copy linkTweet thisAlerts:
@aznchong91Aug 07.2005 — You add an & sign:

a href='imgMain.php?itemType=kurti[B]&[/B]itemMat=blah'>Kurtis</a>

Understand?

PS:You should learn to figure something like this out yourself. It is very simple. Its how i figured it out. Create a form with method=get, and then check the url!
Copy linkTweet thisAlerts:
@scriptKiddieAug 07.2005 — i am sorry i am new to this stuff. is it possible to send values to two webpages.
Copy linkTweet thisAlerts:
@aznchong91Aug 07.2005 — Why would you want to do that?!? Unless you want to open another popup window in addition to your original...
Copy linkTweet thisAlerts:
@scriptKiddieAug 07.2005 — i want to do something likke that.
Copy linkTweet thisAlerts:
@aznchong91Aug 07.2005 — Then you just send it to one webpage first, and then at the top of that page, open a new window with basically the same url as the first one. Be warned though, that some people have popup blockers!
Copy linkTweet thisAlerts:
@aznchong91Aug 09.2005 — Ness, I think the colors for your site should be a little more pronounced. For example, the dark blue should be used with a much lighter blue. It's hard to tell the difference! The same with the purple and other colors. Also, how about adding an english version? ?
Copy linkTweet thisAlerts:
@Ness_du_FratauthorAug 09.2005 — Thanks for you suggestion. I studied the colors carefully, and i tried different colors, and it's only that bunch of colors that goes well together. Otherwise, I have too much green in the blue, too much blue or red in the purple...

It mostly depends on the screen. On my pc, the green version almost destroys my eyes, and on my mac, it's very pleasant to look at.

Also, I'm using only colors belonging to the 256 web colors..

English version would be really pointless, because the site is about my book, and my book is in French !!

But I really appreciate your comments about my site !!!
×

Success!

Help @Ness_du_Frat spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...