Log in

View Full Version : is PHP right for this job?



sharla
07-05-2006, 11:01 PM
New to code beyond clean HTML and just don't know where to start.:confused: Here is an example of what I'd like to accomplish..

I'v posted 2 screen shots of my project at:
http://sharlagillard.com/question/

The question:
When the viewer clicks on link "01", "02", or "03"..etc (located just below "PRINT" centered on the page) I'd like the text just below it, the large image off to it's left, and the illustration below the image to all rotate to another image or text block.. without reloading the entire page. Is this possible or just foolish? It just seems crazy that I can not give a name to a certain field then use some kind of script to file-exchange that field with the users click of a button.

I'v opted out of doing the entire page in Flash because of the file size..
What am I missing out on here?..

My thanks to everyone..:eek:

djr33
07-05-2006, 11:38 PM
PHP is server-side so it ONLY works by reloading (or loading) a page.

Javascript (if complex in this case) will do what you want.


Additionally, if you do need some of the advanced server side things (like databases) that php has to offer, you can use AJAX to use javascript to basically call php behind the scenes (hidden refreshing with javascript). AJAX is basically a style of coding in Javascript. It's fairly complex, and you don't need that unless you need php to run in realtime.
this is more for your information than this specific project; what you're asking can be done in javascript.



And, yes, Flash would work as well, but I'd agree that javascript is the better option here... better to use an alternative unless flash is the only option.

Twey
07-06-2006, 01:55 AM
Javascript (if complex in this case) will do what you want.Not complex at all, with the use of an iframe.

sharla
07-06-2006, 08:25 PM
Do you mean that each time a PHP linked object is brought into a page via an action of the mouse, that the entire PHP page is reloaded? Sorry to be so elementary about the whole thing but (from a designers point of view) I thought only the object would change. I don't get the benefit of doing this function with Java vs making the object a link to an entirely new page!.. well I guess I just answered my own question.. less page development for the programmer. Um I think.. right..?

Twey
07-06-2006, 08:52 PM
I don't get the benefit of doing this function with Java vs making the object a link to an entirely new page!Who mentioned Java?

The benefit of using an iframe is that the user wouldn't have to wait for an entirely new page to load (and you'd save bandwidth). The benefit of using PHP would be that non-JS users would be able to view your content (and you wouldn't have to code each page seperately).