Sample Code with Output

Similar documents
Download: Server-side technologies. WAMP (Windows), MAMP (Mac),

By : Ashish Modi. CRUD USING PHP (Create, Read, Update and Delete on Database) Create Database and Table using following Sql Syntax.

Chapter 1 Introduction to web development and PHP

Why File Upload Forms are a Major Security Threat

<head> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <title>my First PHP Lab</title> </head>

Using Cloud Databases in the Cloud Control Panel By J.R. Arredondo

DEPARTMENT OF INFORMATION TECHNOLOGY

Create dynamic sites with PHP & MySQL

How To Let A Lecturer Know If Someone Is At A Lecture Or If They Are At A Guesthouse

Using Microsoft Expression Web to Upload Your Site

Livezilla How to Install on Shared Hosting By: Jon Manning

Server side scripting and databases

How To Create A Web Database From A Multimedia Resources Database On A Microsoft Web Browser On A Pc Or Mac Or Mac (For Free) On A Mac Or Ipad Or Ipa (For Cheap) On Pc Or Ipam (For Money

INSTALLING, CONFIGURING, AND DEVELOPING WITH XAMPP

SQL Injection. Blossom Hands-on exercises for computer forensics and security

Web Development Guide. Information Systems

HowTo. Planning table online

Python and MongoDB. Why?

Supercharge your MySQL application performance with Cloud Databases

Chapter 28: Expanding Web Studio

Using Internet or Windows Explorer to Upload Your Site

FireBLAST Marketing Solution v2

Contents. Tizag Webmaster Tutorials Unlock Your Potential!

To configure Outlook Express for your InfoMetrics address:

AD Phonebook 2.2. Installation and configuration. Dovestones Software

Welcome to CSE 330 Crea0ve Progamming and Rapid Prototyping. Course Informa0on

How To Write A Program In Php (Php)

Designing for Dynamic Content

COURSE CONTENT FOR WINTER TRAINING ON Web Development using PHP & MySql

PHP Form Handling. Prof. Jim Whitehead CMPS 183 Spring 2006 May 3, 2006

Tutorial on Client-Server Communications

Installing and configuring Microsoft Reporting Services

1. Please login to the Own Web Now Support Portal ( with your address and a password.

AJ Matrix V5. Installation Manual

The Web Pro Miami, Inc. 615 Santander Ave, Unit C Coral Gables, FL T: info@thewebpro.com

LEARNING DRUPAL. Instructor : Joshua Owusu-Ansah Company : e4solutions Com. Ltd.

You must have at least Editor access to your own mail database to run archiving.

Bld. du Roi Albert II, 27, B 1030 BRUSSELS Tel Fax Secure file upload in PHP web applications

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE CISY 233 INTRODUCTION TO PHP

Account Create for Outlook Express

CMS and e-commerce Solutions. version 1.0. Please, visit us at: or contact directly by

Using The HomeVision Web Server

eattendance System for Academic Institutions

Introduction to web development using XHTML and CSS. Lars Larsson. Today. Course introduction and information XHTML. CSS crash course.

Application Servers G Session 2 - Main Theme Page-Based Application Servers. Dr. Jean-Claude Franchitti

Hello friends, This is Aaditya Purani and i will show you how to Bypass PHP LFI(Local File Inclusion)

Chapter 23: Uploading Your Website to the Internet

Fasthosts ASP scripting examples Page 1 of 17

iscripts Backuper 2009 iscripts

SCRIPTING, DATABASES, SYSTEM ARCHITECTURE

Website Pros Templates v1.0. Database Template Overview

Backup and Restore MySQL Databases

How to Configure UCO Exchange on an Android Device

Managing Files. On a PC, after you find your file, right click it and selet Rename from the pop-up menu.

Parallels Plesk Control Panel

Membuat Aplikasi Berita Sederhana

CHAPTER 13. Amendments and Returned Applications. Amending Your Application (within the two-day grace period) and Resubmitting

Working with forms in PHP

Handling the Client Request: Form Data

Other Language Types CMSC 330: Organization of Programming Languages

Web development... the server side (of the force)

Automated CPanel Backup Script. for home directory backup, remote FTP backup and Amazon S3 backup

Digital Downloads Pro

Adding web interfaces to complex scientific computer models brings the following benefits:

Filtering with Microsoft Outlook

OCS Training Workshop LAB13. Ethernet FTP and HTTP servers

Mozilla Thunderbird: Setup & Configuration Learning Guide

by

Ulteo Open Virtual Desktop - Protocol Description

SETTING UP AND RUNNING A WEB SITE ON YOUR LENOVO STORAGE DEVICE WORKING WITH WEB SERVER TOOLS

How to Configure edgebox as a Web Server

What Is Online Archiving?

How To Create A Website On Atspace.Com For Free (Free) (Free Hosting) (For Free) (Freer) ( (Web) (Femalese) (Unpaid) (

ONLINE BACKUP MANAGER MS EXCHANGE MAIL LEVEL BACKUP

PDG Software. Site Design Guide

Microsoft SharePoint 2010 End User Quick Reference Card

Outlook Express. Make Changes in Red: Open up Outlook Express. From the Menu Bar. Tools to Accounts - Click on Mail Tab.

RDS Online Backup Suite v5.1 Brick-Level Exchange Backup

Rentavault Online Backup. MS Exchange Mail Level Backup

How to use Certificate in Outlook Express

Welcome to Collage (Draft v0.1)

WordPress Security Scan Configuration

About ZPanel. About the framework. The purpose of this guide. Page 1. Author: Bobby Allen Version: 1.1

Quick Start Guide Joomla!: Guidelines for installation and setup. Why Joomla!

Server-side: PHP and MySQL (continued)

Netscape Setup Instructions

Content Management Software Drupal : Open Source Software to create library website

Using the owncloud Android App

imhosted Web Hosting Knowledge Base

Editing CCSU Web Sites with Dreamweaver

Principles and Techniques of DBMS 5 Servlet

Databoks Remote Backup. MS Exchange Mail Level Backup

Transcription:

Sample Code with Output File Upload : In PHP, we can upload file to a server fileupload.html #menu a #content #italictext <img src="../bookstore.jpg" width="100%" height="40%"></img> <div id="menu" align="center">

<br> <form enctype="multipart/form data" action="add.php" method="post"> Name: <input type="text" name="name"><br> E mail: <input type="text" name = "email"><br> Phone: <input type="text" name = "phone"><br> Photo: <input type="file" name="photo"><br> <input type="submit" value="add"> </form> add.php #menu a #content #italictext

<img src="../bookstore.jpg" width="100%" height="40%"></img> <div id="menu" align="center"> <br> <?php //This is the directory where images will be saved $target = "images/"; $target = $target. basename( $_FILES['photo']['name']); //This gets all the other information from the form $name=$_post['name']; $email=$_post['email']; $phone=$_post['phone']; $pic=($_files['photo']['name']); // Connects to your Database mysql_connect("localhost", "root", "chennai123") or die(mysql_error()) ; mysql_select_db("test") or die(mysql_error()) ; //Writes the information to the database mysql_query("insert INTO employees(name,eamil,phone,path) VALUES ('$name', '$email', '$phone', '$pic')") ; //Writes the photo to the server if(move_uploaded_file($_files['photo']['tmp_name'], $target)) //Tells you if its all ok

echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory"; else //Gives and error if its not echo "Sorry, there was a problem uploading your file.";?> view.php #menu a #content #italictext <img src="../bookstore.jpg" width="100%" height="40%"></img> <div id="menu" align="center"> <img src="../bookstore.jpg" width="100%"

height="40%"></img> <div id="menu" align="center"> <br> <?php //This is the directory where images will be saved $target = "images/"; $target = $target. basename( $_FILES['photo']['name']); //This gets all the other information from the form $name=$_post['name']; $email=$_post['email']; $phone=$_post['phone']; $pic=($_files['photo']['name']); // Connects to your Database mysql_connect("localhost", "root", "chennai123") or die(mysql_error()) ; mysql_select_db("test") or die(mysql_error()) ; //Writes the information to the database mysql_query("insert INTO employees(name,eamil,phone,path) VALUES ('$name', '$email', '$phone', '$pic')") ; //Writes the photo to the server if(move_uploaded_file($_files['photo']['tmp_name'], $target)) //Tells you if its all ok

echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory"; else //Gives and error if its not echo "Sorry, there was a problem uploading your file.";?> view.php #menu a #content #italictext <img src="../bookstore.jpg" width="100%

<br> <?php // Connects to your Database mysql_connect("localhost", "root", "") or die(mysql_error()) ; mysql_select_db("test") or die(mysql_error()) ; //Retrieves data from MySQL $data = mysql_query("select * FROM employees") or die(mysql_error()); //Puts it into an array while($info = mysql_fetch_array( $data )) //Outputs the image and other data echo "<img src=http://localhost/fileupload/images/".$info['photo']."> <br>"; echo "<b>name:</b> ".$info['name']. "<br> "; echo "<b>email:</b> ".$info['email']. " <br>"; echo "<b>phone:</b> ".$info['phone']. " <hr>";?>