ENetArch

msg:4120846 | 4:47 pm on Apr 23, 2010 (gmt 0) |
To convert the JavaScript variable to a PHP variable, you need to send the variable to the server, like you would either through a QUERY or a POST. To do this, your onClickDate method would include a line like: location = "?orderdate=' + this.form.orderdate.value + "'"; Or this.form.action = "" this.form.method = "POST" this.form.submit(); Your PHP code then would execute the following: if (isset ($_REQUEST ['orderdate'])) { orderdate = $_REQUEST ['orderdate']; } Hope this helps E Net Arch
|
ENetArch

msg:4120849 | 4:48 pm on Apr 23, 2010 (gmt 0) |
correction ... location = "?orderdate='" + this.form.orderdate.value + "'";
|
Matthew1980

msg:4120857 | 4:58 pm on Apr 23, 2010 (gmt 0) |
Hi all, if (isset ($_REQUEST ['orderdate'])) { $orderdate = $_REQUEST ['orderdate']; } |
| Apart from missing the dollar ;-p, try not to use $_REQUEST['value'], when accessing the $_POST or $_GET vars, go directly to them, because when you use $_REQUEST you are making available more than just $_POST not to mention the overheads ie:- $orderdate = (isset($_POST['orderdate']) ? $_POST['orderdate'] : ''); A simpler form :) Cheers, MRb
|
Readie

msg:4120863 | 5:01 pm on Apr 23, 2010 (gmt 0) |
Agree fully with Matt here, but just to build on his comment about $_REQUEST I'll direct you to this thread [webmasterworld.com] where we discuss why not to use $_REQUEST in greater detail.
|
Matthew1980

msg:4120871 | 5:06 pm on Apr 23, 2010 (gmt 0) |
Hi there Readie, I can't type as fast as you as I am injured, so you beat me (again :)) to that thread I was going to edit my original post :) Cheers, MRb
|
ENetArch

msg:4120895 | 5:22 pm on Apr 23, 2010 (gmt 0) |
thx for the corrections =) and the useful information. E Net Arch
|
|