Jump to content

Query failed only on IE browser


Recommended Posts

My goal is to move an PHP application from a Windows Server 2000 - SQL Server 2005 - Apache 2.2 to a new a server with Windows Server 2012 - SQL Server 2012 - Apache 2.2.


On the new server I've installed and configured SQL Server 2012 - Apache 2.2 and PHP 5.2.9.


I copied the application and the database on the new server.


Unfortunately the application didn't work with Internet Explorer. I cannot access to my application account because it failed on the login form. It works with Firefox and Chrome.


I can read on the Apache log : PHP Warning: mssql_query() [function.mssql-query]: message: Incorrect syntax near '='. (severity 15)


I tried the application under PHP 5.4 and Apache 2.4 using the ODBC library for handling requests. I meet again the same error with Internet Explorer.


On the old server the application work fine with IE7-8-9-10.


Somebody can help me ?


Regards


Link to comment
Share on other sites

best guess is because different browsers can submit different form data for the same html markup and your code needs to take that into account.

 

you need to debug what data is actually being submitted and what your code is doing with that data. if you want us to help, you will need to post the relevant form and form processing code.

Link to comment
Share on other sites

Hello,

 

Here is the form

 



<fieldset class="fld_type" style="width:80%;">
<legend class="lgd_style">Connexion - Inscription</legend>
<table align="center">
<?php if(!empty($erreur)){ ?>
<tr>
<td align="right" colspan="3" style="color:red; font-size:14px;" ><?php echo $erreur; ?></td>
</tr>
<?php } ?>
<tr><td> </td></tr>
<tr>
<td rowspan="4"><img style="height:90px;" src="images/connect.png" alt="Authentification" /></td>
<td class="right"><b>Nº Panéliste (identifiant):</b></td>
<td><input style="border:1px solid #0075bc;" onFocus="modif_champs(this);" onBlur="default_champs(this);" type="text" id="txt_login" name="txt_login" /></td>
</tr>
<tr>
<td class="right"><b>Mot de passe :</b></td>
<td><input style="border:1px solid #0075bc;" onFocus="modif_champs(this);" onBlur="default_champs(this);" type="password" id="txt_mdp" name="txt_mdp" /></td>
</tr>
<tr>
<td></td>
<td><a class="strong" href="#MDPOublie" onClick="$('formMDPOublie').appear();Effect.ScrollTo('MDPOublie'); return false;" >Mot de passe oublié ?</a></td>
</tr>
<tr>
<td></td>
<td>
<!--<input onClick="verifLoginMDP(this.form);" type="button" value="Se connecter" id="btn_valider" name="btn_valider" class="btn_style" />-->
<input type="submit" value="Se connecter" id="btn_valider" name="btn_valider" class="btn_style" />
</td>
</tr>
<tr><td colspan="3"><hr style="color:white;" /></td></tr>
</table>
<table align="center">
<tr>
<td align="right"><a href="questionnaire_consommation/form_inscriptionPaneliste.php"><img style="height:40px; width:40px; " src="images/addP2.png" alt="Nouveau ?" /></a></td>
<td><a class="strong" href="questionnaire_consommation/form_inscriptionPaneliste.php">Vous n'êtes pas encore inscrit ?</a></td>
</tr>
</table>
</fieldset>


 

Here is the php code that handle the login

 



    if(isset($_POST['txt_login']) AND isset($_POST['txt_mdp'])){
    $login = Securite::bdd($_POST['txt_login']);
    $mdp = md5($_POST['txt_mdp']); // cryptage du mot de passe
    $erreur = "";
   
    /* Verification de l'utilisateur
    *********************************/
    $requeteVerif = "SELECT COUNT(*) FROM paneliste WHERE PANELISTE_LOGIN = '" . $login . "' AND PANELISTE_MDP = '" . $mdp . "'";
    $stmtVerif = ExecRequete($requeteVerif, Connexion());
    $donneesVerif = ObjetSuivant($stmtVerif);
   
    if($donneesVerif[0] == 0){
    //Le paneliste n'est pas referencé dans la base de données
    $erreur = "Les identifiants de connexion sont incorrects !";
    }else{
    $requeteIDPaneliste = "SELECT PANELISTE_ID, PANELISTE_TYPE, PANELISTE_DATENAISS, SITE_ID FROM paneliste WHERE PANELISTE_LOGIN = '" . $login . "' AND PANELISTE_MDP = '" . $mdp . "'";
    $stmtIDPaneliste = ExecRequete($requeteIDPaneliste, Connexion());
    $IDPaneliste = ObjetSuivant($stmtIDPaneliste);
    $_SESSION['id_paneliste'] = $IDPaneliste[0];
    $_SESSION['site_id'] = $IDPaneliste[3];
    $_SESSION['type_user'] =  $IDPaneliste[1];
    $_SESSION['type_questionnaire'] = getTypeQuestionnaire($IDPaneliste[2]);
    
    // Correction de l'erreur #90 : Des références au site de Vandoeuvre (e-mail et téléphone) apparaissent quelque soit le site de rattachement du panéliste.
    // A la connexion, on enregistre donc ces valeurs en session.
    $siteInfo = recupererSiteInfo($_SESSION['id_paneliste']);
    $_SESSION['site_admin_nom'] = $siteInfo['SITE_ADMIN_NOM'];
    $_SESSION['site_admin_prenom'] = $siteInfo['SITE_ADMIN_PRENOM'];
    $_SESSION['site_tel'] = $siteInfo['SITE_TEL'];
    $_SESSION['site_email'] = $siteInfo['SITE_EMAIL'];
    $_SESSION['site_horaires'] = $siteInfo['SITE_HORAIRES'];
    
    // Correction de l'erreur #132 : Certains panélistes ne peuvent accéder au site, car la variable de session est effacée après une redirection par header().
    session_write_close();
    
    header("Location: /partie_paneliste/accueil_paneliste.php");
    }
    }
    
    afficheEnTete("Espace de Connexion", "");


    

    

Here is the php code that execute query

 

  


  <?php
    
    // Execution d'une requête SQL
    function ExecRequete($requete, $connexion){
    
    $resultat = mssql_query($requete, $connexion);
   
    if($resultat){
    return $resultat;
    }
    else{
    echo "<b>Erreur dans l'execution de la requete '$requete' .</b>";
    exit;
    }
    } // Fin de la fonction ExecRequete
    
    //Recherche de l'objet suivant
    function ObjetSuivant($resultat){
    return mssql_fetch_array($resultat);
    }
    
    //Recherche de la ligne suivante (retourne un tableau)
    function LigneSuivante($resultat){
    return mssql_fetch_assoc($resultat);
    }
    
    // Correction de l'erreur #187 : Erreur SQL lors de la mise à jour des fréquences de consommation.
    // Nombre d'enregistrements trouvés
    function Nombre($resultat){
    return mssql_num_rows($resultat);
    }
    
    ?>

 

It fails on line 


$resultat = mssql_query($requete, $connexion);

 

Link to comment
Share on other sites

Add some more debug information to the ExecRequete function

// Execution d'une requête SQL
    function ExecRequete($requete, $connexion){
    
    $resultat = mssql_query($requete, $connexion) or echo('<p style="border:red 2px solid;padding:10px">DEBUG QUERY: <pre>' . $requete . '</pre></p>');
     
     if($resultat){
     return $resultat;
     }
     else{
     echo "<b>Erreur dans l'execution de la requete '$requete' .</b>";
     exit;
     }
    } // Fin de la fonction ExecRequete
Edited by Ch0cu3r
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.