[risolto] Codeigniter mi ristituisce internal server error

Jakub Lemiszewski

Utente Attivo
5 Dic 2013
119
1
0
Nel codice seguente ho il problema che mi restituisce Internal server error e sto impazzendo per capire da dove viene grazie dell'aiuto:
Nel link se provate a fare il sign up vi restituisce il problema internal server error:
http://jaku0260.keaweb.dk/
PHP:
<html lang="en-gb" data-scribe-reduced-action-queue="true"><!--<![endif]--><head> 
    
    <meta charset="utf-8">
    
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
    

	<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
  
<!-- Optional theme -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">

<!-- Latest compiled and minified JavaScript -->
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>

 
        <link rel="stylesheet" href="<?php echo base_url();?>assets/css/style1.css">
       <link rel="stylesheet" href="<?php echo base_url();?>assets/css/style.css">
        <link rel="stylesheet" href="<?php echo base_url();?>assets/css/style2.css">

      <title>K-Talks</title>
    
</head>

<body class="t1 logged-out ms-windows mobile-callout front-page">
<div style="height:50px;background:#fff">
</div>


<center>
	<div id="getdetails"  style="min-width: 500px;
background: #fff;
border-radius: 5px;
max-width: 680px;
margin-top: 100px;
padding-left: 30px;
padding-top: 10px;
padding-right: 30px;min-height:226px">
		
<form role="form"  enctype="multipart/form-data" method="post" action="<?php echo base_url();?>index.php/user/submitprofile">
<div class="form-group row">
    <label style="float:left" for="exampleInputEmail1">DOB *</label>
    <input style="float:right;max-width:75%" name="dob" type="Date" class="form-control" id="exampleInputEmail1" >
  </div>



  <div class="form-group row">
    <label style="float:left" for="exampleInputEmail1">Country *</label>
    <input style="float:right;max-width:75%" name="country" type="text" class="form-control" id="exampleInputEmail1" placeholder="Your Country">
  </div>
  <div class="form-group">
  	
    <label style="float:left" for="exampleInputPassword1">Sex *</label>
    <div style="width:170px;">
    <span style="display:inline-block;float:left"><input   Value="m" type="radio" name="sex"  id="male" ><label> Male</label>
</span>
<span style="display:inline-block;float:right;">
    <input type="radio"  value="female" id="f" name="sex" ><label>Female</label>
</span>
</div>


  </div>
  <div class="form-group" style="margin-top:80px">
    <label style="float:left"  for="exampleInputFile">Profile Picture</label>
    <input type="file" accept="image/*" name="image" id="exampleInputFile">
    
  </div>
 
  <button type="submit" style="margin-left:504px;margin-bottom: 10px;" class="download">Submit</button>
</form>


	</div>
</center>

  <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>

<script type="text/javascript" src="<?php echo base_url();?>assets/js/bootstrap.min.js"> </script>    

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

	</body>
</html>
login/signup form
PHP:
<html lang="en-gb" data-scribe-reduced-action-queue="true"><!--<![endif]--><head>

    <meta charset="utf-8">
    
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>    
 
        <link rel="stylesheet" href="<?php echo base_url();?>assets/css/style1.css">
       <link rel="stylesheet" href="<?php echo base_url();?>assets/css/style.css">
        <link rel="stylesheet" href="<?php echo base_url();?>assets/css/style2.css">
 
      <title>K-Talks</title>
  </head>
  <body class="t1 logged-out ms-windows mobile-callout front-page" data-fouc-class-names="swift-loading" dir="ltr">
      
    <div id="doc" class="">
        <div class="topbar js-topbar">
  <div id="banners" class="js-banners">
  </div>
  <!--<? $this->load->view('common/header');?>--> 
  <div class="global-nav" data-section-term="top_nav">
    <div class="global-nav-inner">
      <div class="container">

        
          </div>

      </div>
    </div>
  </div>

</div>

        <div id="page-outer">
          <div id="page-container" class=" wrapper-front white">
                <div class="BannersContainer">

  </div>

            <div class="front-container " id="front-container">
        
<div class="front-card">
  <div class="front-welcome ">
   
    <div class="callout-copy">
      <h1>Welcome To Kea Talks.</h1>
      <p>Kea talks helps you to connect and share with the people in your Kea life.</p>
    </div>
 
  </div>
  
  <div class="front-signin js-front-signin">
  <form action="<?php echo base_url();?>index.php/user/signin" class="signin" method="post" id="signin">
    <div class="username">
      <input type="text" id="signin-email" required class="text-input email-input" name="email" autocomplete="on" placeholder="Email">
    </div>

    <table class="flex-table password-signin">
      <tbody>
      <tr>
        <td class="flex-table-primary">
          <div class="password flex-table-form">
            <input type="password" id="signin-password" required class="text-input flex-table-input" name="password" placeholder="Password">
          </div>
        </td>

        <td class="flex-table-secondary">
          <button type="submit" class="submit btn primary-btn flex-table-btn js-submit">
            Sign in
          </button>
        </td>
      </tr>
      </tbody>
    </table>

    <div class="remember-forgot">
      
      <span class="separator">·</span>
      <a class="forgot" href="/account/resend_password">Forgot password?</a>
    </div>

  </form>
