convert to php code from javascript

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ranjitbd
Forum Newbie
Posts: 24
Joined: Sun May 03, 2009 1:59 pm

convert to php code from javascript

Post by ranjitbd »

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
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: convert to php code from javascript

Post by requinix »

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.
Post Reply