replace javascript function with php coding |
[eluser]ranjitbd[/eluser]
//this is the link <a HREF="<?=base_url()?>miscellaneous/goToTmbd.html">Travelmartbd.com</a> //this is the function <?php class Miscellaneous extends Controller { function goToTmbd() { echo "[removed] var uri = 'http://www.travelmartbd.com'; [removed].href=uri; [removed]"; } } ?> //i want to write this function without javascript.i want to do it through pure php
[eluser]Dam1an[/eluser]
Grrr!!! Does this not seem suspiciously similar to this? And seeing as half of it is [removed] its hard to tell what you're trying to do If all you want is a link done in PHP, just use the anchor function
[eluser]ranjitbd[/eluser]
[quote author="Dam1an" date="1251381970"]Grrr!!! Does this not seem suspiciously similar to this? And seeing as half of it is [removed] its hard to tell what you're trying to do If all you want is a link done in PHP, just use the anchor function[/quote] where its showing 1st removed.........there was script tag <script language = "javascript"> 2nd removed.........there was [removed] 3rd removed.........there was script end tag <⁄script> show how to avoid this javascript with php code
[eluser]ranjitbd[/eluser]
[quote author="ranjitbd" date="1251542323"][quote author="Dam1an" date="1251381970"]Grrr!!! Does this not seem suspiciously similar to this? And seeing as half of it is [removed] its hard to tell what you're trying to do If all you want is a link done in PHP, just use the anchor function[/quote] where its showing 1st removed.........there was script tag <script language = "javascript"> 2nd removed.........there was [removed] 3rd removed.........there was script end tag <⁄script> show how to avoid this javascript with php code[/quote] 2nd removed…......there was window·location·href so how to avoid this javascript with php code
[eluser]kgill[/eluser]
That's a roundabout way of forwarding the user to a new page, using PHP to write javascript to move to a new page. Use CI's redirect function which is just a nice wrapper to PHP's header function with the Location parameter. For future reference, you'd have gotten help quicker if you'd explained what it is your JS did instead of just posting the code and asking how to convert it. |
Welcome Guest, Not a member yet? Register Sign In |