Reputation: 59
I searched the other posts but non of the answers worked.
I tried to use $_REQUEST
instead of $_POST
, I tried to use if(isset($_POST['submit'])
, I checked php.ini file and globals were enabled, I was using wamp server and I swiched between version 5 and 7, I removed wamp and Installed xampp but the result was the same (the result is empty page).
My code:
<form action="inbox.php?do=submit" method="post">
<textarea name="sublinks" id="sublinks"></textarea>
<input type="submit" value = "senď" />
</form>
<?
if($_GET['do'] == 'submit')
{
echo $_POST['sublinks'];
}
?>
Edit: I tried this code and it works but I need to solve the problem Why echo $_POST
not working
<?
if($_GET['do'] == 'submit')
{
?>
<?=$_POST['links'];?>
<?
}
?>
Upvotes: 0
Views: 52
Reputation: 59
I added php
to <?
and it works now, Thanks everyone :)
<?php
if($_GET['do'] == 'submit')
{
echo $_POST['sublinks'];
}
?>
Upvotes: 1