Welcome Guest, Not a member yet? Register   Sign In
ask about onchange and onclick php
#1

[eluser]C_Line[/eluser]
i have a problem with onchange and onclick
i wan enter a value in textbox and call the function
like this :

========================================================
<input onchange="here()" type="text"name="qty">

<?php
function here()
{
echo "hello";
}
?>
=========================================================

but, when i entered the value, here() function didn't call
please help me, and sorry my bad english Big Grin
thx
#2

[eluser]Nisha S.[/eluser]
PHP is a server side scripting language and cannot be called directly from client side. You can write a javascript with the function name and inside you can call php function by calling the relevant URL.

[removed]
function here()
{
alert("hello");
// call the url to executes the funcion. Given pattern below for codeigniter. Use ajax if you don't want to redirect to another page.
[removed] = "http://www.yourwebsite.com/controller/function";
}
[removed]
#3

[eluser]C_Line[/eluser]
this my url

localhost/ex/index.php/main/come

when i redirect using window . location
window . location = "how"

localhost/ex/index.php/main/come/how

but, i wan

localhost/ex/index.php/main/how

thx for replies
#4

[eluser]C_Line[/eluser]
SOLVED

thx for replies Nisha S Big Grin




Theme © iAndrew 2016 - Forum software by © MyBB