Welcome Guest, Not a member yet? Register   Sign In
replace javascript function with php coding
#1

[eluser]ranjitbd[/eluser]
//this is the link
<a HREF="&lt;?=base_url()?&gt;miscellaneous/goToTmbd.html">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 pure php
#2

[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
#3

[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 &lt;script language = "javascript"&gt;
2nd removed.........there was [removed]
3rd removed.........there was script end tag &lt;&frasl;script&gt;


show how to avoid this javascript with php code
#4

[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 &lt;script language = "javascript"&gt;
2nd removed.........there was [removed]
3rd removed.........there was script end tag &lt;&frasl;script&gt;


show how to avoid this javascript with php code[/quote]

2nd removed…......there was window&middot;location&middot;href
so how to avoid this javascript with php code
#5

[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.




Theme © iAndrew 2016 - Forum software by © MyBB