Hi, 

Have a look at " 
<script>
        var rVal;
        window.returnValue = rVal;
        rVal= showModalDialog('test.php?op=.....','','');
        .
        .       
        .
</script>

This will pop up a user defined pop-up where the user can take action based
on what you present them. 
HTH 
Tommy

-----Original Message-----
From: Beau Lebens [mailto:[EMAIL PROTECTED]]
Sent: Mon, 22 Jul 2002 09:56
To: 'bo'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] php and javascript?


Bo,
you have really answered your own question (question 1) all you need to do
is replace http://detination with http://localhost/index.php?id=1 (as per
your examples) and it should send them to the page which triggers the
deletion of the page (if they confirm the box)

as far as q2 goes, you could send them to a page where they delete
something, and then that page actually just displays a message (on the page,
rather than a pop-up) which asks if they are sure, they click yes or no and
it does the same thing as the javascript popup. there is no way to create a
popup with PHP, so if you were considering popping a window using javascript
and then writing into it with php, you may as well just do it with the
javascript confirm() (much cooler) or with pure php (much more "robust" and
reliable).

HTH

Beau

// -----Original Message-----
// From: bo [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 22 July 2002 3:45 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] php and javascript?
// 
// 
// Hi,
// 
// Here is what I wanted to achieve, I want to get a 
// confirmation box pop up
// when user click on the delete link of the webpage(displays 
// the contents got
// from mysql database). I know we can do it in javascript 
// easily, but my
// question is:
// 1st,
// a common javascript confirmation will be like this:
// <SCRIPT language="JavaScript">
// <!--
// function go_there()
// {
// var where_to= confirm("Do you really want to go to this page??");
// if (where_to== true)
// {
// window.location="http://detination";;
// }
// else
// {
// window.location="http://original";;
// }
// }
// //-->
// </SCRIPT>
// <A HREF="javascript:go_there()">New Page</A>
// 
// my question is how to integrate the javascript with php, the 
// sample delete
// link will be something like: http://localhost/index.php?id=1 
// ,and the id
// number(in this case:1) is from database: (<a
// href=delete.php?".$row["id"].">)
// 
// 2nd is there a better way to write pure php code to get a 
// confirm window pop
// up once i clicked on delete link?
// 
// Thanks and Good day.
// 
// Bo
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to