Jump to content

Call PHP function in <a>


Grego

Recommended Posts

Try this...

 

<?php

$id = $_POST['id'];

 

$delete = mysql_query("DELETE FROM `projects` WHERE id='$id'")

or die(mysql_error());

 

header('Location: http://somesite.com/project.php');

 

 

 

 

<a href="main.php?id=<?=$row['id']?>" onclick="alert('Do you want to delete')">Delete</a>

 

?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/56587-call-php-function-in/#findComment-279998
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.