HBen
-
Posts
11 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by HBen
-
-
A kilobyte is 1024 bytes, a megabyte is 1024 kilobytes.
lol i made a mistake in "348160 bytes instead of 340 KB" , so any idea how can i get the size in kb !
-
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
-
-
It looks like you might have an incorrect path. It seems your website is in a directory "Final" so the path should be:
$path = $_SERVER['DOCUMENT_ROOT'] . '/Final/admin/uploads/' . $filename;
I didn't get the error this time , but nothing were written on the database
-
This is The Line 23
if(move_uploaded_file($_FILES['upload']['tmp_name'],$path)) {
-
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
-
Layout | Help
in CSS
Thank you davej & Themoonstarsun for the help and I hope you don't mind me mentioning you're names in my project .
-
Layout | Help
in CSS
Yes, perhaps something like...
<!DOCTYPE html><html lang="en"><head><meta chartype="utf-8"><title>tab title</title><style>.container {width:1100px;margin:0 auto;overflow:hidden;background-color:#14B;}#wrap{margin:50px;}.panel {width:300px;height:350px;float:left;margin:10px;background-color:#fff;border:1px dotted red;}.img1{width:150px;height:200px;display:block;float:left;background-color:#B8860B;margin:5px;}.inside{float:left;margin:5px;}.btn1{background-color:#14B;color:#fff;width:100px;height:40px;border-radius:10px;float:right;margin:60px 5px 5px 0;font-weight:bold;font-size:18pt;}</style></head><body><div class="container"><div id="wrap"><div class="panel"><h2>Name</h2><image src="#" class="img1" alt="img"/><div class="inside"> <h3>Rate</h3> <p>Description</p> <p>Text</p> </div> <input type="button" value="More" class="btn1"/></div><div class="panel">content</div><div class="panel">content</div><div class="panel">content</div><div class="panel">content</div><div class="panel">content</div></div></div></body></html>
...but then again, if this is a mobile design you would probably reconfigure the panels with several @media css blocks.
Thanks davej , i really appreciate the CSS code .
-
Layout | Help
in CSS
Best to start with a solid and clean heirarchy.Start with a container div. Create 6 div tags inside of your container divFigure out the margins you would like Interesting part...Give the div tags widths that would total twice the width of the container. (be sure to account for margins or paddings you've previously applied) Then float the items left.This should push the later three panels to a new line. Below is a really basic template (Not necessarily optimal for all purposes) which you can tweak for your project specifictions.
<style>.container {width:1000px;}.panel {width:300px; float:left;}</style><div class="container"> <div class="panel">content</div> <div class="panel">content</div> <div class="panel">content</div> <div class="panel">content</div> <div class="panel">content</div> <div class="panel">content</div> </div>
i Got the Idea , Thanks Themoonstarsun .
-
Layout | Help
in CSS
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
FileSize from DB
in PHP
Posted · Edited by HBen
i didn't think of that ,i was focusing that there are a function to do that . thanks Ingolme