954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

JS Confirm in PHP

Hi, i have a php script form, and i want to use the js confirmation alert, the problem is, this

echo "";

$confirm='yes'
how can i math bouth codes?

Zill
Newbie Poster
2 posts since Nov 2005
Reputation Points: 10
Solved Threads: 0
 

JavaScript is a client-side technology and PHP is a server-side technology. This means that the JavaScript code executes on the browser and the PHP code executes on the server. You cannot have server-side code execute based upon the logic executed by the client-side code, at least, not directly.

It would seem that you are wanting to do a check for the functionality of JavaScript. Is this correct? If so, there are many ways to do this, but none of them involve PHP.

chrisbliss18
Posting Shark
917 posts since Aug 2005
Reputation Points: 38
Solved Threads: 25
 
<script type="text/javascript">
function confirmation()
{
    var yes = confirm("you want to delete record");
    if(yes)
    {
        return ture;
    }
    else
    {
        return false;
    }
}
</script>


note:-

<input type="submit" name="delete" value="delete" onclick="confirmation()" />
Ithisham
Newbie Poster
1 post since Sep 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You