0v3k Shi3ld3r 0v3k Shi3ld3r - 1 year ago 69
SQL Question

Text inserted into table Cell , A clickable URL link?

Text inserted into table Cell , A clickable URL link ?

I have a table that that holds three values FROM , MESSAGE , DATE-TIME

The message cell is in the following format

echo '<table class="table table-fixed table-bordered table-hover">';

echo "<tr><th>From</th><th>Message</th><th>Time-Date</th></tr><tr>";

echo $row['message'];

echo "</td><td>";

AS shown below I have made the cell FROM a clickable link

echo "<tr><td>";
echo "<a href=message.php?id=".$senerid.">Reply to : </a>";
echo $row['username']; // username of sender
echo "</td><td>";

Which allows the users that views to click the link, However I want the link to be clickable that is send as part of the message like below example

enter image description here

Im sending the message as automated response to a friend request

$link = "http://accept.php";
echo '<a href="' . $link . '">Accept</a>';

$message = "you have a new friend request ".$link." Accept" ;
$sqll = mysqli_query($con,"INSERT INTO `inbox` (`message` , `username` , `userid` , `rcpuser`, `senderid`, `time` ) VALUES ('".$message."', '".$_COOKIE[$cookie_name]."', '".$me."','".$q."','".$me."' , now() )");

How can this be made possible please ?
Thanks in advance.

Answer Source

Store <a> tag in a variable like below and append that variable into message, see below:

$clickable_link = '<a href="' . $link . '">Accept</a>'

$message = "you have a new friend request ".$clickable_link;

Edit: While sending an email you might require to set headers.

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download