Jump to content

HBen

Members
  • Posts

    11
  • Joined

  • Last visited

HBen's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. HBen

    FileSize from DB

    i didn't think of that ,i was focusing that there are a function to do that . thanks Ingolme
  2. HBen

    FileSize from DB

    lol i made a mistake in "348160 bytes instead of 340 KB" , so any idea how can i get the size in kb !
  3. HBen

    FileSize from DB

    Hello guys , i hope everyone is doing great ! So i was trying to get a file size from the file i uploaded to the BD , i succeded to get it using $filesize=$_FILES['uploadMedia']['size']; but the problem was that i got the size in form of bits 348160 bits instead of 340 KB is there any way to convert the bits to kb and Mb ?? i tried this function filesize($filename) but no luck Thank you Guys
  4. Thank you Ingolme , I figured it out Thanks a lot man
  5. I didn't get the error this time , but nothing were written on the database
  6. This is The Line 23 if(move_uploaded_file($_FILES['upload']['tmp_name'],$path)) {
  7. Hello Guys , I need Help In Upload Form i got this Error Warning: move_uploaded_file(): Unable to move 'C:xampptmpphpE53F.tmpto'C:/xampp/htdocs/admin/uploads/imagename.jpg'inC:xampphtdocsFinaladminadd_app.php on line23 This is The Source Code if (isset($_SESSION['logged_in'])) { if (isset($_POST['doUpload'])) { $title = $_POST['title']; $descrip = nl2br($_POST['descrip']); if (empty($title) or empty($descrip)) { $error = ' All fields are required ! '; } else{ $extension = end(explode('.',$_FILES['upload']['name'])); $filename = $_FILES['upload']['name'] ; $filetype = $_FILES['upload']['type']; $path = $_SERVER['DOCUMENT_ROOT'] . '/admin/uploads/' . $filename; if(move_uploaded_file($_FILES['upload']['tmp_name'],$path)) { $query = $db->prepare('INSERT INTO applications (APP_name,APP_descrip,Path,APP_type,APP_time) VALUES(:title,:description,:path,:type,:time)'); $query->bindParam(':title',$_POST['title']); $query->bindParam(':description',nl2br($_POST['descrip'])); $query->bindParam(':path',$filename); $query->bindParam(':type',$filetype); $query->bindParam(':time',time()); $query->execute(); header('Location: dashboard.php'); } and this is the Html Form <form action="add_app.php" id="newapp" method ="post" enctype="multipart/form-data"><input type="text" name="title" size="65" placeholder="Application Name"/><br /><br /><textarea rows="15" cols="65" placeholder="Application Descriptions" name="descrip"></textarea><br /><br /><div class="upload_Media btn btn-success"><span>Upload The App</span><input type="file" class="upload" name="upload" /></div><br /><br /><input type="submit"id="doUpload" value=" Add Application" class="ui-button btn btn-default" /></form><script type="text/javascript">$('#doUpload').on('click',function() {$('#newapp').submit();});</script> Thank you Guys in Advance
  8. HBen

    Layout | Help

    Thank you davej & Themoonstarsun for the help and I hope you don't mind me mentioning you're names in my project .
  9. HBen

    Layout | Help

    Thanks davej , i really appreciate the CSS code .
  10. HBen

    Layout | Help

    i Got the Idea , Thanks Themoonstarsun .
  11. HBen

    Layout | Help

    Hello guys, I am having some problems with the layout , i am developing a website for android application , the PHP coding is going great , CSS Not So Good ,i failed to do a simple thing . i design a basic layout for the website with Photoshop , i hope someone can help me turn it to code , Picture : This is the Content Container layout . Thanks in Advance Guys
×
×
  • Create New...