Hello everyone,
I have tried to search the boards as well as the net, but I can't seem to find help on my particular issue.
Basically what I am trying to do is use variables from php in a javascript confirmation script.
This is for when a user clicks 'delete' a confirmation box appears and by clicking yes sends the data from the variables to a query string in another page.
I have the confirmation working without a problem, however when attempting to include the variables it sends the actual text of the variable, rather than the value itself.
It evidentally isn't seeing the values.
I have placed it everywhere I can think of within and out of the php statement.
I can't seem to get it right. Not even sure if you can pass php/mysql data to JS.
The Java script code I am using is the following:
<SCRIPT language="JavaScript">
<!--
function confirm()
{
var where_to= confirm("Do you really want to delete this entry?");
if (where_to== true)
{
window.location="edit.php?requestid=$requestid&servreq=$servreq";
}
else
{
}
}
//-->
</SCRIPT>
And my link is:
<a href= "#" onClick="confirm()">go</a>
I have tried placing the script within the PHP AFTER it pulls the data from the DB and it still won't work.
Can anyone help?
Thanks