PHP code needed

Status
Not open for further replies.

Syphanx

Daemon Poster
Messages
503
Hey guys,
I am currently designing a website for a friend which i need a certain PHP code for and I can't really find it anywhere, im a bit of a noob with PHP and the stuff is fairly simple so bare with me.

With this site, It's like a gallery, what i need to do is there is a main picture up the top of the page and several smaller thumbnail sized pictures below. What the code needs to do is when you click on one of the thumbnails it enlarges it to the size of the larger photo without reloading the page.

So if anyone out there could lend me a hand it would be greatly appreciated, this is fairly urgent as I can't really progress any further on the website until this is completed.

Cheers.
 
What the code needs to do is when you click on one of the thumbnails it enlarges it to the size of the larger photo without reloading the page.
PHP runs server-side only, so if you don't want the page to reload, you'll have to use something else, like Javascript.
 
There are many ways in which to do it... I'm not too sure on this, but you might be able to enclose the larger image in a div/span tag, and rewrite the contents with a javascript call (initiated by clicking one of the links), which would be very easy to implement.

Resizing - I would highly recommend doing this on the server, if you're dealing with larger pictures, using PHP or doing it prior to uploading the pictures to your server. You could make a fairly simple PHP script that runs on each image when the page is loaded, or one in which you manually run and it'll go through checking each and adjusting as needed.

If you have any code questions, let me know. :)

JavaScript, not Java. They are two unrelated, different things.

They are absolutely related - concepts, organization and coding style in each are very similar... just their purpose is a bit different. Java is more of a high level language designed to work on its own, whilst Javascript generally works in correlation with HTML.
 
They are absolutely related - concepts, organization and coding style in each are very similar... just their purpose is a bit different.
They are not related. JavaScript is a scripting language created by Netscape. Java is a set of technologies (including the Java programming language) created by Sun Microsystems. It is unfortunate that their names are similar.

Because the Java programming language and JavaScript share similarities in some concepts and syntax, it does not mean they are related. When someone substitutes the word 'Java' for 'JavaScript', it is quite likely that person does not know the difference between the two. In that case, it should be pointed out that JavaScript is not the same as Java, which is what I posted.
 
Find a site that does what you want,
then use HTTrack to download the site and it's PHP.

Examine the PHP, learn from it, and give yourself the ability to create
your own new PHP.
 
Find a site that does what you want,
then use HTTrack to download the site and it's PHP.

Examine the PHP, learn from it, and give yourself the ability to create
your own new PHP.

HTTrack can download (or recreate) the server-side scripting? I don't think so. :)

@jaeusm
Interesting...now that I didn't know. I (obliviously) assumed JavaScript was by the same folks at Sun, hah. While most of what you said is true, I must point out Google's first definition of related: being connected either logically or causally or by shared characteristics, hence they are are related, just like all programming languages are to some extent. But yes, I see your worthy point. :p
 
Status
Not open for further replies.
Back
Top Bottom