Jump to content

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 />";

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.