Ask about general coding issues or problems here.
Moderators: macek, egami, gesf
by immalashari » Thu Oct 25, 2012 8:58 pm
i am new in PHP. i write a short segment and i want to show output on the same page but when i press submit button it shows nothing. code is:
<html>
<body>
<h1 align=center> test</h1>
<form method="post" action="phptest.php">
<input type="text" name="value1" />
<input type= "text" name="value2" / >
<input type="submit" value="submit" >
</form>
<?php
if(isset($_post['submit'])){
$value1=$_post['value1'];
$value1=$_post['value2'];
echo $_post["value1"];
echo $_post["value2"];
}
?>
</body>
</html>
-
immalashari
- New php-forum User

-
- Posts: 1
- Joined: Wed Oct 17, 2012 1:12 am
by simplypixie » Thu Oct 25, 2012 10:43 pm
post has to be in upper case, so your code should be:
- Code: Select all
if(isset($_POST['submit'])){
$value1=$_POST['value1'];
$value2=$_POST['value2'];
echo $value1;
echo $value2;
}
-

simplypixie
- php-forum Active User

-
- Posts: 289
- Joined: Sun Dec 11, 2011 12:51 am
- Location: Shrewsbury, Shropshire
-
Return to PHP coding => General
Who is online
Users browsing this forum: Google [Bot] and 4 guests