![]() |
replace javascript function with php coding - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: replace javascript function with php coding (/showthread.php?tid=22026) |
replace javascript function with php coding - El Forum - 08-27-2009 [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 replace javascript function with php coding - El Forum - 08-27-2009 [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 replace javascript function with php coding - El Forum - 08-28-2009 [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 replace javascript function with php coding - El Forum - 08-28-2009 [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 replace javascript function with php coding - El Forum - 08-29-2009 [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. |