Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
use of confirm : need interaction between javascript and php
Old 04-14-2006, 12:21 PM use of confirm : need interaction between javascript and php
Novice Talker

Posts: 5
Trades: 0
<?php
...
$ok = 0

echo '<script language="JavaScript">';
echo'confirm("Voulez vous vraiment supprimer cet enregistrement!");';
echo'if(confirm)';
echo'<?php $ok = 1; ?>';
echo '</script>';
if ($ok == 0)
exit;
...
?>
iHoss is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-14-2006, 12:24 PM Re: use of confirm : need interaction between javascript and php
Novice Talker

Posts: 5
Trades: 0
If s.o. knows what's php's exit in javascript, it also can be too helpfull.
Thanks Anyway
iHoss is offline
Reply With Quote
View Public Profile
 
Old 04-14-2006, 10:37 PM Re: use of confirm : need interaction between javascript and php
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
You cannot mix PHP and JS like that, they are two different technologies run at two different times. JS is run on the client, and PHP is run on the server so they can't directly interact with eachother.

You'll have to make a new page with an HTML link that passes the data through the query string (or something similar), for example:
Code:
Voulez vous vraiment supprimer cet enregistrement!
<a href="thispage.php?ok=1">OK</a>
<a href="thispage.php?ok=0">Cancel</a>
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to use of confirm : need interaction between javascript and php
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12793 seconds with 12 queries