Closed Thread
Results 1 to 8 of 8

Thread: PHP code needed

  1. #1
    Ultra Techie Syphanx is on a distinguished road
    Join Date
    Sep 2003
    Posts
    503

    Default PHP code needed

    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.

    Last edited by Syphanx; 05-09-2007 at 06:18 AM.
    Intel Core 2 Duo E6400 *Cooled with Thermaltake Mini-Typhoon* || Intel Quad Core Q6600
    Gigabyte GA-965P-DS3
    2gb Kingston 667 DDR2 RAM || 4gb Kingston 667Mhz DDR2 RAM
    Gigabyte 512mb 8800GTS (683/2150)
    250gb Seagate HDD (ATA133) 7200rpm/16mb cache || 750gb SATA2 Seagate HDD
    ASUS MW221U 22" Widescreen 2ms.
    Logitech Z-5500D 5.1 Speakers
    Creative X-fi Xtreme Gamer Fatal1ty edition

    3DMark06 Score = 8524 (1280x1024)

  2. #2
    Software Developer jaeusm is on a distinguished road
    Join Date
    Mar 2006
    Location
    Columbus, OH
    Posts
    596

    Default Re: PHP code needed

    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.

  3. #3
    Ultra Techie Syphanx is on a distinguished road
    Join Date
    Sep 2003
    Posts
    503

    Default Re: PHP code needed

    Ok and what would be the adaquate code using java?
    Intel Core 2 Duo E6400 *Cooled with Thermaltake Mini-Typhoon* || Intel Quad Core Q6600
    Gigabyte GA-965P-DS3
    2gb Kingston 667 DDR2 RAM || 4gb Kingston 667Mhz DDR2 RAM
    Gigabyte 512mb 8800GTS (683/2150)
    250gb Seagate HDD (ATA133) 7200rpm/16mb cache || 750gb SATA2 Seagate HDD
    ASUS MW221U 22" Widescreen 2ms.
    Logitech Z-5500D 5.1 Speakers
    Creative X-fi Xtreme Gamer Fatal1ty edition

    3DMark06 Score = 8524 (1280x1024)

  4. #4
    Software Developer jaeusm is on a distinguished road
    Join Date
    Mar 2006
    Location
    Columbus, OH
    Posts
    596

    Default Re: PHP code needed

    JavaScript, not Java. They are two unrelated, different things. I don't use JavaScript because I don't like it. However, a quick Google search yielded these results:
    Dynamically Resizing Images - WebReference.com
    atom thoughts » Blog Archive » Resize Images with Javascript

  5. #5
    Monster Techie Vormund
    Join Date
    May 2004
    Location
    Tucson, AZ, USA
    Posts
    1,179

    Default Re: PHP code needed

    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.

    Quote Originally Posted by jaeusm View Post
    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.

  6. #6
    Software Developer jaeusm is on a distinguished road
    Join Date
    Mar 2006
    Location
    Columbus, OH
    Posts
    596

    Default Re: PHP code needed

    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.

  7. #7
    Junior Techie SirMille is on a distinguished road
    Join Date
    Apr 2007
    Location
    Dublin, Ireland
    Posts
    48

    Default Re: PHP code needed

    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.

  8. #8
    Monster Techie Vormund
    Join Date
    May 2004
    Location
    Tucson, AZ, USA
    Posts
    1,179

    Default Re: PHP code needed

    Quote Originally Posted by SirMille View Post
    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.

    Last edited by Vormund; 05-15-2007 at 03:06 PM.

Closed Thread

Similar Threads

  1. NEED help with a Javascript code...(mouseover and stuff)
    By Quintox in forum Web Graphics, Design, Digital Images
    Replies: 7
    Last Post: 05-02-2007, 05:41 PM
  2. PHP redirecting
    By mil1243 in forum Programming Discussions
    Replies: 4
    Last Post: 04-30-2007, 03:45 PM
  3. PHP 2-player game?
    By thejeremy in forum Programming Discussions
    Replies: 4
    Last Post: 04-09-2007, 05:01 PM
  4. Remote file access w/ IP + PHP?
    By thejeremy in forum Programming Discussions
    Replies: 2
    Last Post: 04-04-2007, 04:24 PM
  5. JavaScript Botnet Code Leaked To Internet
    By Osiris in forum Virus - Spyware Protection / Detection
    Replies: 0
    Last Post: 04-02-2007, 08:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts