| | |
PHP and Javascript working together?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2007
Posts: 19
Reputation:
Solved Threads: 0
Hello everybody,
I am wanting to use a javascript confirm popup (OK returns TRUE/Cancel returns FALSE) to determine whether I need to run part of my PHP code.
I could only think of one way to try, and this is it:
But... since Javascript is client-side I know this might not be possible, so my question is, CAN I do this? And how?
I am wanting to use a javascript confirm popup (OK returns TRUE/Cancel returns FALSE) to determine whether I need to run part of my PHP code.
I could only think of one way to try, and this is it:
PHP Syntax (Toggle Plain Text)
echo "<script type=\"javascript\"> var popbox = confirm(\"Are you sure you want to delete " . $x . " entries?\"); if(popbox){"; php_code(); echo "} </script>";
Last edited by mbacon; Jan 24th, 2007 at 4:03 pm. Reason: Fixing broken php code
It's called Ajax.
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!
![]() |
Similar Threads
- how can i make php alert pop ups just like in javascript. (PHP)
- how to access accessing PHP variable in JavaScript (PHP)
- How to call a PHP function from Javascript and return the results back into Javascrip (PHP)
- Javascript links not working (Web Browsers)
- my php session_destroy() function not working (PHP)
- embPerl or PHP (Perl)
Other Threads in the PHP Forum
- Previous Thread: Best PHP script site?
- Next Thread: watermark png no resize
| Thread Tools | Search this Thread |
.htaccess ajax apache api array beginner binary broken buttons cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail mediawiki menu mlm mod_rewrite multiple mysql number oop paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search server sessions sms soap source sp space speed sql subdomain syntax system table tag tutorial update upload url validation validator variable vbulletin video web websphere white xml youtube






