•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 426,187 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,827 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 6229 | Replies: 8
![]() |
•
•
Join Date: Feb 2007
Posts: 15
Reputation:
Rep Power: 2
Solved Threads: 0
Hello..
I am designing a page in which if i click "call" button the button gets disabled and the timer starts.. This code is in JavaScript..(coz I couldn't write the PHP code to start timer on a button click)
Now.. I need to pass the time of the "call" button click to the DataBase along the other fields of the database...
How this is done??
I am designing a page in which if i click "call" button the button gets disabled and the timer starts.. This code is in JavaScript..(coz I couldn't write the PHP code to start timer on a button click)
Now.. I need to pass the time of the "call" button click to the DataBase along the other fields of the database...
How this is done??
•
•
Join Date: May 2006
Location: New Jersey
Posts: 1,422
Reputation:
Rep Power: 5
Solved Threads: 34
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
The only possible way to do this with PHP and Javascript is to have the javascript to refresh the page, best way is with a hidden form, than have PHP detect the form submition and than execute the script to add info to the database.
Ajax as mentioned before is another option.
PHP is a server side script and is processed by the server, the client browser never sees the PHP. Javascript is processed by the client browser. Therefor javascript cannot call PHP functions.
Ajax as mentioned before is another option.
PHP is a server side script and is processed by the server, the client browser never sees the PHP. Javascript is processed by the client browser. Therefor javascript cannot call PHP functions.
•
•
Join Date: Oct 2006
Location: Sofia, Bulgaria
Posts: 135
Reputation:
Rep Power: 2
Solved Threads: 7
•
•
•
•
The only possible way to do this with PHP and Javascript is to have the javascript to refresh the page, best way is with a hidden form, than have PHP detect the form submition and than execute the script to add info to the database.
The other way is to use GET method to call the php script, where the start time value is passed as a get variable.
e.g. yoursite/php_script_name.php?start_time=time.from.js
This should be captured on the other side by the php with $_GET['time.from.js'];
Of course though, Ajax is best sollution for your problem.
Last edited by Rhyan : Feb 16th, 2007 at 4:08 am. Reason: url gets shortened when displayed
•
•
Join Date: Apr 2007
Posts: 11
Reputation:
Rep Power: 2
Solved Threads: 1
Last edited by stymiee : Sep 12th, 2007 at 10:16 am. Reason: email addess removed
•
•
Join Date: Oct 2006
Location: Sofia, Bulgaria
Posts: 135
Reputation:
Rep Power: 2
Solved Threads: 7
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
access activation api blog blogger blogging blogs code combo competition dani daniweb data debugging development dreamweaver dropdownlist firefox gdata gentoo google gpl html innovation javascript key linux microsoft module net news openbsd php product programming reuse rss security serial source spam tags vista web wysiwyg xml
- Problem with javascript variable and hidden input (ASP.NET)
- javascript variable in jsp session (JSP)
- Passing a Javascript variable to a PHP using <script> call (JavaScript / DHTML / AJAX)
- How Can I Pass A PHP Variable From One .php page to another (PHP)
Other Threads in the PHP Forum
- Previous Thread: Need Help Please!
- Next Thread: Using the Next And Previous Buttion



Linear Mode