How can you add Images onto a web site

  • finland
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Oct 15, 2007
  • Posts: 7
  • Status: Offline

Post October 28th, 2007, 3:08 pm

How can you add Images onto a web site

and set a limited of the images that can be sent

thanks
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post October 28th, 2007, 3:08 pm

  • sin0cide
  • Born
  • Born
  • No Avatar
  • Joined: Oct 28, 2007
  • Posts: 3
  • Status: Offline

Post October 28th, 2007, 3:14 pm

well the img code would give you images onto your own webpage... I.E.
Code: [ Select ]
<img src="location of file" alt="title" height="150px" width="150px">


but if you looking at adding them to you a forum or blogs that is a whole different story. and why would you want a limit that can be sent?

are you trying to make a page that anyone can add images too?
  • finland
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Oct 15, 2007
  • Posts: 7
  • Status: Offline

Post October 28th, 2007, 3:16 pm

i want people to send me photo images from my website, via a web form, dont want images to be over 5mbs
  • sin0cide
  • Born
  • Born
  • No Avatar
  • Joined: Oct 28, 2007
  • Posts: 3
  • Status: Offline

Post October 28th, 2007, 3:36 pm

you will need a coding back end but this php setup is probably what your looking for.
http://www.phpfreaks.com/tutorials/36/0.php
  • finland
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Oct 15, 2007
  • Posts: 7
  • Status: Offline

Post October 28th, 2007, 4:06 pm

thanks for the link

i dont understand a word of PHP

lol
  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8212
  • Loc: USA
  • Status: Offline

Post October 29th, 2007, 2:54 pm

Code: [ Select ]
<?php
if (($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg")
|| ($_FILES["file"]["type"] == "image/bmp")
&& ($_FILES["file"]["size"] < 6))
 {
 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"],
   "upload/" . $_FILES["file"]["name"]);
   echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
   }
  }
 }
else
 {
 echo "Invalid file";
 }
?>
<form method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>
  1. <?php
  2. if (($_FILES["file"]["type"] == "image/gif")
  3. || ($_FILES["file"]["type"] == "image/jpeg")
  4. || ($_FILES["file"]["type"] == "image/pjpeg")
  5. || ($_FILES["file"]["type"] == "image/bmp")
  6. && ($_FILES["file"]["size"] < 6))
  7.  {
  8.  if ($_FILES["file"]["error"] > 0)
  9.   {
  10.   echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
  11.   }
  12.  else
  13.   {
  14.   echo "Upload: " . $_FILES["file"]["name"] . "<br />";
  15.   echo "Type: " . $_FILES["file"]["type"] . "<br />";
  16.   echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
  17.   echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
  18.   if (file_exists("upload/" . $_FILES["file"]["name"]))
  19.    {
  20.    echo $_FILES["file"]["name"] . " already exists. ";
  21.    }
  22.   else
  23.    {
  24.    move_uploaded_file($_FILES["file"]["tmp_name"],
  25.    "upload/" . $_FILES["file"]["name"]);
  26.    echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
  27.    }
  28.   }
  29.  }
  30. else
  31.  {
  32.  echo "Invalid file";
  33.  }
  34. ?>
  35. <form method="post"
  36. enctype="multipart/form-data">
  37. <label for="file">Filename:</label>
  38. <input type="file" name="file" id="file" />
  39. <br />
  40. <input type="submit" name="submit" value="Submit" />
  41. </form>


