You are here: Re: How to retrieve javascript object value in PHP ? « PHP Programming Language « IT news, forums, messages
Re: How to retrieve javascript object value in PHP ?

Posted by Ike on 01/09/06 16:26

Do an HTTP POST (or GET) of a form, where you send the object from
Javascript, calling the same page to rerender. When the page loads, in php,
check if the value was sent. Suppose I have a js variable 'x'. I then put it
in a hidden text field say, on a form, and POST the form.

When the page reloads, it tests to see if x has been "set" in javascript
(i.e. POSTED):

$x = $_POST['x'];

if $x =="" then it is the first time the form was loaded and x has not been
set in js. (or, a subsequent time for loading the form after a POST and x
was never set in js). You may want to check too if x==null, not sure if it
is null or "". -Ike

 

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

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