$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 '<'

Recommended Answers

All 22 Replies

$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>

Thank you, but I am still getting the same error

Parse error: syntax error, unexpected '<'

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>
}
?>

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>

Can show the whole codes? if you dont mind thnx

<?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);
    }

}

?>

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

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

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.

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.

Member Avatar for iamthwee

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.

Member Avatar for iamthwee

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.

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

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.

dep can you add the segment you suggested on the code.

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>

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?

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.

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

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

Hi, guys help me out on this,

Be a part of the DaniWeb community

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