garima wrote:
hi all,
i had call a function in javascript by which it shows the value of
previous page on the new one and store all the values in htmlOutput.
now i want that this value should be sent to database by using php,but
how can i do so.
thanks
Hi,
One staright solution:
You could just make a hidden frame, and post inside there.
something like:
var myData = "name=John&age=23";
var newlocation = "myDBInsertScript.php";
newlocation += "?" + myData ;
parent.frames.myhiddenframe.location=newlocation ;
In PHP you retrieve the variables with $_GET["name"];
Alternatively you could use a form, but that is little more work.
If using a form you have to construct the form in html and autopost it.
beware of:
1) urlencoding your data
2) security: Maybe you need some authentication before inserting into the
database. (cookie with PHPSESSID for example)
Good luck!
Regards,
Erwin Moller