NYCPHP Meetup

NYPHP.org

[nycphp-talk] Javascript & PHP

Rudy rudy at taytek.com
Thu Jun 21 10:30:44 EDT 2007


You are suffering from the split-brain syndrome of web development.  PHP as you know is a server-side while Javascript is client-side application.  The left side of the brain needs to communicate to the right side of the brain.  For the PHP to see the variables they must be posted to the server either as Form-Post variables or hidden-form-variables.  I've done this by invoking DOM to instantiate client-side objects (hidden-form-variables) and then posted the form via a submit (Javascript called).  

If I'm off base here sorry about that but I know that I've been stung by this a lot in my applications.  

Rudy

  ----- Original Message ----- 
  From: PaulCheung 
  To: talk at lists.nyphp.org 
  Sent: Thursday, June 21, 2007 10:07 AM
  Subject: [nycphp-talk] Javascript & PHP


  I have put together an HTML form that uses Javascript which works well. However when I fill it in and fire it off to my PHP script (which for the purpose of testing simply echos what was entered in to the form) it cannot find the entered data; But when I strip out the Javascript and the fields that uses the javascript my PHP script happly echos back what was entered into the form. does anubody know what I am doing wrong??

  Paul



------------------------------------------------------------------------------


  _______________________________________________
  New York PHP Community Talk Mailing List
  http://lists.nyphp.org/mailman/listinfo/talk

  NYPHPCon 2006 Presentations Online
  http://www.nyphpcon.com

  Show Your Participation in New York PHP
  http://www.nyphp.org/show_participation.php
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20070621/1225ec5e/attachment.html>


More information about the talk mailing list