Can't Get The $_post Variable
Solution 2:
Try if the value existAlbum get set, because it won't return any value if you there is nothing picked. You could give the existAlbum picker a default='1' or something:
ifisset($_POST['existAlbum']){
echo'yes';
}
else{
echo'no';
}
I think that there is something wrong with the rule enctype="multipart/form-data". Try to just remove this, it should be set automatically by your browser.
Solution 3:
You have no value for the option select album, even if you don't intend that option to be used give it a value such as 0 so that it will always be set in the POST variables.
<option value="0">SELECT ALBUM</option>
<option value="some album">Some Album</option>
...
Solution 4:
If select is not picked you will not get it at all (you expect it to be empty, which is not true). You have to check first
$exist_album = isset($_POST['existAlbum']) ? $_POST['existAlbum'] : '<DEFAULT VALUE>';
and same for checkbox.
The newAlbum
thing should work as text inputs are always there. See
print_r($_POST);
to see what's really in there, and in my case it is - on "empty" submit I get:
Array
(
[existAlbum] => SELECT ALBUM
[newAlbum] =>
)
BTW: you should use <?php
rather than <?PHP
.
Solution 5:
print $_POST Array using print_r($_POST);
Make sure your form action is correct
<form action="upload.php" method="post"id="uploadform" name="uploadform" enctype="multipart/form-data">
Post a Comment for "Can't Get The $_post Variable"