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; } Quote 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 />"; Quote 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] "; Quote 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. Quote 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!!!! Quote Link to comment https://forums.phpfreaks.com/topic/149709-solved-hyperlink-in-php/#findComment-786123 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.