Reputation: 673
I have the following form in php:
<?php
<form action='deletepost.php' method='post'>
<input type='hidden' name='var' value='$comment_id;'>
<input type='submit' value='Delete'>
</form>
?>
when the user press the delete button goes to deletepost.php script which is the following:
<?php
$comment = mysql_real_escape_string($_POST['var']);
if(isset($comment) && !empty($comment)){
mysql_query("UPDATE `comments` SET `flag`=1 WHERE (`user`='$session_user_id' AND `comments_id`='$comment')");
header('Location: wall.php');
}
?>
I want the delete button that I have in my form to make it look a link. Any idea which is the best and easier way to do this?
Upvotes: 1
Views: 74
Reputation: 8838
Assign a class to your submit button called "btn_link".
html:
<input type='submit' value='Delete' class='btn_link'>
Then you can do with css
.btn_link
{
background:none!important;
border:none;
padding:0!important;
border-bottom:1px solid #444; /*border is optional*/
}
N.B.: See the comments below, regarding the use of !important
Upvotes: 2
Reputation: 12101
@kumar_v did it. Only for example (use real link):
<form action='deletepost.php' method='post'>
<input type='hidden' name='var' value='$comment_id;'>
<a onclick="javascript:this.parentNode.submit();">Delete</a>
</form>
Upvotes: 2