...

View Full Version : Help with php syntax



levani
03-08-2009, 03:13 PM
Hello

I have this php code:


$link = "<a href='" . wp_nonce_url( get_bloginfo('url') . "/wp-admin/post.php?action=delete&amp;post=" . $post->ID, 'delete-post_' . $post->ID) . "'>".$link."</a>";

and want to add this code after a href:

onclick="return confirm('Are you sure you want to delete?')

but no success, everytime I try to do this I get some syntax error.

Please help.
Thanks

abduraooft
03-08-2009, 03:33 PM
Try

$link = "<a href='" . wp_nonce_url( get_bloginfo('url') . "/wp-admin/post.php?action=delete&amp;post=" . $post->ID, 'delete-post_' . $post->ID) . "'
onclick=\"return confirm('Are you sure you want to delete?');\">".$link."</a>";

levani
03-08-2009, 07:17 PM
Thank you very much. It works :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum