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

  FORUM HardWare.fr
  Programmation
  PHP

  probleme de redirection

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

probleme de redirection

n°1959458
mafarette
bonne annee 2010
Posté le 21-01-2010 à 16:12:46  profilanswer
 

bonjour
j'ai un probleme de redirection
 
if(send_sms($cible,$message,$image))  {echo("sms ok au : $cible"
   header('http://localhost:8888/MMS/p3.php');  
    }  else echo("Impossible de trouver le token ou message trop long. Message non transmis. Mauvais logins ?" );
 
 
 
merci


---------------
pierre mafarette
mood
Publicité
Posté le 21-01-2010 à 16:12:46  profilanswer
 

n°1959459
deliriumtr​emens
sic transit intestinal...
Posté le 21-01-2010 à 16:27:09  profilanswer
 

Code :
  1. if(send_sms($cible,$message,$image))  {echo("sms ok au : $cible"
  2.    header('http://localhost:8888/MMS/p3.php');

 
 
On n'écrit rien avant la redirection. Donc soit tu fait un vil pop-up js qui, à la fermeture, lance la redirection, soit tu écris ton message de confirmation sur la page cible de la redirection.

n°1959460
kao98
...
Posté le 21-01-2010 à 16:29:54  profilanswer
 

Et pour faire une redirection avec header, il faut mettre "location: http://xxxxx".


---------------
Kao ..98 - Uplay (R6S) : kao98.7.62x39 - Origin (BF4, BF1) : kntkao98
n°1959488
mafarette
bonne annee 2010
Posté le 21-01-2010 à 18:14:17  profilanswer
 

kao98 a écrit :

Et pour faire une redirection avec header, il faut mettre "location: http://xxxxx".


 
 
comme ceci
 
  $message = "bonjour campus-descartes.net vous souhaite une bonne annee 2010 et bientot sur notre site ";
$image =  "http://localhost:8888/MMS/image1.jpg";
if(send_sms($cible,$message,$image))  {echo("sms ok au : $cible"
   header('location: http://localhost:8888/MMS/p3.php');  
    }  else echo("Impossible de trouver le token ou message trop long. Message non transmis. Mauvais logins ?" );
 
 


---------------
pierre mafarette
n°1959497
mafarette
bonne annee 2010
Posté le 21-01-2010 à 18:40:29  profilanswer
 

en faite voila je voudrais faire une boucle du programme complait tant que la valeur $cible < $ciblefin  
et add 1 dans $cible  
retour au programme  
le programme marche tres bien mais ???  
la 1er page  demande:  
$cible  
$ciblefin  
 et je récupère an post  
je pense a un solution  
page 1  donnée  
page  2 traitement  
page 3  
verification  
$cible<$ciblefin  
retour page 2  
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />  
<title>Untitled Document</title>  
</head>  
 
<body>  
 
 
 
<?php  
 
$ciblefin = $_POST['$ciblefin'];  
$cible = $_POST['$cible'];  
 
disons ici    
 
Define('AUTHENTIFICATION', 'http://------------------------------------------------/');  
Define('COOKIE_FILE','cookie.txt');        
Define('EMPTY_FILE',"emptyfile.txt" );      
Define('USER_AGENT','Mozilla/5.0');        
Define('LOGIN','---------');        
Define('PASSWORD','-------');  
 
 
 
 
 
 
$message = "Message à envoyer blllllllllllllllllllllllaaaaaaaaaaaaaaaaaa";  
$image =  "image1.jpg";  
if(send_sms($cible,$message,$image)) echo("sms ok au : $cible" );  
else echo("Impossible de trouver le token ou message trop long. Message non transmis. Mauvais logins ?" );  
 
/  
function send_sms($cible,$message,$image)  
{  
 //Encodage d  
 $message = utf8_decode($message);  
   
 $ch = curl_init();  
   
 // set url  
 curl_setopt($ch, CURLOPT_URL, AUTHENTIFICATION);  
 curl_setopt($ch, CURLOPT_COOKIEJAR, realpath(COOKIE_FILE));  
 curl_setopt($ch, CURLOPT_COOKIEFILE, realpath(COOKIE_FILE));  
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);  
 curl_setopt($ch, CURLOPT_COOKIESESSION, TRUE);  
 curl_setopt($ch, CURLOPT_USERAGENT, USER_AGENT);  
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  
   
 // $output contains the output string  
 $output = curl_exec($ch);  
   
 curl_close($ch);  
   
 $ch = curl_init();  
 curl_setopt($ch, CURLOPT_URL, "https://www.------------------------------spring_cas_security_check" );  
 curl_setopt($ch, CURLOPT_POST, TRUE);  
 curl_setopt($ch, CURLOPT_POSTFIELDS,"target=&_eventId=&currentPage=&username=".LOGIN."&password=".PASSWORD);  
 curl_setopt($ch, CURLOPT_COOKIEJAR, realpath(COOKIE_FILE));  
 curl_setopt($ch, CURLOPT_COOKIEFILE, realpath(COOKIE_FILE));  
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);  
 curl_setopt($ch, CURLOPT_COOKIESESSION, TRUE);  
 curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);  
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);  
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  
   
 $ret = curl_exec($ch);  
   
 curl_setopt($ch, CURLOPT_URL, "----------/index.do" );  
 
   
 $ret = curl_exec($ch);  
   
 if ($ret === FALSE) {  
     die(curl_errno($ch));  
 }  
   
 preg_match("!\"CSRFToken\" value=\"([0-9]*)!",$ret,$out);  
   
 if(!isset($out[1]))  
 {  
  return 0;  
 }  
   
 $token = $out[1];  
   
 $array = Array(  
 "CSRFToken" => $token,  
 "idMessage" => '',  
 "submitMethod" => 'web',  
 "todo" => '',  
 "boxId" => 'sent',  
 'galleryItem' => '-1',  
 'msisdns' => $cible,  
 'emails' => '',  
 'emoticones' => '',  
 'message' => $message,  
 'file' => '@'.realpath(EMPTY_FILE)  
 );  
   
 curl_setopt($ch, CURLOPT_URL, "http://www.-------------------------------------------/submit.do" );  
 curl_setopt($ch, CURLOPT_COOKIEJAR, realpath(COOKIE_FILE));  
 curl_setopt($ch, CURLOPT_COOKIEFILE, realpath(COOKIE_FILE));  
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);  
 curl_setopt($ch, CURLOPT_COOKIESESSION, TRUE);  
 curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);  
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);  
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  
 curl_setopt($ch, CURLOPT_POST, TRUE);  
 curl_setopt($ch, CURLOPT_POSTFIELDS,$array);  
 $ret = curl_exec($ch);  
 
 preg_match("!\"CSRFToken\" value=\"([0-9]*)!",$ret,$out);  
 $token = $out[1];  
   
 //Confirmation  
 $array = Array(  
 "CSRFToken" => $token,  
 "idMessage" => '',  
 "submitMethod" => 'web',  
 "todo" => '',  
 "boxId" => 'sent',  
 'emoticones' => '',  
 'mms' => 'false',  
 'message' => $message  
 );  
   
 curl_setopt($ch, CURLOPT_URL, "http://www.-----------------------------------------------------------------" );  
 curl_setopt($ch, CURLOPT_POST, TRUE);  
 curl_setopt($ch, CURLOPT_POSTFIELDS,$array);  
 $ret = curl_exec($ch);  
 curl_close($ch);  
 
 if(strpos($ret,"Le Texto a &eacute;t&eacute; exp&eacute;di&eacute; avec succ&egrave;s&nbsp;!" ) === false) return 0;  
 else return 1;  
   
 return 1;  
 }  
 
 
 
?>  
 
 
</body>  
</html>


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

  probleme de redirection

 

Sujets relatifs
Problème de redirection 301 avec paramètresprobleme de redirection nordnet
Problème redirection automatique et méthode POSTProbleme de redirection avec OVH et classe
Problème redirection .tkProblème redirection 301 htaccess
[HTML] Problème de redirection[PHP] probleme de redirection
[?PHP,HTML,JAVA?] problème avec une redirection[HTML] probleme redirection ok sous firefox mais pas sous IE
Plus de sujets relatifs à : probleme de redirection


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