I am developing a small php page.
When I click a submit button no takes any action, just forwards me to a blank page. Why does this happen?
Will can help me please?
Thank you all very much.
<?php
if(isset($_POST['update']))
{
$dbhost = '****';
$dbuser = '****';
$dbpass = '****';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn )
{
die('Could not connect: ' . mysql\_error());
}
$task = $_POST['task'];
$sql = "UPDATE tasks set idTask = '$task' , date = curdate(), hour = curtime(), status = '3' WHERE idTask = '$task'" ;
mysql_select_db('db_Tasks');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not update data: ' . mysql_error());
}
echo "Task $task started \n";
mysql_close($conn);
}
<form method="post" action="<?php $_PHP_SELF ?> ">
<table width="285px" border="0" cellspacing="1" cellpadding="2" style="background-color:#A4A4A4;">
<tr>
<td width="100">Task</td>
<td><input name="tarefa" type="text" id="tarefa"></td>
</tr>
<td>
<input name="update" type="submit" id="update" value="Start">
When I click a submit button no takes any action, just forwards me to a blank page. Why does this happen?