By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

how to get value from a function in database

P: n/a
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

Sep 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
Sep 19 '05 #2

P: n/a

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


Seems like you need to be asking that question in the php newsgroup
then.

Sep 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.