Reputation: 182
Im trying to submit a form, and i have done this so many times before i and i do not understand why this single form does not want to work, my other forms do work perfectly, but i have no idea why this particuler form does not want to.
I have tried running a: print_r($_POST); print_r($_FILES); but this is all i get: Array ( ) Array ( )
<form name="myForm" action="" enctype="multipart/form-data" method="post">
<div class="id-input">ID:</div>
<label class="input2 red bold">
<?php if(isset($sli_u_id)) echo($sli_u_id);?>
</label>
<input class="input" name="sli_title" value="<?php if(isset($sli_u_title)) echo($sli_u_title);?>" placeholder="Title">
<div class="button-area">
<input class="btn-upload" type="file" name="sli_img">
<div class="btn-upload-true">Vælg fil</div>
<div id="file_name">img/sliders/<?php if(isset($sli_u_img)) echo($sli_u_img);?></div>
</div>
<input class="btn" name="sli_submit" type="submit" value="<?php if ($mode == 'update') echo 'Opdater'; elseif ($mode == 'insert') echo 'Opret'; ?>">
<a href="panel.php?page=sliderimage.php">
<button class="danger-btn" type="button" href="">Annuller</button>
</a>
<input type="hidden" name="sli_id" value="<?php if(isset($sli_u_id)) echo($sli_u_id);?>">
</form>
Both pages:
Upvotes: 0
Views: 44
Reputation: 182
Hello Athax your problem appear to be a header('location: ..8'); and a die(); you used, you don't need it since you are on the same page, you included your file.
Upvotes: 0
Reputation: 40038
This may sound pedantic, but have you done it?
Break the problem into pieces and find out exactly where the problem is.
Begin with only one element in the form. Submit it, and see what happens. If it doesn't work, fix it - then add one more element. No more than that.
Then add the next element -- until you find / fix all the problems.
It may sound like a lot of work, but you've been working on this for an hour. By the above method, you should find the solution in less than 15 mins.
Upvotes: 1