Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Sep 2006
    Posts
    39
    Member #
    13897
    Hi all,

    Quick question - i am just learning the basics of php and trying to understand what it can do. I was wondering that if i had a site with a large picture could php change the image continually (like a gallery effect but without the user having to click next picture all the time).

    Maybe on a timed loop? - i know i could just make a flash swf, embed it and leave it constantly playing on a loop, but i am hoping that php can do this for me. Ideally so that if i wish to add newer pictures i would not have to create a new flash file, maybe just upload them into a folder which php can retrieve the images from??

    Any thoughts or ideas would be really appreciated!

    Cheers _ Edd

  2.  

  3. #2
    ljm
    ljm is offline
    Senior Member ljm's Avatar
    Join Date
    Aug 2006
    Location
    Manchester, England
    Posts
    284
    Member #
    13684
    Liked
    1 times
    PHP itself cannot do the slideshow effect, as a page refresh would be required each time to load the next image. Your best bet is to use something like JavaScript and XML (the XML file generated by PHP). The PHP generated XML file would get the contents of the image directory and put it into a format that can easily be read by JavaScript. Or so I think.

    Either way, PHP alone will not do the trick.

  4. #3
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    PHP is a server-side programming language - it processes things on your end, not on the user's end. Imagine a posting system. A letter sent by someone will be forwarded to some address. Now, if a letter has been sent, the sender no longer has any control over that letter. If he/she needs to modify the letter for some reason, the only method would be to resend the letter. The same applies here; PHP has no control over the client's browser.

    You will need Javascript - probably in a library - to do this.

    PHP on its own is more like a data processor. It processes data at the server (based on any information you hand it, like form data or sessions) and just sends it back. It allows for complex things to be done by the server, without effecting the client in any way. That's the function of PHP. It also outputs static data that is sent back - usually HTML, but it can be anything.
    Note on code: If I give code, please note that it is simply sample code to demonstrate an effect. It is not meant to be used as-is; that is the programmer's job. I am not responsible to give you support or be held liable for anything that happens when using my code.

  5. #4
    Member
    Join Date
    Sep 2006
    Posts
    39
    Member #
    13897
    Hi ljm and Steax,
    Cheers for this - looks like there is something else i need to learn! I dont suppose you have any examples of this OR websites youve seen that use techniques like this??
    How difficult is something like this to learn in javascript? Know any good tutorials for javascripting??
    Cheers _ Edd

  6. #5
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    Ok, javascript is something somewhat different from PHP, but in concept is a fairly simple language. It's OOP system is different from PHP (prototype-based), and the libraries use objects a lot, so I think you should learn javascript first.

    My JS library of choice is jQuery, which is very flexible but can be hard to learn if you're new to JS. It's plugin Innerfade does what you want.
    Note on code: If I give code, please note that it is simply sample code to demonstrate an effect. It is not meant to be used as-is; that is the programmer's job. I am not responsible to give you support or be held liable for anything that happens when using my code.

  7. #6
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Other frameworks include Prototype (complemented by the script.aculo.us animation framework) and YUI. Ext is a very expansive widget and utility library on top of either Prototype, jQuery, or YUI (your choice). I'm starting to like Ext more and more, especially now that I know that it runs fine on top of Prototype (my framework of choice) :-)

  8. #7
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    I'm starting to like EXT, although it's programming is pretty complex and I'm using it only for my more complex web apps. It's just too big to use on standard pages.
    Note on code: If I give code, please note that it is simply sample code to demonstrate an effect. It is not meant to be used as-is; that is the programmer's job. I am not responsible to give you support or be held liable for anything that happens when using my code.

  9. #8
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Oh yeah. It's definitely huge. Lots of complexity there. But it's actually relatively well-documented, which is nice.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:47 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com