Re: [nyphp-talk] Passing JAVASCRIPT variables to PHP

2008-03-31 Thread Brian D.
Susan hit the nail on the head. She's pointing out why I said it was a "hack" - if you're not understanding the problem correctly (the difference between client-side and server-side) then the proposed solution might be "simple and workable" but it's still wrong. More to the point, what exactly are

Re: [nyphp-talk] Passing JAVASCRIPT variables to PHP

2008-03-31 Thread Susan Shemin
I'm watching this discussion with interest since I asked a similar question last month (about sending PHP stats from a JS onclick event). The answer that came up was to put a redirect to the link page, run the PHP script on a redirect.php page and then send it on to the destination. I've set i

Re: [nyphp-talk] Passing JAVASCRIPT variables to PHP

2008-03-31 Thread tedd
At 9:32 AM -0400 3/31/08, Brian D. wrote: > And don't forget this way: :-) var a = 1; (new Image()).src = '/myscript.php?a='+ a; I'm going to recommend *against* that. That works, but it's an ugly hack, and often when you're trying to do something like this you're not addressing a deep

Re: [nyphp-talk] Passing JAVASCRIPT variables to PHP

2008-03-31 Thread PaulCheung
Hi Tom, Not a problem. Here is the "Capture Client Date Routine" which I "include" into the main PHP script. var Days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); var Datum; var today = new Date(); var Year = takeYear(today); var Month = leadingZero(t

RE: [nyphp-talk] Passing JAVASCRIPT variables to PHP

2008-03-31 Thread Peter Sawczynec
To complicate this little ole back to basics essential item. Here lies crude but doable intermingling of php into js on the fly as a web page is being created. So you are passing php vars to js, you just do all of it 100% in advance before you even output a single drop of final scripts or html.

Re: [nyphp-talk] Passing JAVASCRIPT variables to PHP

2008-03-31 Thread Brian D.
> And don't forget this way: :-) > > var a = 1; > (new Image()).src = '/myscript.php?a='+ a; I'm going to recommend *against* that. That works, but it's an ugly hack, and often when you're trying to do something like this you're not addressing a deeper architectural problem. [snip] -- real

Re: [nyphp-talk] Passing JAVASCRIPT variables to PHP

2008-03-31 Thread tedd
At 6:07 PM -0400 3/30/08, Daniel Convissor wrote: Hi Paul: On Sun, Mar 30, 2008 at 09:18:10PM +0100, PaulCheung wrote: The problem is I cannot transfer the Javascript variable needed in to PHP. JavaScript is client side. PHP is server side. This has been discussed on this list a couple ti