I am trying to pass a variable (in this case an IP variable of the user) into a url so when it is displayed on the web it is an automatic link. Below is the code I have and I’m getting an error. Seeking PHP Guru to help a n00b.
$user_tracking_vars = "<br /><br /><strong>Browser and Operating System:</strong> ".$browser."<br /><br /><strong>IP:</strong> <a href=""http://urbangiraffe.com/map/?ip=".$ip."&from=drainhole"">".$ip."</a><br /><br /><strong>Page Visited Before Contact Form:</strong> ".$referred."<br />";
It looks like you’re incorrectly escaping your quotes using Basic-like (
href=""..."") syntax. The escape character in PHP is backslash (href=\"...\").You can also alternate the quotes used to achieve the same effect (
href='...'):