I have a authentication device that on successful transaction returns only ok
. If the output is anything else but ok
, it won't work and throw error.
On successful transaction it's redirected to page cams-attendance.php
which returns the value ok
.
<?php
echo 'ok';
?>
I want to redirect the user to a another page in a new window.
I tried header, but header cannot redirect to a new window. I've tried javascript. But as it's more than ok
, I'm getting error.
<?php
echo 'ok';
?>
<script type="text/javascript" language="Javascript">window.open('http://www.example.com');</script>
using this code, the output is -
ok
<script type="text/javascript" language="Javascript">window.open('http://www.example.com');</script>
So, as it's printing more than ok, the device is throwing error.
How can I achieve this.