Reply to Re: Assigning PHP var to Javascript

Your name:

Reply:


Posted by David Williams on 10/30/07 20:10

Okay,
I better understand. What everyone is saying is php merely outputs plain text strings which can be HTML or Javascript or whatever. I write the code in
php, send it to the server, and PHP outputs a a string that the browser can
interpret( whether it interprets it to be javascript or html ).

When I say mix php and javascript, I don't mean mix literally I mean
writing code that has php and javascript syntax intertwined ( at least to the eyeye ) . I now understand that php just sees it as a string, period. The server interprets the code, and outputs something it feels the browser can read.

I'm still working with this.

Just goes to show that you can code a lot but still not really understand the concept.


David


Shelly <sheldonlg.news@asap-consult.com> wrote:

> "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



--
David Williams
Georgia Institute of Technology, Atlanta Georgia, 30332
Email: dw149@prism.gatech.edu

[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

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