I have a problem in a payment solution I have made. In this, I use ereg to extract a returned Transaction ID from the payment provider, and with PHP 5.3 this does not work anymore. The code used was:


I have tried to use this instead: (but it doesn't work)


Does anybody have an idea what to do?

Recommended Answers

All 5 Replies

Member Avatar

Hmm, the pattern seems to work for me.

"fsbefrb<TransactionId>Help me</TransactionId>s;bmfefb" gave 'Help me' with the pattern you supplied.

OK, thanks. So, something else must be wrong, then. Do you see anything wrong with the rest of my code for making the registry call and extracting the answer as $transactionid?:

        $ch = curl_init ();         
        $payment_url = "https://MyPaymentProvider.com";
        curl_setopt( $ch , CURLOPT_SSL_VERIFYPEER , false );
        curl_setopt( $ch , CURLOPT_SSL_VERIFYHOST , false );
        curl_setopt( $ch, CURLOPT_URL, $payment_url);
        curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);

        $resultat_3 = curl_exec ($ch);


Member Avatar
echo htmlentities($resultat_3);

Do that and then search for '<TransactionId>' with the browser's search-in-page. You won't find it. The page looked like normal html to me as opposed to xml.

So, it's the registry call at my payment provider that has stopped working then?

echo htmlentities($resultat_3);

Member Avatar

Your call.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.