monkeybar Posted August 24, 2014 Report Share Posted August 24, 2014 Sveiki! Meģinu apgūt programmēšanu un kaut ko būvēju. Vēlos pievienot pāris pogas zem kurām darbosies php. Var uztaisīt lai lapa nepārlādējas un saglabājas abi rezultāti? Man nepielec, kā darīt, lai lapa nepārlādējas. <?php function doShite(){ return "Doing shite."; } if(isset($_POST['test'])) { echo "it works"; } if(isset($_POST['run_function'])) { echo doShite(); } ?> <!doctype html> <html> <head> </head> <body> <form action="<?=$_SERVER['PHP_SELF'];?>" method="post"> <input type="submit" name="test" value="Click Me"> <input type="submit" name="run_function" value="Run function"> </form> </body> </html> Quote Link to comment Share on other sites More sharing options...
jurchiks Posted August 24, 2014 Report Share Posted August 24, 2014 AJAX to the rescue. Nāksies mācīties arī javascript. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.