0
$gateway_url = $url."?ORDERID=".$orderid."&SESSIONID=".$sessionid;

<iframe src="<?php echo $gateway_url; ?>" style="border:0px #FFFFFF none;" name="manframe" scrolling="no" frameborder="0" marginheight="0px" marginwidth="0px" height="60px" width="468px"></iframe>

Please I need help. I get this error
Parse error: syntax error, unexpected '<'

Edited by diafol: closed

7
Contributors
22
Replies
69
Views
3 Years
Discussion Span
Last Post by diafol
0
$gateway_url = $url."?ORDERID=".$orderid."&SESSIONID=".$sessionid;
?>
<iframe src="<?php echo $gateway_url; ?>" style="border:0px #FFFFFF none;" name="manframe" scrolling="no" frameborder="0" marginheight="0px" marginwidth="0px" height="60px" width="468px"></iframe>
0

Thank you, but I am still getting the same error

Parse error: syntax error, unexpected '<'

-2

Try this one,

<?php
$gateway_url = $url."?ORDERID=".$orderid."&SESSIONID=".$sessionid;

?>
<?php
<iframe src="<?php echo $gateway_url; ?>" style="border:0px #FFFFFF none;" name="manframe" scrolling="no" frameborder="0" marginheight="0px" marginwidth="0px" height="60px" width="468px"></iframe>
}
?>
0

Thank you, but I am still getting the same error

Parse error: syntax error, unexpected '<'

The problem is in the iframe syntax. When I run it, it says Parse error: syntax error, unexpected '<' in line 64 and Please find line 64 below

<iframe src="<?php echo $gateway_url; ?>" style="border:0px #FFFFFF none;" name="manframe" scrolling="no" frameborder="0" marginheight="0px" marginwidth="0px" height="60px" width="468px"></iframe>

0
<?php 


    extract($_POST);


if (isset($price)){


    $xml = "<?xml version='1.0' encoding='UTF-8'?>
            <TKKPG>
            <Request>
            <Operation>CreateOrder</Operation>
            <Language>EN</Language>
            <Order>
            <Merchant>WAYTELL</Merchant>
            <Amount>".$amt."</Amount>
            <Currency>566</Currency>
            <Description>".$prot."</Description>
            <ApproveURL>http://localhost/integration/approved.php</ApproveURL>
            <CancelURL>http://localhost/integration/declined.php</CancelURL>
            <DeclineURL>http://localhost/integration/declined.php</DeclineURL>
            </Order>
            </Request>
            </TKKPG>";

    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL,"https://196.46.20.36:5443/Exec"); 
    curl_setopt($ch, CURLOPT_SSLVERSION, 3);
    curl_setopt($ch, CURLOPT_VERBOSE, '1');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
    curl_setopt($ch, CURLOPT_TIMEOUT, 5000);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($ch, CURLOPT_CAINFO,  getcwd().'/cert/CAcert.crt');
    curl_setopt($ch, CURLOPT_SSLCERT, getcwd().'/cert/waytell.pem');
    curl_setopt($ch, CURLOPT_SSLKEY, getcwd().'/cert/waytell.key');
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
    curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);

    $response = curl_exec($ch); 

    if(!(curl_errno($ch)>0)){

        $parsedxml = simplexml_load_string($response);

        foreach($parsedxml->children() as $RESPONSENODE)
        {   
            foreach($RESPONSENODE->children() as $ORDERNODE)
            {
                foreach($ORDERNODE->children() as $child)
                {   
                    if ($child->getName() == "OrderID")
                        $orderid = $child;

                    if ($child->getName() == "SessionID")
                        $sessionid = $child;

                    if ($child->getName() == "URL")
                        $url = $child;  
                }
            }   
         }//end all loop

         $gateway_url = $url."?ORDERID=".$orderid."&SESSIONID=".$sessionid;

         <iframe src="<?php echo $gateway_url; ?>" style="border:0px #FFFFFF none;" name="manframe" scrolling="no" frameborder="0" marginheight="0px" marginwidth="0px" height="60px" width="468px"></iframe>

         header("location: ".$gateway_url);
    }

}

?>

Edited by Dani: Formatting fixed

0

line 65 is the errant <, it has html code within a php block, then opening another php block iinside a php block, then closing php

   echo "<iframe src='$gateway_url' style='border:none;' name='manframe' scrolling='no' frameborder='0' marginheight='0' marginwidth='0' height='60px' width='468px'></iframe>";

line 67 is going to give an error "headers already sent" cant redirect after output

Edited by almostbob

0

U should close php code like

?>

and place

<iframe src="<?php echo $gateway_url; ?>" style="border:0px #FFFFFF none;" name="manframe" scrolling="no" frameborder="0" marginheight="0px" marginwidth="0px" height="60px" width="468px"></iframe>

and start php code

<?php

if "headers already sent" is comming

then
u should be

?>
<script>document.location.href='<?php echo $gateway_url; ?>';</script>
<?php

Edited by Dani: Formatting fixed

0

Hi,
Thanks for your kind response, I used

echo "<iframe src='$gateway_url' style='border:none;' name='manframe' scrolling='no' frameborder='0' marginheight='0' marginwidth='0' height='60px' width='468px'></iframe>";

There was no error but the gateway was not called. Can someone help me on this.

0

Based on the code posted. I have used almostbob suggestion and the error has gone. There is no more error but the gateway that is supposed to be called did not come up. What is the next step to take. guys i did your help on this issue.

0

Personally, I think echoing out HTML is bad practice. Well it can get really confusing and most IDEs that use things to match opening and closing divs will be rendered useless.

Very rarely do I echo HTML like that. I would go with dep's suggestion.

Edited by iamthwee

0

With the issue at hand you are experiencing I think bob is right

line 67 is going to give an error "headers already sent" cant redirect after output

Why aren't you seeing any error messages? You might have PHP error messages turned off in your PHP ini file.

Dep's javascript solution would probably work. Not sure if it is frowned upon as being a viable solution and it requires javascript.

As you may know you can't really echo stuff before you call a redirect in PHP.

-1

line 57

 if ($child->getName() == "URL")
        $url = $child; 

$child is of type simplexml-element (object)
therefor so is $url
use (string) yo make it a string:

if ($child->getName() == "URL")
            $url = (string) $child; 

do the same on line 55 and 52

0

I was getting the error before:
Parse error: syntax error, unexpected '<' in line 64

when i took bob suggestion, I was not getting the error any more.

Now going by dep suggestion, How do i go about it.

0

I added as dep suggested

?>

    <iframe src="<?php echo $gateway_url; ?>" style="border:0px #FFFFFF none;" name="manframe" scrolling="no" frameborder="0" marginheight="0px" marginwidth="0px" height="60px" width="468px"></iframe>



<?php
<script>document.location.href='<?php echo $gateway_url; ?>';</script>
}
}

?>

It is given error

Parse error: syntax error, unexpected '<' in

<script>document.location.href='<?php echo $gateway_url; ?>';</script>

0

guys,
Can someone help me to rewrite the code from line 65 down.

veen suggestion appreciated. I have done it but i need to call up the gateway. How I do it?

0

Does $gateway_url has the right value now?
do a var_dump($gateway_url);

also: It makes no sens to me to open a link in an IFrame and than immediately redirect (the mainframe) to a new page.
You don't need the Iframe.

Edited by pzuurveen

0

Hi veen, can rewrite from line 65 down, what i need is to call up the gateway.

0

Hi veen, can you rewrite from line 65 down, what i need is to call up the gateway.