php and javascript?
| From: | bo | Date: | Mon, 22 Jul 2002 07:45:15 +0000 |
| Subject: | php and javascript? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-20699@lists.php.net to get a copy of this message | ||
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