0% found this document useful (0 votes)
35 views4 pages

Uploadprt 2

This document contains code snippets for building a PHP form for uploading images, including HTML for the form layout, PHP code to handle the file upload, and external CSS to style the form and preview image. The form allows selecting an image file from the user's device along with optional text, and uses PHP to process the upload and save the file upon form submission. Styling is applied with CSS to structure and style the form fields and preview image.

Uploaded by

Ceh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views4 pages

Uploadprt 2

This document contains code snippets for building a PHP form for uploading images, including HTML for the form layout, PHP code to handle the file upload, and external CSS to style the form and preview image. The form allows selecting an image file from the user's device along with optional text, and uses PHP to process the upload and save the file upon form submission. Styling is applied with CSS to structure and style the form fields and preview image.

Uploaded by

Ceh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

1 PHP

1. Form

<form method="post" action="index.php" enctype="multipart/form-data">

<input type="hidden" name="size" value="1000000">

<div>

<input type="file" name="image">

</div>

<div>

<textarea name="text" cols="40" rows="4" placeholder="about


image..."></textarea>

</div>

<Div>

<input type="submit" name="upload" value="upload image">

</div>

</form>

</div>

</body>
2 PHP

</html>

4. Css external

#content{

width:50%;

margin:20px auto;

border:2px solid #cbcbcb;

form{

width:50%;

margin:20px auto;

form div{

margin-top:5px;

#img_div{
3 PHP

width:80%;

padding:5px;

margin:15px auto;

border:1px solid #cbcbcb;

#img_div:after{

content:"";

display:block;

clear:both;

img{

float: left;

margin:5px;

width:300px;

height:140px;
4 PHP

You might also like