CodeIgniter Forums
convert javascript code to php - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: convert javascript code to php (/thread-22164.html)



convert javascript code to php - El Forum - 08-31-2009

[eluser]ranjitbd[/eluser]
//this is the link
Code:
<a href="&lt;?=base_url()?&gt;">Travelmartbd.com</a>

//this is the function

&lt;?php
class Miscellaneous extends Controller {

  function goToTmbd()
  {
      echo “[removed]
                var uri = ‘http://www.travelmartbd.com’;
                [removed].href=uri;
            [removed]”;
  }
}
?&gt;

//i want to write this function without javascript.i want to do it through raw php
within goToTmbd() method.



convert javascript code to php - El Forum - 08-31-2009

[eluser]ranjitbd[/eluser]
Code:
//this is the link

<a href="&lt;?=base_url()?&gt;">Travelmartbd.com</a>

//this is the function

&lt;?php
class Miscellaneous extends Controller {

  function goToTmbd()
  {
      echo “[removed]                       // here the code was [removed]
                var uri = ‘http://www.travelmartbd.com’;
                [removed].href=uri; // here the code was [removed]
            [removed]”;                   // here the code was [removed]  
  }
}
?&gt;

//i want to write this function without javascript.i want to do it through raw php
within goToTmbd() method.



convert javascript code to php - El Forum - 08-31-2009

[eluser]ranjitbd[/eluser]
Code:
//this is the link

<a href="&lt;?=base_url()?&gt;">Travelmartbd.com</a>

//this is the function

&lt;?php
class Miscellaneous extends Controller {

  function goToTmbd()
  {
      echo “[removed]               // here the code was script tag
                var uri = ‘http://www.travelmartbd.com’;
                [removed].href=uri; // here the code was window&middot;location
            [removed]”;             // here the code was end of script tag  
  }
}
?&gt;

//i want to write this function without javascript.i want to do it through raw php
within goToTmbd() method.