Exploiter le script d'une page web
Fermé
Tikooo
-
11 mai 2012 à 20:19
Navid_92 Messages postés 711 Date d'inscription dimanche 7 décembre 2008 Statut Membre Dernière intervention 12 février 2015 - 11 mai 2012 à 22:01
Navid_92 Messages postés 711 Date d'inscription dimanche 7 décembre 2008 Statut Membre Dernière intervention 12 février 2015 - 11 mai 2012 à 22:01
A voir également:
- Exploiter le script d'une page web
- Supprimer une page word - Guide
- Web office - Guide
- Script vidéo youtube - Guide
- Traduire une page web - Guide
- Faire une capture d'écran d'une page web entière - Guide
2 réponses
Navid_92
Messages postés
711
Date d'inscription
dimanche 7 décembre 2008
Statut
Membre
Dernière intervention
12 février 2015
87
11 mai 2012 à 22:01
11 mai 2012 à 22:01
iframe c'est le mal :)
Pour ce faire, tu vas utilisé la librairie cURL de PHP.
Tu met un formulaire sur ton site.
Tu stocke les $_POST dans des variables un un htmlspecialchars pour la sécurité.
Après tu l'envois avec curl vers le site officiel.
=====
$post = array(
'ORIGIN_CITY' => htmlspecialchars($_POST['ORIGIN_CITY']),
'DESTINATION_CITY' => htmlspecialchars($_POST['DESTINATION_CITY']),
'VIA_CITY' => htmlspecialchars($_POST['VIA_CITY'])
);
function cURL_Reponse($url, $data) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
return !curl_errno($ch) ? $response : curl_error($ch);
}
/* Là il faut que tu mette l'action "" du moteur de recherche de billet. */
$responseSite = cURL_Reponse('http://voyages.com/rechercher', $post);
echo $responseSite;
=====
Pour ce faire, tu vas utilisé la librairie cURL de PHP.
Tu met un formulaire sur ton site.
Tu stocke les $_POST dans des variables un un htmlspecialchars pour la sécurité.
Après tu l'envois avec curl vers le site officiel.
=====
$post = array(
'ORIGIN_CITY' => htmlspecialchars($_POST['ORIGIN_CITY']),
'DESTINATION_CITY' => htmlspecialchars($_POST['DESTINATION_CITY']),
'VIA_CITY' => htmlspecialchars($_POST['VIA_CITY'])
);
function cURL_Reponse($url, $data) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
return !curl_errno($ch) ? $response : curl_error($ch);
}
/* Là il faut que tu mette l'action "" du moteur de recherche de billet. */
$responseSite = cURL_Reponse('http://voyages.com/rechercher', $post);
echo $responseSite;
=====
tryan44
Messages postés
1288
Date d'inscription
mardi 24 janvier 2012
Statut
Membre
Dernière intervention
26 octobre 2014
220
11 mai 2012 à 21:13
11 mai 2012 à 21:13
Salut,
Troisième option, utiliser une simple iframe ...
Troisième option, utiliser une simple iframe ...