-3

this is my php code i am trying to get out put on same page but now out put is beng shown and there is no error is being shown also. can you help me enter image description here

<html>
<body>
<form action="try.php" method="POST"> 
<input type="text" name="txtname"> 
<input type="text" name="txtage"> 
<input type="submit" value="send" name="submit">
</form>

<?php 
if(isset($_POST['txtname']) && isset($_POST['txtage'])){
$text=$_POST['txtname'];
$age=$_POST['txtage']; 
echo $text; 
echo $age; 
}
 ?>
</body>
</html>
router
  • 7
  • 5
  • where it has been asked ? – router Jan 03 '16 at 20:13
  • 1
    don't go making changes to your original post http://stackoverflow.com/revisions/34581037/1 without stating that there was an edit / code change that you tried. The person who answered may get downvoted because of it, where people will tell/ask themselves: *"He's got them like that, so why the answer?"*. You MUST always mark code that you tried/changed underneath your original question/code and stating that that was what you tried. Besides, you still missed some and is why your code is still failing. – Funk Forty Niner Jan 03 '16 at 20:18
  • Oh and a blank page, usually means syntax errors, which you have. So, when learning PHP, check for those. http://php.net/manual/en/function.error-reporting.php which you're not and should. And is the grounds on which your question was closed as a duplicate. – Funk Forty Niner Jan 03 '16 at 20:24
  • 1
    I also performed a rollback to your original question/code http://stackoverflow.com/revisions/34581037/1, since you did not state your *Stealth edit* http://stackoverflow.com/revisions/34581037/2 as being what you changed given from an answer given. – Funk Forty Niner Jan 03 '16 at 20:29

1 Answers1

4

It should be $_POST and not $_post. $_POST is one of PHP's superglobals and must be in all caps. $_post will be treated as a local variable. (ref)

Patrick Lee
  • 1,990
  • 1
  • 19
  • 24