Hello,
I hope this is the right place for my question. I am new to php, having spent more than a decade writing in vbscript for asp pages, and I am stumped by this problem. I have searched both of my PHP manuals, the net and forums galore but cannot find the answer.
I am trying to display records from mysql with a button to delete each record in the display. However, when I press the button, the information does not get through to the manipulation page.
In the first page my relevant code is:
<form action="<?=$_SERVER[ 'PHP_SELF' ] ?>" method="post"> <input type="hidden" name="ident" value="<? echo $row[0];?>">
<input type="submit" value="Delete"></form>
$row [0] is the auto incrementing ID field and in this instance I have checked that it contains a value, which is the integer 3.
Now when I get to the next page, which is supposed to delete the record, I do not get any errors, but nothing happens, so I wrote the following code to check that the information had been passed through.
<?php
$id = (INT)$_post['ident'];
echo 'Form input= ', $_post['ident'], '<br>';
echo '$id= ', $id, '<br>';
This produces
input=
$id= 0
when it should produce
input = 3
$id= 3
Once I can get the production of an integer in the $id variable I will be able to delete the record from the database.
Can anyone tell me what I have done wrong please?
Many thanks in advance.