get html element value using php

I am building a mysql/php/javascript based online timesheet system which allows users to assign themselves predefined projects and then select one of the projects assigned to them and add hours for a particular date to the database - i can get the add to work fine, but i need to be able to amend the hours once they have been entered (i.e. go back to the same form, read the existing hours in and then allow the user to edit them via the form then update the database record)

I have a javascript based calendar which changes the content of an anchor tag without refreshing the page i.e.
initially:-
<a id="tag">12/12/2007</a>
then click "change date" the calendar pops up, you can click a date and then it closes the calendar popup and updates the content of the <a> tag WITHOUT refreshing the page. The fact that it doesnt refresh the page is important and needs to stay this way.

I need to be able to read the content of the <a> tag when it changes and read it into a php variable (which in turn affects an SQL statement)

it would be nice to ba able update the $date variable (which is initially set using $_GET . onchange() of the <a> tag's content. but i dont think you can do this!

Here is the code for my page, im sure its pretty messy and does things in an over complicated way, but it works (so far)!:

The problem at the moment is becuase when the page loads it gets todays date (a date has to be supplied to the javascript calendar before you pick a different date, so i pass todays date in the url from the previous page)
So once you have added some information for a particular date with a particular username and a particular project title, the script always thinks you have already added hours for that day and goes into the "amend/edit" block of code. I need to be able to change the date using the calendar then the method exists() to be called and passed the new date (which will then mean the method wont find an existing record and will jump to the "new hours" type block)

I know this is pretty long and maybe too complex, but i have been trying to find a solution for a while now and its getting really annoying!

I am building a mysql/php/javascript based online timesheet system which allows users to assign themselves predefined projects and then select one of the projects assigned to them and add hours for a particular date to the database - i can get the add to work fine, but i need to be able to amend the hours once they have been entered (i.e. go back to the same form, read the existing hours in and then allow the user to edit them via the form then update the database record)

I have a javascript based calendar which changes the content of an anchor tag without refreshing the page i.e.
initially:-
<a id="tag">12/12/2007</a>
then click "change date" the calendar pops up, you can click a date and then it closes the calendar popup and updates the content of the <a> tag WITHOUT refreshing the page. The fact that it doesnt refresh the page is important and needs to stay this way.

I need to be able to read the content of the <a> tag when it changes and read it into a php variable (which in turn affects an SQL statement)

it would be nice to ba able update the $date variable (which is initially set using $_GET . onchange() of the <a> tag's content. but i dont think you can do this!

Here is the code for my page, im sure its pretty messy and does things in an over complicated way, but it works (so far)!:

The problem at the moment is becuase when the page loads it gets todays date (a date has to be supplied to the javascript calendar before you pick a different date, so i pass todays date in the url from the previous page)
So once you have added some information for a particular date with a particular username and a particular project title, the script always thinks you have already added hours for that day and goes into the "amend/edit" block of code. I need to be able to change the date using the calendar then the method exists() to be called and passed the new date (which will then mean the method wont find an existing record and will jump to the "new hours" type block)

I know this is pretty long and maybe too complex, but i have been trying to find a solution for a while now and its getting really annoying!

I hope this makes sense!

Please help!!!!!

Thanks,

Mike

The only way you can update a mysql database on the server from the browser is to send a new HTTP Request. This usually means refreshing the page, but there are a few methods that allow you to do so without refreshing the page.

Either way, you'll need to get the date via JavaScript, then create a new HTTP Request to your server passing the date as a parameter in the URL. The PHP page you request will then add the date to the database.

not sure why it posted my original post again, currently i am using $_GET to get today's date (which is retreived by a js function on a prev page) but then when i call the calendar the calendar js file doesnt refresh the page when it updates the date (which is where the problem lies) so i cant use $_GET at the mo to get the new date (as it wont be the new date supplied by the calendar, it will be the old date passed in the url from the prev page)

I will try to re-code other elements of my page so i can use a page refresh and get the date using the url and $_GET.

not sure why it posted my original post again, currently i am using $_GET to get today's date (which is retreived by a js function on a prev page) but then when i call the calendar the calendar js file doesnt refresh the page when it updates the date (which is where the problem lies) so i cant use $_GET at the mo to get the new date (as it wont be the new date supplied by the calendar, it will be the old date passed in the url from the prev page)

I will try to re-code other elements of my page so i can use a page refresh and get the date using the url and $_GET.

Cheers for the help, its much appreciated!!!

Mike

It didn't repost your original post, I just quoted your post in my reply.

The only way you can update a mysql database on the server from the browser is to send a new HTTP Request. This usually means refreshing the page, but there are a few methods that allow you to do so without refreshing the page.

Either way, you'll need to get the date via JavaScript, then create a new HTTP Request to your server passing the date as a parameter in the URL. The PHP page you request will then add the date to the database.

What you have to note is that when PHP executes, it executes on the server. The HTML output is then sent to the browser.
If any change is made to the HTML on the browser (like the date change using JS), PHP does not know of it. The only way you can let PHP know it to send another HTTP request back to the PHP server.
You can however make a HTTP request to the server without reloading the page.
I noted the methods above.

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

I'm working in Excel to extract content of a table from a web page and populate Excel sheet cells with it. I'm trying to extract data from a table that gets loaded to a web page after show results method gets called. I have an error that says "Run-time error ...