# Php cross domain needs to handle xml from query string

**URL:** <https://forum.kirupa.com/t/php-cross-domain-needs-to-handle-xml-from-query-string/323200>\
**Category:** Uncategorized\
**Created:** [June 20, 2011, 11:27pm UTC](https://forum.kirupa.com/t/php-cross-domain-needs-to-handle-xml-from-query-string/323200 "2011-06-20T23:27:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![neild](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/neild/32/1265_2.png) [@neild](https://forum.kirupa.com/u/neild)\
**Post date:** [June 20, 2011, 11:27pm UTC](https://forum.kirupa.com/t/php-cross-domain-needs-to-handle-xml-from-query-string/323200/1 "2011-06-20T23:27:01Z")

</div>

Hello,

I am looking for assistance in solving this issue:

I have some Frankenstein php I’m trying to work with:  
\<?php  
// Set your return content type  
header(‘Content-type: application/xml’);

// Website url to open  
$daurl = $\_GET[“url”];  
$special=htmlspecialchars($daurl);  
$trimmed = stripslashes($special);

echo file\_get\_contents($trimmed);  
?\>

the problem is that the url I need to call has xml in it:  
http:domain/page.svc/page?xmlRequest=\<param1=“1” param2=“2” /\>

I was able to ‘chop’ the querystring to the point I could echo the string and it looked correct (initially it was cut off at the \<)

but making the call - it still fails as if the string is still malformed (it just hangs).

if I call a service that has no xml - http:domain/page.svc/page it returns the xml just fine.

Has anyone ever had to call a service with xml in the GET request?  
Am I going about this all wrong?

Thanks in advance!
