Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
3093 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  Requête à un serveur https

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Requête à un serveur https

n°1680449
hacksi
Posté le 01-02-2008 à 14:23:18  profilanswer
 

Bonjour,
 
j'ai cherché un peu sur google et je ne trouve pas grand chose, je voudrais savoir comment envoyer une requête post en PHP à un serveru HTTPS ?
 
Merci

mood
Publicité
Posté le 01-02-2008 à 14:23:18  profilanswer
 

n°1680451
flo850
moi je
Posté le 01-02-2008 à 14:23:43  profilanswer
 

tu as essayé avec CURL ?


---------------

n°1680452
hacksi
Posté le 01-02-2008 à 14:24:04  profilanswer
 

c'est quoi ??? lol

n°1680462
hacksi
Posté le 01-02-2008 à 14:32:50  profilanswer
 

ça à l'air bien tendu...

n°1680472
anapajari
s/travail/glanding on hfr/gs;
Posté le 01-02-2008 à 14:49:49  profilanswer
 

mais non ... lol


---------------
Software and cathedrals are much the same - first we build them, then we pray.
n°1680473
hacksi
Posté le 01-02-2008 à 14:50:40  profilanswer
 

Faut juste que j'envoie une requête post sur un serveur https en utilisant un certificat...

n°1681259
hacksi
Posté le 04-02-2008 à 09:14:55  profilanswer
 

Code :
  1. // Création d'une instance de cUrl
  2. $aCUrl = curl_init();
  3. curl_setopt($aCUrl, CURLOPT_URL, "******" );
  4. curl_setopt($aCUrl, CURLOPT_SSLVERSION, 3);
  5. curl_setopt($aCUrl, CURLOPT_POST, 1);
  6. curl_setopt($aCUrl, CURLOPT_POSTFIELDS, "user_id=".$donnees['id']."&user_name=".$donnees['***']." ".$donnees['***]."&user_phone=".$donnees['***]."&user_email=".$donnees['***']);
  7. curl_setopt($aCUrl, CURLOPT_SSL_VERIFYPEER, 1);
  8. curl_setopt($aCUrl, CURLOPT_CAINFO, "c:/Program Files/wamp/www/cert.crt" );
  9. curl_setopt($aCUrl, CURLOPT_USERAGENT, $defined_vars['HTTP_USER_AGENT']);
  10. // Requete
  11. curl_exec($aCUrl);
  12. $sErr = curl_error($aCUrl);
  13. // Nettoyage
  14. curl_close($aCUrl);
  15. printf($sErr);


 
Est ce que tout cela est correct ?

n°1681264
hacksi
Posté le 04-02-2008 à 10:10:07  profilanswer
 

Code :
  1. curl_setopt($aCUrl, CURLOPT_URL, "*****" );
  2. curl_setopt($aCUrl, CURLOPT_SSLVERSION, 3);
  3. curl_setopt($aCUrl, CURLOPT_POST, 1);
  4. curl_setopt($aCUrl, CURLOPT_POSTFIELDS, http_build_query($_POST));
  5. curl_setopt($aCUrl, CURLOPT_POSTFIELDS, "user_id=".$donnees['***']."&user_name=".$donnees['****']." ".$donnees['****']."&user_phone=".$donnees['****']."&user_email=".$donnees['****']);
  6. curl_setopt($aCUrl, CURLOPT_SSL_VERIFYPEER, 0);
  7. curl_setopt($aCUrl, CURLOPT_CAINFO, "c:/Program Files/wamp/www/cert.crt" );
  8. curl_setopt($aCUrl, CURLOPT_RETURNTRANSFER, TRUE);
  9. curl_setopt($aCUrl, CURLOPT_USERAGENT, $defined_vars['HTTP_USER_AGENT']);


 
Cela fonctionne mais comment exploter une réponse http en XML...


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  Requête à un serveur https

 

Sujets relatifs
Requête complexeServeur VOD
impression du resultat d'une requete[mysql] Requete avec moyenne avg
Integration Open Office serveur[Résolu] Aide requête SQL: item n'appartenant pas à une catégorie
Probleme pour mise en place d'un site sur serveur ftp numericable[PHP] affichage requete ODBC dans un tableau
Requête SQL + Opération sur TimestampEnvoi de requête grâce à un select
Plus de sujets relatifs à : Requête à un serveur https


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR