Langsung ke konten utama

return confirm () in php

Member Avatar

I've got a simple question: how can I make an onclick return confirm event work inside PHP tags.
  1. <HTML>
  2. <BODY>
  3. <a href="delete.php" OnClick="return confirm('blah blah');"> Click here </a>
  4. <?PHP
  5. ECHO "<a href='delete.php' OnClick='return confirm('blah blah');'> Click here </a>";
  6. ?>
  7. </BODY>
  8. </HTML>
the first link is a simple html link with an onclick event that displays a message that allows the user to confirm the link or cancel it. canceling it will stop the link from loading.
but when I ported it inside the php tags ( and changed the "" in the link code to ' ' in order for it to work with no errore. the return confirm event will not trigger and the page will load just as though there were no onclick event.
there has to be a way to make this work with php ( since it would be absurd for it not to work inside php tags ).
So please help me out with this.

Komentar

Postingan populer dari blog ini

Login, Session, dan Logout

Cara Membuat File Setup / Installer Aplikasi Sendiri dengan Inno Setup Compiler