</div>
  <div class="front-signup js-front-signup ">
  <h2><strong>New to Kea talks?</strong> Sign up</h2>

  <form action="<?php echo base_url();?>index.php/user/signup" class="signup" method="post" id="signup">

    <div class="field">
      <input type="text" class="text-input" id="signup-name" required autocomplete="off" name="name" maxlength="20" placeholder="Full name">
    </div>
    <div class="field">
      <input type="text" id="signup-email" required class="text-input email-input" autocomplete="off" name="email" placeholder="Email">
    </div>
    <div class="field">
      <input type="password" id="signup-password" required class="text-input" name="password" placeholder="Password">
    </div>
  
    <button type="submit" class="btn signup-btn u-pullRight">
      Sign up for Kea talks
    </button>
  </form>
</div>

</div>
  
</div>

          </div>
        </div>
      
    </div>
    
<a  class="big-link"  data-reveal-id="myModal" id="myMod"  style="display:none;" data-animation="fade">
      Fade
    </a>
  <div id="myModal" class="reveal-modal" >
      <div id="ak"><label id="pklabel" class="floatingleft" style="margin-top: 6px;margin-left: 115px;color:#ff4d4d !important"> Wrong username or password </label></div>


</div>


      <a class="close-reveal-modal">×</a>
    </div>


  <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>

<script type="text/javascript" src="<?php echo base_url();?>assets/js/bootstrap.min.js"> </script>    

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

   <script>
   $(document).ready(function(){
    $("#signin").submit(function(e){
e.preventDefault();

var asad=document.getElementById("signin-email").value;
var ahti=document.getElementById("signin-password").value;

     $.ajax({
type: "POST",
url:  "<?php echo base_url();?>index.php/user/login",
data: { username:asad,password:ahti },
success: function(data){

if(data == "1"){

window.location="<?php echo base_url(); ?>";

} 
else{
document.getElementById("pklabel").innerHTML="Wrong username or password";
document.getElementById("myMod").click();

}  
   
},
error:function(x,e)
{

if(x.status==0){
alert('You are offline!!\n Please Check Your Network.');
}else if(x.status==404){
alert('Requested URL not found.');
}else if(x.status==500){
alert('Internal Server Error.');
}else if(e=='parsererror'){
alert('Error.\nParsing JSON Request failed.');
}else if(e=='timeout'){
alert('Request Time out.');
}else {
alert('Unknow Error.\n'+x.responseText);
}
},

dataType: 'html'

});


   });
  });
   
      $(document).ready(function(){
    $("#signup").submit(function(e){
e.preventDefault();

var ass=document.getElementById("signup-name").value;
var asad=document.getElementById("signup-email").value;
var ahti=document.getElementById("signup-password").value;

     $.ajax({
type: "POST",
url:  "<?php echo base_url();?>index.php/user/getdetails",
data: { username:ass,password:ahti,email:asad },
success: function(data){

if(data == 1){

window.location="<?php echo base_url();?>index.php/user/completeprofile";

} 
else{
document.getElementById("pklabel").innerHTML="Email address already exists";
document.getElementById("myMod").click();

}  
   
},
error:function(x,e)
{

if(x.status==0){
alert('You are offline!!\n Please Check Your Network.');
}else if(x.status==404){
alert('Requested URL not found.');
}else if(x.status==500){
alert('Internal Server Error.');
}else if(e=='parsererror'){
alert('Error.\nParsing JSON Request failed.');
}else if(e=='timeout'){
alert('Request Time out.');
}else {
alert('Unknow Error.\n'+x.responseText);
}
},

dataType: 'html'

});

   });
  });

   </script>

</body>
</html>
 
Esaminando la richiesta asincrona che viene lanciata al click sul tasto, la causa del tuo problema è scritta sufficientemente in chiaro:
HTML:
<h1>A Database Error Occurred</h1>
<p>Error Number: 1054</p><p>Unknown column 'fullname' in 'field list'</p><p>INSERT INTO `user` (`fullname`, `email`, `password`) VALUES ('flameseeker', 'myemail@email.it', 'mypassword')</p>
<p>Filename: /home/jaku0260/public_html/models/user_model.php</p><p>Line Number: 50</p>

Nella tabella user non esiste una colonna chiamata fullname.
 
Grazie mille per l'aiuto, ma scusa l'ignoranza come hai ottenuto questo risultato? come hai esaminato la richiesta? Cmq ancora grazie
Esaminando la richiesta asincrona che viene lanciata al click sul tasto, la causa del tuo problema è scritta sufficientemente in chiaro:
HTML:
<h1>A Database Error Occurred</h1>
<p>Error Number: 1054</p><p>Unknown column 'fullname' in 'field list'</p><p>INSERT INTO `user` (`fullname`, `email`, `password`) VALUES ('flameseeker', 'myemail@email.it', 'mypassword')</p>
<p>Filename: /home/jaku0260/public_html/models/user_model.php</p><p>Line Number: 50</p>

Nella tabella user non esiste una colonna chiamata fullname.
 
Utilizzando Firebug su Firefox (ma anche Chrome ha i suoi strumenti di sviluppo, premendo F12) vengono elencate le richieste asincrone effettuate dalla pagina nella console, da lì è possibile vedere l'output di risposta di queste richieste.
 

Discussioni simili