sanfordss Posted March 16, 2009 Share Posted March 16, 2009 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 More sharing options...
micah1701 Posted March 16, 2009 Share Posted March 16, 2009 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 />"; Link to comment https://forums.phpfreaks.com/topic/149709-solved-hyperlink-in-php/#findComment-786117 Share on other sites More sharing options...
Maq Posted March 16, 2009 Share Posted March 16, 2009 Try changing: $html .= "Request ID : $request[reqid] "; Link to comment https://forums.phpfreaks.com/topic/149709-solved-hyperlink-in-php/#findComment-786119 Share on other sites More sharing options...
Maq Posted March 16, 2009 Share Posted March 16, 2009 Because your PHP string is in quotes, you need to \escape\ the html quotes within that string Or just use single quotes and PHP will still interpolate. Link to comment https://forums.phpfreaks.com/topic/149709-solved-hyperlink-in-php/#findComment-786120 Share on other sites More sharing options...
sanfordss Posted March 16, 2009 Author Share Posted March 16, 2009 That did it. Thanks all!!!! Link to comment https://forums.phpfreaks.com/topic/149709-solved-hyperlink-in-php/#findComment-786123 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.