this is a link using codeigniter framework ....and goToTmbd() is a function inside miscellaneous controller:
<a href="<?=base_url()?>miscellaneous/goToTmbd.html">Travelmartbd.com</a>
//this is the function
<?php
class Miscellaneous extends Controller {
function goToTmbd()
{
echo “<script>
var uri = ‘http://www.travelmartbd.com’;
window.location.href=uri;
</script>”;
}
}
?>
//i want to write this function without javascript.i want to do it through pure php
convert to php code from javascript
Moderator: General Moderators
Re: convert to php code from javascript
Redirection is done with the header function. That page has an example of how to do it.
After you do you must end the script.
After you do you must end the script.