Jump to content

[SOLVED] Hyperlink in PHP


sanfordss

Recommended Posts

I'm not sure if this is PHP, but it's in a php script. I need to make the 'Request ID' a hyperlink. How would that work in this case?

 

}

function f_format_result($request){

 

      $html = "<div style='padding: 5px; margin-bottom: 10px; border: 2px solid #000000; width:300px;'>";

$html .= "<strong>Vehicle Information:</strong><br />";

$html .= "Make : $request[vmake]<br />";

$html .= "Year : $request[vyear]<br />";

$html .= "Model : $request[vmodel]<br />";

            $html .= "Request ID : $request[reqid]<br />";

$html .= "VIN : $request[vin]<br />";

$html .= "Mileage : $request[mileage]<br />";

$html .= "Problem Description : $request[probdescrip]";

$html .= "</div>";

return $html;

}

 

Link to comment
https://forums.phpfreaks.com/topic/149709-solved-hyperlink-in-php/
Share on other sites

just like those <br /> tags, you can add HTML to your string.

you might be getting hung up on the "quotes" though.

 

Because your PHP string is in quotes, you need to \escape\ the html quotes within that string

 

$html .= "Request ID : <a href=\"link2wherever\">$request[reqid]</a><br />";

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.