You are here: Re: Assigning PHP var to Javascript « PHP Programming Language « IT news, forums, messages
Re: Assigning PHP var to Javascript

Posted by Shelly on 10/30/07 03:37

"David Williams" <dw149@acmex.gatech.edu> wrote in message
news:fg5vd4$bre$2@news-int.gatech.edu...
> Shelly <sheldonlg.news@asap-consult.com> wrote:
> Hi Shelly,
> Clearly, the <?php ?php> tag way is wrong as Rik pointed out.
> I was thinking that I had the <script></script> tags outside of the
> initial <? ?> tags and I was writing Javascript ( the abc part ) so I
> needed
> to get the php back out. Rik has said to think of php as writing
> javascript statements
> .
>
> Yes, I know, convouluted. I need a very good tutorial on how to mix
> javascript and
> php but have not found one yet.

You still don't get it. You DON'T MIX PHP WITH ANYTHING. PHP is a server
language that is used to process what is received from the browser, do
things on the back end like process files or write to the database, and then
send an HTML page back to the browser. Javascript is strictly a browser
side language and its actions are strictly client side. If it has to do
something on the server, it submits the page or, with AJAX, submits a
message which is transmitted to the server and read and processed by the
server side code. THEY DON'T MIX. What you can do on the server side with
PHP is to write TEXT (inside the resulting HTML document) which, when
received and read by the browser, is interpreted as Javascript.
Client Server
**************** *****************
* HTML * * PHP *
* Javascript * <====> * *
**************** *****************

Understand?

Shelly

 

Navigation:

[Reply to this 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

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