Jump to content
php.lv forumi

php kods uz html pogām


monkeybar

Recommended Posts

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> 
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...