Reputation: 888
I have what should be a simple form to pass data to a php page. The form is:
<form action="php/setlist.php" method="post">
<input type="text" id="SetListName" />
<input type="hidden" id="newList" name="newList" value="" readonly="readonly" style="border: none;">
<input type="submit" style="width:150px;"><br /><br />
and the php is:
$SetListSave = $_REQUEST['newList'];
$SetListName= $_REQUEST['SetListName'];
echo $SetListName;
echo $SetListSave;
I am getting the newList from the form just fine but the SetListName isn't getting passed. I am a novice with php so I could be missing something basic here, but I am stumped.
Upvotes: 2
Views: 2789
Reputation: 3785
use
<input type="text" id="SetListName" name="SetListName" />
you have not used name
attribute
Upvotes: 0
Reputation: 6375
You need to have a 'name' attribute in the form for each input field that you want to read in PHP. So you're code should read:
<form action="php/setlist.php" method="post">
<input type="text" id="SetListName" name="SetListName"/>
<input type="hidden" id="newList" name="newList" value="" readonly="readonly" style="border: none;">
<input type="submit" style="width:150px;"><br /><br />
Upvotes: 0
Reputation: 4075
Replace
<input type="text" id="SetListName" />
with
<input type="text" id="SetListName" name ="SetListName"/>
Upvotes: 0
Reputation: 455440
You are missing name
attribute in:
<input type="text" id="SetListName" />
Upvotes: 7