0

I have the following curl request

$url='http://test/paynetz/epi/fts?login=160&pass=Test@123&ttype=NBFundTransfer&prodid=NSE&amt=50&txncurr=INR&txnscamt=0&clientcode=TkFWSU4%3d&txnid='.urlencode($string).'&date='.urlencode($date).'&custacc=1234567890&udf1=ajeesh&[email protected]&udf3=940000000&udf4=arrackaparmabilhouse&ru=http://www.zwitch.co';
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_HEADER, 0);
        curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, false);  
        echo $auth = curl_exec($curl);

Im getting this

http://test/paynetz/epi/ftsNBFundTransfer267050dHwIMJR%2FucGOZcnocTnwvISAVaeNZK93Y8veI%2Bb1DtY%3D11

Instead of an xml.Im getting the values only not the xml.

I had 505 error inthe response,so I used urlencode($string) instead of $string

5
  • Two thoughts: 1) what URL are you trying to request? http://test/... is not likely to succeed unless you have a server named test on your network; and 2) are you really trying to request a funds transfer via a CURL request? I can't imagine any bank (or really any company that wants to protect its money) permitting this. Commented Apr 28, 2014 at 17:53
  • Thats test I have given for posting here Commented Apr 28, 2014 at 17:54
  • @Kryten You may not guess things out of no where with each and every wording in the question Commented Apr 28, 2014 at 17:56
  • Regarding the use of test in your URL - you should mention that in your question, so we know that's not the problem. Regarding your other comment, I don't know what you're doing (nor do I much care). I'm merely pointing out that it looks like you're trying to make a CURL request to a bank/financial institution website to transfer funds. If that's what you're doing, then it is likely to fail because banks take security very seriously. Commented Apr 28, 2014 at 18:06
  • @Kryten I got it working btw.No thanks :P Commented Apr 28, 2014 at 18:17

1 Answer 1

1

Have you tried adding curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)'); This will confirm that you are a human rather than a bot.

If you are trying to output the XML directly onto a web page, you'll might want to lookup htmlentities().

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks :) There are people who do know things really well :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.