That's just the include script. You'd have to implement that into an email form. When I have the time, I could make you a script like that. I think I would be able to do that (a nice thing to do since I'm learning PHP right now :) ).
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • finland
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Oct 15, 2007
  • Posts: 7
  • Status: Offline

Post October 30th, 2007, 2:37 am

still cant get it working, to send pics.......

Here is the php code I'm using

PHP:
PHP Code: [ Select ]
 
<?php
 
if(isset($_POST['submit']))  {
 
 
 
        $to  =  "email goes here";
 
        $subject  =  "Customer  Email  -  YOUR  WEBSITE.com";
 
        $name_field  =  $_POST['name'];
 
        $email_field  =  $_POST['email'];
 
        $message  =  $_POST['message'];
 
 
 
        $body  =  "Customer  Email  From  YOURSITE.com,\n  \n  Contact  Information:  \n  From:  $name_field\n  Customer  E-Mail  Address:  $email_field\n  ustomer  Message:\n  \n  $message\n  \n  End  Message";
 
 
 
        echo  "Data  has  been  submitted  to  web site goes here!  <a  href='Test_email.html'>Go  Back  To  Contact  Page</a>";
 
        mail($to,  $subject,  $body);
 
       
 
}  else  {
 
        echo  "Error  Sending  Message!";
 
}
 
?>
  1.  
  2. <?php
  3.  
  4. if(isset($_POST['submit']))  {
  5.  
  6.  
  7.  
  8.         $to  =  "email goes here";
  9.  
  10.         $subject  =  "Customer  Email  -  YOUR  WEBSITE.com";
  11.  
  12.         $name_field  =  $_POST['name'];
  13.  
  14.         $email_field  =  $_POST['email'];
  15.  
  16.         $message  =  $_POST['message'];
  17.  
  18.  
  19.  
  20.         $body  =  "Customer  Email  From  YOURSITE.com,\n  \n  Contact  Information:  \n  From:  $name_field\n  Customer  E-Mail  Address:  $email_field\n  ustomer  Message:\n  \n  $message\n  \n  End  Message";
  21.  
  22.  
  23.  
  24.         echo  "Data  has  been  submitted  to  web site goes here!  <a  href='Test_email.html'>Go  Back  To  Contact  Page</a>";
  25.  
  26.         mail($to,  $subject,  $body);
  27.  
  28.        
  29.  
  30. }  else  {
  31.  
  32.         echo  "Error  Sending  Message!";
  33.  
  34. }
  35.  
  36. ?>


NOW THE HTML


Code: [ Select ]
<body>

<form action="mailer.php" method="POST" enctype="multipart/form-data"> 

Email Us From Your Browser --

  <p></p>

  Name:

  <input type="text" name="name" size="19"><br>

  <br>

  E-Mail:

  <input type="text" name="email" size="19"><br>

  <br>

 

  <br>

Message:<br>

  <textarea rows="9" name="message" cols="30"></textarea>
  <br />
  <br />
  <label>image
  <input type="file" name="file" />
  </label>
  <br>

  <br>

  <input type="submit" value="Submit" name="submit">

</form>
  1. <body>
  2. <form action="mailer.php" method="POST" enctype="multipart/form-data"> 
  3. Email Us From Your Browser --
  4.   <p></p>
  5.   Name:
  6.   <input type="text" name="name" size="19"><br>
  7.   <br>
  8.   E-Mail:
  9.   <input type="text" name="email" size="19"><br>
  10.   <br>
  11.  
  12.   <br>
  13. Message:<br>
  14.   <textarea rows="9" name="message" cols="30"></textarea>
  15.   <br />
  16.   <br />
  17.   <label>image
  18.   <input type="file" name="file" />
  19.   </label>
  20.   <br>
  21.   <br>
  22.   <input type="submit" value="Submit" name="submit">
  23. </form>
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Joined: Mar 12, 2007
  • Posts: 6228
  • Loc: South-Africa
  • Status: Offline

Post October 30th, 2007, 3:18 am

Maybe just add code tags in posts to make it easier to read by using around the code
Let's leave all our *plum* where it is and go live in the jungle ...
  • finland
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Oct 15, 2007
  • Posts: 7
  • Status: Offline

Post November 1st, 2007, 5:59 am

[ok]
  • martens
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Nov 06, 2007
  • Posts: 41
  • Status: Offline

Post November 6th, 2007, 4:26 am

It should help?
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Joined: Mar 12, 2007
  • Posts: 6228
  • Loc: South-Africa
  • Status: Offline

Post November 6th, 2007, 4:33 am

martens wrote:
It should help?

What?
Let's leave all our *plum* where it is and go live in the jungle ...
  • finland
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Oct 15, 2007
  • Posts: 7
  • Status: Offline

Post November 15th, 2007, 4:27 pm

i still cant get images to come in an from:(
  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8212
  • Loc: USA
  • Status: Offline

Post November 15th, 2007, 5:10 pm

Do you want it to be like an Image mail where YOU send the people or where people send it to you?

You could have it that they upload the image to a directory at the same time that they send you the form and you get the url of the image that they submitted and you would be able to see it then... that would be easy to do if you have the scripts for mail and for uploading... just combine them and have the URL be sent to you as the user presses submit of the mail...
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • sectio
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Dec 04, 2007
  • Posts: 6
  • Status: Offline

Post December 5th, 2007, 7:12 pm

i think u should just make a chatango account, copy image location and shows image on chat box real simple. or use the <img src="-----------"> tag
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Joined: Mar 12, 2007
  • Posts: 6228
  • Loc: South-Africa
  • Status: Offline

Post December 6th, 2007, 1:53 am

here is a full on explanation from W3C which gives source code and a proper explanation ... http://www.w3schools.com/php/php_file_upload.asp
Let's leave all our *plum* where it is and go live in the jungle ...
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post December 6th, 2007, 1:53 am

Post Information

  • Total Posts in this topic: 15 posts
  • Users browsing this forum: No registered users and 126 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.