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.

moving a img to the server from a contact form

Featured Replies

hello again i have created a php script that works in php my admin but i carnt get it work on a server

 

how do i put the images to the say upload folder

 

i have created a folder called uploads and anothe called tmp_name and put them to the server is this correct

 

then i have the following scropt that sends me the email but does not upload the file to the server thanks

 

<?php

if ((($_FILES["file"]["type"] == "image/gif")

|| ($_FILES["file"]["type"] == "image/jpeg")

|| ($_FILES["file"]["type"] == "image/pjpeg")

|| ($_FILES["file"]["type"] == "image/jpg")

|| ($_FILES["file"]["type"] == "image/JPG")

|| ($_FILES["file"]["type"] == "image/pjpeg"))

&& ($_FILES["file"]["size"] < 2000000))

{

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"] / 20000000) . " mb<br />";

echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />"; if (file_exists("uploads/" . $_FILES["file"]["name"]))

{

echo $_FILES["file"]["name"] . " already exists. ";

}

else

{

move_uploaded_file($_FILES["file"]["tmp_name"],

"uploads/" . $_FILES["file"]["name"]);

echo "Stored in: " . "uploads/" . $_FILES["file"]["name"];

}

}

}

else

{

echo "Invalid file";

}

 

if ($_FILES["file"]["error"] > 0)

{

echo "Error: " . $_FILES["file"]["error"] . "<br />";

}

else

{

echo "Upload: " . $_FILES["file"]["name"] . "<br />";

echo "Type: " . $_FILES["file"]["type"] . "<br />";

echo "Size: " . ($_FILES["file"]["size"] / 20000) . " mb<br />";

echo "Stored in: " . $_FILES["file"]["tmp_name"];

}

 

$name = $_POST ['name'];

$subject = $_POST ['subject'];

$email = $_POST ['email'];

$text = $_POST ['text'];

$text2 = $_POST ['text2'];

$filename = $_FILES ['filename'];

$phone = $_POST ['phone'];

$time = $_POST ['time'];

$company =$_POST ['company'];

$email_message = "name {$name}

email {$email}

subject {$subject}

Company name {$company}

phone number {$phone}

Time to call {$time}

how you found me {$text2}

image1 {$filename}

image2 {$filename1}

image3 {$filename2}

comments {$text}";

ini_set("sendmail_from", "me@mydomain.co.uk");

 

mail ('me@mydomain.co.uk' , $subject ,$email_message );

 

?>

 

 

thank you again

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.