thescientist Posted April 1, 2011 Share Posted April 1, 2011 so I'm trying to get some page's to validate, and there a couple of URL's being generated (from some API's I'm using on the site) that are throwing some validation errors.for example, for the Etsy API, this is a url that I'm getting back which is a link to one of my clients listings on the site. http://www.etsy.com/listing/64163842/whispy-fumed-wine-stopper?utm_source=sandandfire&utm_medium=api&utm_campaign=api and this is the kind of error's I'm getting Line 36, column 155: general entity "utm_medium" not defined and no default entityLine 36, column 165: reference to entity "utm_medium" for which no system identifier could be generatednow this all being output with PHP, and so I tried urlencoding the URL on the server side which resolved the validation errors, but it turns my URL's into this, which break in the browser when clicked on.http%3A%2F%2Fwww.etsy.com%2Flisting%2F64163842%2Fwhispy-fumed-wine-stopper%3Futm_source%3Dsandandfire%26utm_medium%3Dapi%26utm_campaign%3Dapi for some reason in the view source it looks like that ^, but when I click on it, it pre-pends my localhost address to the URL, like so http://localhost:8888/sandandfire/http%3A%2F%2Fwww.etsy.com%2Flisting%2F64163842%2Fwhispy-fumed-wine-stopper%3Futm_source%3Dsandandfire%26utm_medium%3Dapi%26utm_campaign%3Dapi any thoughts? Link to comment Share on other sites More sharing options...
trevelluk Posted April 1, 2011 Share Posted April 1, 2011 Even inside a link URL then ampersands need to be escaped as &The htmlspecialchars() function is probably what you need. Link to comment Share on other sites More sharing options...
thescientist Posted April 1, 2011 Author Share Posted April 1, 2011 Even inside a link URL then ampersands need to be escaped as &The htmlspecialchars() function is probably what you need.yeah, that's why I tried urlencoding. I'll give htmlspecialchars() a shot, that sounds like what I might need to you use instead. thanks for your time and feedback! Link to comment Share on other sites More sharing options...
thescientist Posted April 2, 2011 Author Share Posted April 2, 2011 Even inside a link URL then ampersands need to be escaped as &The htmlspecialchars() function is probably what you need.awesome thanks! htmlspecialchars() was it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.