kirtijoshi007 Posted August 16, 2013 Share Posted August 16, 2013 Hello,i try to create on e user login / registration page and all member page with php, in which i want to normal registration page with photo upload facility.member page - uploaded photo at registration time shown in this page with name & city detials from db, with search by city facility.,i try it lots but, its not done by me, please help me for this.... i try my hand on coding but its show me errors...... i attch my files here , please help me to solve my problem..... member page is not designed, b'coz, i have no idea how to show all members from database to one page..... database dump Database Name : hrmdatabase table : profile -- phpMyAdmin SQL Dump -- version 3.4.5 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Aug 16, 2013 at 04:31 PM -- Server version: 5.5.16 -- PHP Version: 5.3.8 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `hrm` -- -- -------------------------------------------------------- -- -- Table structure for table `profile` -- CREATE TABLE IF NOT EXISTS `profile` ( `username` varchar(50) COLLATE latin1_general_ci NOT NULL, `email` varchar(50) COLLATE latin1_general_ci NOT NULL, `password` varchar(50) COLLATE latin1_general_ci NOT NULL, `realname` varchar(100) COLLATE latin1_general_ci NOT NULL, `cast` varchar(10) COLLATE latin1_general_ci NOT NULL, `surname` varchar(50) COLLATE latin1_general_ci NOT NULL, `mob1` int(15) NOT NULL, `mob2` int(15) NOT NULL, `address1` longtext COLLATE latin1_general_ci NOT NULL, `address 2` longtext COLLATE latin1_general_ci NOT NULL, `city` varchar(50) COLLATE latin1_general_ci NOT NULL, `businessdetails` longtext COLLATE latin1_general_ci NOT NULL, `birthdate` varchar(25) COLLATE latin1_general_ci NOT NULL, `help` longtext COLLATE latin1_general_ci NOT NULL, `URL` longtext COLLATE latin1_general_ci NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; -- -- Dumping data for table `profile` -- INSERT INTO `profile` (`username`, `email`, `password`, `realname`, `cast`, `surname`, `mob1`, `mob2`, `address1`, `address 2`, `city`, `businessdetails`, `birthdate`, `help`, `URL`) VALUES ('dfdfsgfds', 'dfgfdsd', '32dssf', 'sddsfd', 'Nana Bhai ', 'saddfgf', 123465, 123456, '11231', '13131', 'dsafsfsd', 'dsasafsd', '135565', 'sadfsafsafssd', ''); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; Registration.html Page Code := <form action="addmembers.php" method="post" enctype="multipart/form-data" class="style1"> <div align="right">User Name <input type="text" name="username"> <br> Email <input type="text" name="email" > <label>Password <input type="password" name="password"> <br> Real Name <input type="text" name="realname"> <br> <br> Cast <select name="cast"> <option selected>Nana Bhai Bharvad</option> <option>Mota Bhai Bharvad</option> <option>Rabari (Rayka)</option> </select> <br> <br> Surname <input type="text" name="surname"> <br> Mobile No. 1 <input type="text" name="mob1"> <br> Mobiel No. 2 <input type="text" name="mob2"> <br> Address Line 1 <input type="text" name="address1"> <br> Address Line 2 <input type="text" name="address2"> <br> <br> City <input type="text" name="city"> <br> <br> Business Details <textarea name="businessdetails" style="width:270px; height:100px"></textarea> <br> <br> Birth Date <input type="text" name="birthdate"> <br> <br> How I Help To Other Member<br> <textarea name="help" style="width:270px; height:100px"></textarea> <br><br> User Photo <input type="file" name="filep"><Br><Br> <input type="submit" name=action value="Submit"> <br> </label> </div> </label> </form> PHP file for database insert operation (errors in this file) <?php error_reporting(0); if ($_POST["action"] == "Submit") { $folder = "img/"; move_uploaded_file($_FILES["filep"]["tmp_name"] , "$folder".$_FILES["filep"]["name"]) echo "<p align=center>File ".$_FILES["filep"]["name"]."loaded..."; $username=$_POST['username']; $email=$_POST['email']; $password=$_POST['password']; $realname=$_POST['realname']; $cast=$_POST['cast']; $surname=$_POST['surname']; $mob1=$_POST['mob1']; $mob2=$_POST['mob2']; $address1=$_POST['address1']; $address2=$_POST['address2']; $city=$_POST['city']; $businessdetails=$_POST['businessdetails']; $birthdate=$_POST['birthdate']; $help=$_POST['help']; $image = file_get_contents($_FILES['image']['tmp_name']); $image = mysql_real_escape_string($image); $conn=mysql_connect("localhost","root","") or die("Could not save image name Error: " . mysql_error()); mysql_select_db("hrm",$conn) or die("Could not save image name Error: " . mysql_error()); $sql="INSERT INTO profile ('username','email','password','realname','cast','surname','mob1','mob2','address1','address2','city','businessdetails','birthdate','help','URL',) VALUES('$username','$email','$password','$realname','$cast','$surname','$mob1','$mob2','$address1','$address2','$city','$businessdetails','$birthdate','$help','$_FILES['filep']['name']')"; mysql_query($sql,$conn); mysql_close($conn); ?> member page is not designed, please help me for this page.... and my errors,.... thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/281253-registration-with-photo-upload-searching-problem-in-php/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.