Jump to content

phpmaster11

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

phpmaster11's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. <?php include("config.inc.php"); session_start(); if (!isset($_SESSION['user'])){ header("location: login.php"); exit(); } //filepath $filename = $_FILES['file']['name']; $filename = explode(".",$filename); $fileid = uniqid(); $fileurl = "http://" . $_SERVER['HTTP_HOST'] . "/image.php?loc=" . $fileid . $filename[0] . "." . $filename[1]; $dbfileurl = $fileid . $filename[0] . "." . $filename[1]; $filepath = getcwd() . "/imageup/" . $fileid . $filename[0] . "." . $filename[1]; //file restrictions if ( $_FILES['file']['type'] == "image/jpg" || $_FILES['file']['type'] == "image/gif" || $_FILES['file']['type'] == "image/jpeg" && $_FILES['file']['size'] < 1048576 ) { if($_FILES['file']['error'] > 1) { exit ("<center>There has been an error uploading your file:" . $_FILES['file']['error'] . "</center><br />"); } elseif (file_exists($filepath)) { echo "<center>A file with this name already exists.</center>"; } else { echo $dbfileurl; $filesize = $_FILES['file']['size']/1000; $filesize = number_format($filesize,0); move_uploaded_file($_FILES['file']['tmp_name'],$filepath); echo "<center>Your file has been succesfully uploaded</center><br />"; echo "<div class=\"upload_info\" align=\"center\">"; echo "<center>File uploaded: " . $_FILES['file']['name'] . "<br />"; echo "File type: " . $_FILES['file']['type'] . "<br />"; echo "File size: " . $filesize . " KB<br />"; echo "Storage location: " . "<a href=\"$fileurl\">$fileurl</a>" . "<br />"; echo "expiry date: "; echo "</div>"; $username = $_SESSION[user][name]; mysql_query("INSERT INTO `imageup` (url, user) VALUES ('$dbfileurl', '$username')") or die ("could not save file url in db" . mysql_error()); } } else echo "<center><b>Invalid file</b></center>"; ?>
  2. ?? No, im using i think APPLE or something
  3. pfft.. i think i know what im talking about ive been programming in php for over 9 months now..
  4. ok, i have been learning php over the last 8-9 months and have really took off with it. I ve been practacing all the time and belive one day i could get a job doing somthing i love. At the moment and doing a bit of freelancing and have just got my first client. He wants a website with a fully automatic login and register feuture. I have tried for about 2 das getting it to work but have had no look with it so far. Its probaly just a small error but i can see whats wrong.. It could jsut be a problem with my browser. <html> <div id="login box"></div> <?php echo "My Login Page";</$> <php> <?$ <Login></Login> <?$ <Password></Password> <css> Blue=login box border$> Medium Green=Text color$> Green=background$> </css>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.