Mohammad Alipour Mohammad Alipour - 1 year ago 84
HTML Question

Bootstrap form does not send file name

I have wrote a form in bannervipsites.php :

<form role="form" action="index.php" method ="post">
<div class="form-group">
<label>نام بنر :</label>
<input class="form-control" name="sname" placeholder="نام فارسی یا لاتین بنر">
<div class="form-group">
<label>URL : </label>
<input class="form-control" name="surl" placeholder="http://">
<div class="form-group">
<label>Upload banner :</label>
<input type="file" name='upfile' id='upfile' class="filestyle" data-buttonName="btn-primary" data-buttonBefore="true" data-icon="false" >
<input type='hidden' name='bform' value='file'>
<input type='hidden' name='MAX_FILE_SIZE' value='100720'>
if ($acctype != 1) {
<div class="form-group">
<label>حداکثر بازدید در ساعت : (عدد 0 یعنی نامحدود)</label>
<input class="form-control" name="scph" placeholder="سقف بازدید در ساعت از چه عددی فراتر نرود؟">
<div class="form-group">
<label>روی مربع کلیک کنید : </label>
<div class="g-recaptcha"></div>
<input type="hidden" name="fform" value="bannervip">
<input type="hidden" name="sid" value="0">
<input id="submit" name="submit" value="اضافه کردن" class="btn btn-success" type="submit">
<button type="button" class="btn btn-default" data-dismiss="modal">بستن</button>

and then post it to index.php
but upfile (the name of uploaded file) does not send.
I can not get

echo $_FILES['upfile']['tmp_name'];

in index.php
what is the problem? it's very odd for me.
it was working in last template .(index.php is ok i'm sure)
what is wrong with bootstrap form

Answer Source


enctype= "multipart/form-data"

to your form.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download