Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Embed window.confirm() into PHP

    Hi

    I would like to embed a confirm into my php....
    PHP Code:
    echo ('td><a href="delete.php?id='$custid .'" onClick="return window.confirm('Are you sure you want to delete this record?')">Delete</a></td>'); 
    i get parse errors - what is the correct syntax to allow this confirm to work?

    Thanks

  • #2
    Regular Coder
    Join Date
    Jul 2003
    Location
    Massachusetts
    Posts
    472
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    echo '<td><a href="delete.php?id='. $custid .'" onclick="return confirm(\\'Are you sure you want to delete this record?\\')">Delete</a></td>';
    Last edited by fredmv; 12-23-2003 at 12:47 PM.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Cheers - works a treat! many thanks!

  • #4
    Regular Coder
    Join Date
    Jul 2003
    Location
    Massachusetts
    Posts
    472
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You're quite welcome.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •