For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > September 2007 > Newbie Question - Client Side Script Language









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Newbie Question - Client Side Script Language
antonio.cuartas@gmail.com

2007-09-25, 7:02 pm


Hi all,

Ok... PHP is a server side scripting language but what about the
client side???

Can I use PHP on the client side as well (for example to validate some
form fields) or do I need to use something like JavaScript??? What are
the alternatives???

Thanks in advance!!!

Good Man

2007-09-25, 7:02 pm

antonio.cuartas@gmail.com wrote in news:1190753730.097971.27070@
22g2000hsm.googlegroups.com:

>
> Hi all,
>
> Ok... PHP is a server side scripting language but what about the
> client side???
>
> Can I use PHP on the client side as well (for example to validate some
> form fields) or do I need to use something like JavaScript??? What are
> the alternatives???


Javascript is a client side language. This is what you need to 'validate'
form fields. It is my duty to remind you that server-side validation must
be performed whether or not you use any client-side validation.

You cannot use PHP on the client side; PHP runs on a server.

gosha bine

2007-09-25, 7:02 pm

antonio.cuartas@gmail.com wrote:
> Hi all,
>
> Ok... PHP is a server side scripting language but what about the
> client side???
>
> Can I use PHP on the client side as well (for example to validate some
> form fields) or do I need to use something like JavaScript??? What are
> the alternatives???
>
> Thanks in advance!!!
>


As long as your client is html-based (i.e. browser), javascript is the
only option. Running php on the client requires php to be installed
there (sounds logical, huh?), which is not the case for most clients.


--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
Michael Fesser

2007-09-25, 7:02 pm

..oO(antonio.cuartas@gmail.com)

>Ok... PHP is a server side scripting language but what about the
>client side???
>
>Can I use PHP on the client side as well (for example to validate some
>form fields)


In theory - yes. In practice - no.

To run PHP scripts in a browser it would require a plugin. In fact such
plugins exist, but they are more or less experimental and usually not
installed on any user machine.

>or do I need to use something like JavaScript??? What are
>the alternatives???


There's only JS.

Micha
Dejan

2007-09-26, 7:01 pm

On Sep 25, 10:55 pm, antonio.cuar...@gmail.com wrote:
> Hi all,
>
> Ok... PHP is a server side scripting language but what about the
> client side???
>
> Can I use PHP on the client side as well (for example to validate some
> form fields) or do I need to use something like JavaScript??? What are
> the alternatives???
>
> Thanks in advance!!!


You can use AJAX (JavaScript). AJAX can send some string to php page
which return if form field is valid or invalid.

Steve

2007-09-26, 7:01 pm


"gosha bine" <stereofrog@gmail.com> wrote in message
news:fdc0ru$jc9$1@registered.motzarella.org...
> antonio.cuartas@gmail.com wrote:
>
> As long as your client is html-based (i.e. browser), javascript is the
> only option. Running php on the client requires php to be installed there
> (sounds logical, huh?), which is not the case for most clients.


oh man! gosha, you propensity toward blanket, incorrect statements is even
more pronounced than my 'polemic needs'!!!

let's see, BESIDES javascript, there's vb script, tck/tl, java applets,
activex, etc., etc.


RageARC

2007-09-26, 10:01 pm

xD Wow steve you're really in the mood for flaming man

Rik Wasmus

2007-09-26, 10:01 pm

On Thu, 27 Sep 2007 03:00:54 +0200, RageARC <ragearc@gmail.com> wrote:

> xD Wow steve you're really in the mood for flaming man
>


Damn, he's off cnntp again...
Care to quote correctly what he said?
--
Rik Wasmus
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com