Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Image code

Featured Replies

I have a image code but i can't seem to upload any files or get any to show. I tired to contact the person who gave me the code but he no longer exists on a site i used ages ago.

 

The file button:

<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Upload File:</label>
<input type="file" name="file" id="file" /> 
<br />
<input type="submit" name="submit" value="Submit" />
</form>

 

Upload_File.php

<font color="red"><h3>Thankyou for uploading!</h3></font>
<br />
<?php
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/png")
|| ($_FILES["file"]["type"] == "image/jpg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 30000000))
 {
 if ($_FILES["file"]["error"] > 0)
   {
   echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
   }
 else
   {
   echo "Upload: " . $_FILES["file"]["name"] . "<br />";
   echo "Type: " . $_FILES["file"]["type"] . "<br />";
   echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
   echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";    if (file_exists("upload/" . $_FILES["file"]["name"]))
     {
     echo $_FILES["file"]["name"] . " already exists. ";
     }
   else
     {
           move_uploaded_file($_FILES["file"]["tmp_name"],
     "uploads/" . $_FILES["file"]["name"]);
     echo "URL: " . "URL TO YOUR FILE UPLOAD FOLDER" . $_FILES["file"]["name"];
     }
   }
 }
else
 {
 echo "Sorry, an error occurred. Your File was a format that we do not currently host.";
 }
?>

        </div>
        <div class="meta">
           <p class="byline"> </p>

        </div>
     </div>
  </div>
  <!-- end content -->
     <div style="clear: both;"> </div>
</div>
<!-- end page -->

 

Ive tried to add my folder where i want the images to go but nothing appears. I want the images to upload to a folder called www.mydomain.com/images

 

Thanks.

Could be this

 

{
           move_uploaded_file($_FILES["file"]["tmp_name"],
     "uploads/" . $_FILES["file"]["name"]);

 

Try changing the above to the below

 

{
           move_uploaded_file($_FILES["file"]["tmp_name"],
     "images/" . $_FILES["file"]["name"]);

 

Make sure the server has read/write access to that folder too. :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.