SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb run curretly on local server but main server my program not running currectly

    properly run on local server but that's on running properly on main server.... So, any body help me what's a Error in my code.
    ================
    `user_id`, `username`, `password`, `cpassword`, `email`, `candidate_name`, `dob`, `sex`, `contact_no`, `current_add1`, `current_add2`, `permanent_add1`, `permanent_add2`, `pin_code`, `city`, `state`, `country`, `lqualify`, `specialization`, `univer_school`, `diploma_degree`, `a_line1_diplo_dgre`, `a_line2_diplo_dgre`, `b_line1_diplo_dgre`, `b_line2_diplo_dgre`, `c_line1_diplo_dgre`, `c_line2_diplo_dgre`, `location`, `project_title`, `pro_details`, `training`, `t_member`, `duration`, `industry`, `year`, `months`, `designation`, `l_industry`, `key_skills`, `roles`, `company_name`, `1ccname`, `2ccname`, `3ccname`, `photourl`, `resumeurl`, `summary`SELECT * FROM `site_user_details` WHERE 1
    ==================

    Code php:
    <?php
    	//Start session
     
    	if(isset($_POST['submit'])) {
    * * // Get the ID
    * * * **
    	//Include database connection details
    	require_once('config.php');
     
    	//Connect to mysql server
    	$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
    	if(!$link) {
    		die('Failed to connect to server: ' . mysql_error());
    	}
     
    	//Select database
    	$db = mysql_select_db(DB_DATABASE);
    	if(!$db) {
    		die("Unable to select database");
    	}
     
    	//Sanitize the POST values
     
    	$candidate_name=$_POST['candidate_name'];
    	$dob = $_POST['dob'];
    	$sex = $_POST['sex'];
    	$contact_no = $_POST['contact_no'];
    	$email = $_POST['email'];
    	$current_add1 = $_POST['current_add1'];
    	$current_add2 = $_POST['current_add2'];
    	$permanent_add1 = $_POST['permanent_add1'];
    	$permanent_add2 = $_POST['permanent_add2'];
    	$state = $_POST['state'];
    	$country = $_POST['country'];
    	$lqualify = $_POST['lqualify'];
    	$univer_school = $_POST['univer_school'];
    	$diploma_degree = $_POST['diploma_degree'];
     
     
     
     
    	$a_line1_diplo_dgre = $_POST['a_line1_diplo_dgre'];
    	$a_line2_diplo_dgre = $_POST['a_line2_diplo_dgre'];
     
     
     
     
    	$b_line1_diplo_dgre = $_POST['b_line1_diplo_dgre'];
    	$b_line2_diplo_dgre = $_POST['b_line2_diplo_dgre'];
     
     
     
     
    	$c_line1_diplo_dgre = $_POST['c_line1_diplo_dgre'];
    	$c_line2_diplo_dgre = $_POST['c_line2_diplo_dgre'];
     
     
     
     
    	$project_title=$_POST['project_title'];
    	$pro_details=$_POST['pro_details'];
    	$training=$_POST['training'];
    	$t_member=$_POST['t_member'];
    	$duration=$_POST['duration'];
     
     
     
     
    	$industry=$_POST['industry'];
    	$year=$_POST['year'];
    	$months=$_POST['months'];
    	$designation=$_POST['designation'];
     
    	$l_industry=$_POST['l_industry'];
    	$key_skills=$_POST['key_skills'];
    	$roles=$_POST['roles'];
     
     
     
     
     
     
    $qry = "INSERT INTO site_user_details(candidate_name,dob,sex,contact_no,email,current_add1,current_add2,permanent_add1,permanent_add2,state,country,lqualify,univer_school,diploma_degree,a_line1_diplo_dgre,a_line2_diplo_dgre,b_line1_diplo_dgre,b_line2_diplo_dgre,c_line1_diplo_dgre,c_line2_diplo_dgre,project_title,pro_details,training,t_member,duration,industry,year,months,designation,l_industry,key_skills,roles)
    *VALUES('$candidate_name','$dob','$sex','$contact_no','$email','$current_add1','$current_add2','$permanent_add1','$permanent_add2','$state','$country','$lqualify','$univer_school','$diploma_degree',
    '$a_line1_diplo_dgre','$a_line2_diplo_dgre','$b_line1_diplo_dgre','$b_line2_diplo_dgre','$c_line1_diplo_dgre','$c_line2_diplo_dgre','$project_title','$pro_details','$training','$t_member','$duration','$industry','$year','$months','$designation','$l_industry','$key_skills','$roles')";
     
     
     
     
     
     
     
     
    $result = @mysql_query($qry);
     
    	//Check whether the query was successful or not
    	if($result) {
    		echo "<script>alert('Submission successfully!!!'); window.location = './fillform.php';</script>";
    		exit();
     
    	}else {
    		die("Query failed");
    	}
    	}
    ?>
    ===================




    <?php
    define('DB_HOST','localhost');
    define('DB_USER','root');
    define('DB_PASSWORD','');
    define('DB_DATABASE','web214-arun');
    ?>
    ================
    Last edited by ParkinT; Aug 5, 2013 at 06:45. Reason: Added code tags

  2. #2
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,287
    Mentioned
    182 Post(s)
    Tagged
    4 Thread(s)
    Welcome to Sitepoint. I hope we can help you solve this problem.

    The first thing that comes to mind immediately is to verify that you have access to a database on the main server that matches the one on the local host?
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains

  3. #3
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,210
    Mentioned
    74 Post(s)
    Tagged
    3 Thread(s)
    As ParkinT says the problem is probably with your user details as it is extremely unlikely you will be running under Root without a password on a server.

    Code:
    define('DB_USER','root'); USERNAME OF ROOT
    define('DB_PASSWORD',''); NO PASSWORD


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •