Reply to Re: newbie question

Your name:

Reply:


Posted by Erwin Moller on 05/31/06 08:11

eruhk wrote:

> hi, i'm new to this newsgroup and php/web development in general.
> there's something seemingly simple i'm trying to accomplish, but i'm
> having trouble predicting the behavior of php, particularly having it
> interface with javascript, which i am required to use to some extent.
>
> basically i have a java applet embedded in the page which receives
> commands via javascript. the purpose of this applet is to perform a sort
> of multi-frame animation. there is a file on the server which in each
> line contains the file to be loaded next in the animation. so, what i
> would like is to have a button (which functionally should load the next
> frame, i'll call it '>') that, when clicked, calls a php function to
> read the next line from the file on the server, parse it, and feed that
> information into a javascript function call.

Java, Javascript, and PHP. Funky setup you have. :-)


>
> so: do i want to make php call a javascript function every time this
> button is clicked (something i've had trouble getting to work),

No, PHP is executed on request-basis.
That means that something (an applet, or Javascript, or a user pressing a
hyperlink) has to call the PHP-page.
PHP itself will execute, produce some response (possible containing
javascript) and ends. PHP cannot call a Javascriptfunction in some
HTML-page directly.


or, is
> it possible to call a php function that reads the file and returns the
> information?

That is easy.
Go to www.php.net and search for (using the searchoption and select
'functions') functions like fopen() and file().

If you need to remember which line to send, also learn how to pass
information to a PHP-script from a request.
eg:
the following hyperlink:
http://www.example.com/myPHP.php?count=5

sends to myPHP.php a name/value pair. Name=counter and its value is 5. You
can retrieve that from inside you PHP script using $_GET["count"]


or is there something else i'm missing?
>

Hard to say. :-)

> thanks in advance for any help.

Good luck.

Regards,
Erwin Moller

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация