I'm having difficulties on the executing a php function with a button
I've been browsing through the net (and ofcourse here at stackoverflow) for a solution to this problem. However, still no luck. This problem might have been asked many times in this site, but none of them seems to work to me (or am i just that poorly literate with programming).
What i am trying to achieve is to set a session variable once the button is clicked, and print it in the second page as it redirect.
here's what my first php page looks like:
<?php
session_start();
if(isset($_POST['submit']))
{
$_SESSION['testing']= "hello world";
}
?>
<form method="post" action="update.php">
<input type="submit" id="submit" name="sumbit" value="Submit" >
</form>
and here's the update.php:
<?php
session_start();
echo $_SESSION['testing'];
?>
It may look theres nothing wrong with it, but the script does not execute anything inside the "if(isset(..." statement.
I am using WAMP as a server and my PHP version is 5.3.13
PS: I am aware that PHP is a server-side programming, and what i'm trying to do is something similar to client-side scripting.
The problem is, i do not know how to work with javascripting and what they call it "Ajax" scripting.
Is there any way this could be fix? Is it possible to do this with PHP alone without using javascript or ajax?