Précédent   Forum des professionnels en informatique > PHP > Langage > Débuter
Débuter Forum d'entraide pour débuter en PHP. Avant de poster -> Cours PHP, FAQ PHP, Outils PHP, etc.
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 05/10/2011, 01h36   #1
Candidat au titre de Membre du Club
 
Inscription : juillet 2009
Messages : 193
Détails du profil
Informations personnelles :
Localisation : France

Informations forums :
Inscription : juillet 2009
Messages : 193
Points : 12
Points : 12
Par défaut erreur Warning en modifiant un dossier .txt

Bonjour
J'ai un souci que je n'arrive pas a résoudre.
j'ai pourtant rien touché en particulier je me suis connecter pour envoyer des masse mail tout fonctionné bien sauf l'envoie de mail mais y avait aucune erreur.
J'ai donc décidé de faire une sauve garde avant de modifier un simple fichier .txt donc rien de spécial ou méchant et depuis j'ai toute c'est erreur que je ne trouve pas comment les réparées.

Ps: Je suis sur free

Liste erreurs :

Citation:
Warning: main() [function.main]: open_basedir restriction in effect. File(/mnt/104/sdb/7/d/ub33/photo/inc/config.php) is not within the allowed path(s): (/mnt/170/sdc/7/d/ub33) in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 3

Warning: main(/mnt/104/sdb/7/d/ub33/photo/inc/config.php) [function.main]: failed to open stream: Operation not permitted in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 3

Warning: main() [function.include]: Failed opening '/mnt/104/sdb/7/d/ub33/photo/inc/config.php' for inclusion (include_path='/mnt/170/sdc/7/d/ub33/include:.:/usr/php4/lib/php') in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 3

Warning: main() [function.main]: open_basedir restriction in effect. File(/mnt/104/sdb/7/d/ub33/photo/inc/fonctions.php) is not within the allowed path(s): (/mnt/170/sdc/7/d/ub33) in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 4

Warning: main(/mnt/104/sdb/7/d/ub33/photo/inc/fonctions.php) [function.main]: failed to open stream: Operation not permitted in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 4

Warning: main() [function.include]: Failed opening '/mnt/104/sdb/7/d/ub33/photo/inc/fonctions.php' for inclusion (include_path='/mnt/170/sdc/7/d/ub33/include:.:/usr/php4/lib/php') in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 4

Warning: main() [function.main]: open_basedir restriction in effect. File(/mnt/104/sdb/7/d/ub33/photo/admin/hpage.php) is not within the allowed path(s): (/mnt/170/sdc/7/d/ub33) in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 5

Warning: main(/mnt/104/sdb/7/d/ub33/photo/admin/hpage.php) [function.main]: failed to open stream: Operation not permitted in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 5

Warning: main() [function.include]: Failed opening '/mnt/104/sdb/7/d/ub33/photo/admin/hpage.php' for inclusion (include_path='/mnt/170/sdc/7/d/ub33/include:.:/usr/php4/lib/php') in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 5

Warning: file_exists() [function.file-exists]: Unable to access /mnt/104/sdb/7/d/ub33/photo/admin/mailing/mailing_list.txt in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 33

Warning: file_exists() [function.file-exists]: Unable to access /mnt/104/sdb/7/d/ub33/photo/admin/mailing/mailing_list.txt in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 96
Ici le 1er code (admin_message.php)

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<?php
 
include_once ('/mnt/104/sdb/7/d/ub33/photo/inc/config.php');
include_once ('/mnt/104/sdb/7/d/ub33/photo/inc/fonctions.php');
include_once ('/mnt/104/sdb/7/d/ub33/photo/admin/hpage.php');
 
 
if (!empty($_GET))
  {myExtract($_GET, $GLOBALS);}
else if (!empty($HTTP_GET_VARS))
  {myExtract($HTTP_GET_VARS, $GLOBALS);}
if (!empty($_POST))
  {myExtract($_POST, $GLOBALS);}
else if (!empty($HTTP_POST_VARS))
  {myExtract($HTTP_POST_VARS, $GLOBALS);}
 
$racine_mailing="/mnt/104/sdb/7/d/ub33";
$mailing_fichier="/photo/admin/mailing/mailing_list.txt";
$mailing_text="/photo/admin/mailing/mailing_message.txt";
$num_ligne = 0 ;
 
 
 
  if ($option == "arreter") {
	if ($_GET['fichier']) {
		unlink($_GET['fichier']); 
		unlink($racine_mailing.$mailing_text); 
		echo "<div style='font-size: 18px; text-align: center; padding-top:25%;'>Suppression du fichier: ".$_GET['fichier']." demand&eacute;<br />";
		echo "Le mailing est annul&eacute;<br />";
		if (file_exists($racine_mailing.$mailing_fichier)) { echo "Une erreur est survenue: Le fichier ".$_GET['fichier']." existe toujours !!"; } else { echo "Le fichier ".$_GET['fichier']." a bien été supprim&eacute"; }		
	}
} else {
	if (file_exists($racine_mailing.$mailing_fichier)) { $affichage="no"; echo "<meta http-equiv='Refresh' content='$delais_mail; url=admin_message.php' />"; }	
	if (!$_POST['Submit'] && $affichage!="no") {
 
?>
 
 
<link rel="stylesheet" type="text/css" href="img/ajout.css"/>
<link rel="stylesheet" type="text/css" id="styles"/>
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css" media="all">
@import url("img/style.css");
</style>
<body>
<div id="content">
  <form method="post" name="mailing" id="mailing">
 
 
    <input type="hidden" name="date" value="<?php echo date("Y-m-d H:i:s") ?>" />
 
	<table>
      <tr>
		  <td class='noir' style="width: 100%; text-align: left; font-size: 18px;">Envoyer un mailing </td></tr>
		  <tr><td colspan='5' style="text-align: center;">
				<table>
 
						<tr><td style="white-space: nowrap; vertical-align: top;">Contenu du mail :</td></tr>
						<tr>
							<td><textarea cols="62" rows="12" name="texte"></textarea></td>
							<td>
								<table style="text-align: left;">
									<tr><td><input type="radio" name="choix" value="Membres" />Liste Membre
									<br /><input type="radio" name="choix" value="Spamlist" />Pub-list</td></tr>
									<tr><td><select name="choix_fichier"> 
		<?php 	
				$dir="/mnt/104/sdb/7/d/ub33/photo/admin/mailing/liste";
				if ($handle = opendir($dir)) {
					while (false !== ($file = readdir($handle))) {
						if ($file != "." && $file != "..") { echo "<option value='".$file."'>".$file."</option> "; }
						}   
					closedir($handle);
				} 
		?>
 
									</select></td></tr>
								</table>		
							</td>
						</tr>
 
						<tr><td style="text-align: center; padding-top: 25px;"><input type="submit"  onclick="javascript:window.location='admin_message.php';" name="Submit" value="Envoyer le mail" />
							<input type="hidden" name="MM_insert" value="add" /></td>
						</tr>
				</table></td>
			<td style="width: 15%;">&nbsp;</td>
		</tr>
	</table>
  </form>
</div>
<center>
</body>
</html>
 
<?php
}
  if (file_exists($racine_mailing.$mailing_fichier)) { 
 
	$mailing_en_cours = 1;
	echo "<br /><br /><br />";
 
	envoi_mailing($racine_mailing ,$mailing_fichier, $mailing_text);
 
	exit;
 
} else {
 
	if ($_POST['Submit']) {
		if (!$_POST['choix'])  { 
			echo "<div style='font-size: 18px; padding-top: 25%; text-align: center;'>Tu dois selectionner une liste de diffusion<div><br /><a class='ferm_button' href='javascript:history.back()'><span style='margin-left: 5%;'>[ Page pr&eacute;c&eacute;dente ]</span></a><br /><br />"; exit; 
	  } else if ($_POST['texte'] == "") { 
			echo "<div style='font-size: 18px; padding-top: 25%; text-align: center;'>Tu n'as pas saisi de message !!<div><br /><a class='ferm_button' href='javascript:history.back()'><span style='margin-left: 5%;'>[ Page pr&eacute;c&eacute;dente ]</span></a><br /><br />"; exit; 
	  } else {
		echo "<meta http-equiv='Refresh' content='$delais_mail; url=admin_message.php' />";
 
			$objet_mail = str_replace(array(";","\n","\r")," ",$_POST['texte']);
			$list_mailing = "MESSAGE: ".$objet_mail."\n";
			$post_message = $_POST['texte'];
			$post_message = stripslashes($post_message);
			$texte_message ="<html><head></head><body>";
			$texte_message .= $post_message."</body>"; 
 
 
 
			if ($_POST['choix'] == "Membres") {
				$requete = "SELECT `idx`, `pseudo`, `email`, `sexe` FROM trombino_trombino";
				$act_requete = mysql_query($requete) or die(mysql_error());
				$mass_mail = mysql_fetch_assoc($act_requete); 
				do { 
					$list_mailing .= $mass_mail['email'].":".$mass_mail['pseudo']."\n";
			  } while ($mass_mail = mysql_fetch_assoc($act_requete)); 
			}
			if ($_POST['choix'] == "Spamlist") {
				$racine="/mnt/104/sdb/7/d/ub33/photo/admin/mailing/liste/";
				$content .= file_get_contents($racine.$_POST['choix_fichier']); 
				$list_mailing .= str_replace(";", "\n", $content);
			}
 
			if (!$inF = fopen($racine_mailing.$mailing_text,"w")) { 
				echo "Echec de l'ouverture du fichier: ".$racine_mailing.$mailing_text."<br />"; 
				exit;
		  } else {
				fputs($inF,$texte_message); 
				fclose($inF); 
			}
			if (!$inF = fopen($racine_mailing.$mailing_fichier,"w")) { 
				echo "Echec de l'ouverture du fichier: ".$racine_mailing.$mailing_fichier."<br />"; 
				exit;
		  } else {
				fputs($inF,$list_mailing); 
				fclose($inF); 
				$contents = file_get_contents($racine_mailing.$mailing_fichier); 
				$taille_init = filesize($racine_mailing.$mailing_fichier);
				if (!$inF = fopen($racine_mailing.$mailing_fichier,"w")) { 
					echo "Echec de l'ouverture du fichier: ".$racine_mailing.$mailing_fichier."<br />"; 
					exit;
			  } else {
				$list_mailing = "Taille initial du fichier : " .$taille_init."\n";
				$list_mailing .= $contents;
				fputs($inF,$list_mailing); 
				fclose($inF); 			
				}
				envoi_mailing($racine_mailing, $mailing_fichier, $mailing_text);	
				unset($conf_post);
				}
			}
		}
	}
}
 
function envoi_mailing($racine_mailing, $mailing_fichier, $mailing_text) {
include ('/mnt/104/sdb/7/d/ub33/photo/inc/config.php');
 
	$taille=filesize($racine_mailing.$mailing_fichier);
	$tab = file($racine_mailing.$mailing_fichier); 
 
		if (!$fp = fopen($racine_mailing.$mailing_text,"r+")) { 
			echo "Echec de l'ouverture du fichier lors de la fonction lecture : ".$mailing_text."<br />"; 
			exit;
	  } else {	
			$handle = fopen($racine_mailing.$mailing_text,"r+");
			$message .= fread($handle, filesize($racine_mailing.$mailing_text));
			fclose($handle);
		}
	if (count($tab) == '2') { 
		echo "<div style='font-size:16px; text-align: center;'>Le mailing a bien été envoyé. <br /> Suppression du fichier temporaire en cours</div>"; 
		$headers = 'MIME-Version: 1.0' . "\r\n"; 
		$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 
		@mail("pervy14@hotmail.com", "TCHAT-FUSION: Fin de mailing.", 
		"Bonjour,
 
		-- Le mailing a bien été a: ".$nb_mail_env." adresses <br /> -- Avec ce message : <br /> 
 
		".$message."",$headers);
 
		unlink($racine_mailing.$mailing_fichier); 
		unlink($racine_mailing.$mailing_text); 
		exit;
		}
	else {
	echo "le message est : " .$message. ".";
		echo "<div style='font-size:16px; text-align: center; padding-top:25%;'>Un mailing est en cours d'execution.<br /><br />";
		echo "<input type=\"submit\" name=\"Annuler\" Onclick=\"javascript: window.location='admin_message.php?option=arreter&fichier=$racine_mailing$mailing_fichier';\" value=\"Stopper cet envoi\" />";
		if (!$fp = fopen($racine_mailing.$mailing_fichier,"r+")) { 
			echo "Echec de l'ouverture du fichier lors de la fonction lecture : ".$racine_mailing.$mailing_fichier."<br />"; 
			exit;
	  } else {
			$fp = fopen($racine_mailing.$mailing_fichier,"r+");
			$num_ligne=1;
			$nb_pack=$nb_mail + 2;
			while (!feof($fp)) {
 
				$buffer = trim(fgets($fp, 4096));
 
 
				if ($num_ligne == 1) { $liste = explode(":", $buffer); $prop_avancement = 100 - round(($taille/$liste['1'])*100); $liste_modif.=$buffer."\n"; echo "<br /><br /><br /><div style='font-size:20px'>Etat d'avancement : <b>" .$prop_avancement."% </b>.</div>";}
				else if ($num_ligne == 2) {  $liste_modif.=$buffer."\n"; }
				else if ($num_ligne > 2 && $num_ligne <= $nb_pack && $buffer != "") { 
					$liste = explode(":", $buffer);
					$headers = 'MIME-Version: 1.0' . "\r\n"; 
					$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 
 
					@mail("".$liste['0']."", "TCHAT-FUSION: Actualités.", $message,$headers);
 
					}
				else if ($num_ligne > $nb_pack) { $liste_modif.=$buffer."\n"; }
				$num_ligne++;
			}
			fclose ($fp);
			echo "</div>";
 
	//Réecriture du fichier modifié.
 
			if (!$fp = fopen($racine_mailing.$mailing_fichier,"w+")) { 
				echo "Echec de l'ouverture du fichier lors de la fonction ecriture: ".$racine_mailing.$mailing_fichier."<br />"; 
				exit;
		  } else {
				fwrite($fp,$liste_modif);
				fclose($fp);
				exit;
			}
		}
	}
}
?>
et ici le code du fichier : ub33/photo/inc/config.php :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
// Parametres mySQL
 
$sql_serveur = "localhost"; // Serveur mySQL
$sql_base = "ub33"; // Base de donnees mySQL
$sql_login = "ub33"; // Login de connection a mySQL
$sql_password = "Monpasse"; // Mot de passe pour mySQL
 
$site_date_j = "%d/%m/%Y"; // Format de la date (DATE_FORMAT mySQL)
$site_date_jh = "le %d/%m/%Y à %H:%i"; // Format de la date et de l'heure (DATE_FORMAT mySQL)
$graph_annee = "%Y";
$graph_annee_mois = "%m/%Y";
$graph_mois = "%m";
 
$nb_results = "12";
 
$auto_vote = "1"; // Active ou non les votes sur le trombino
$auto_mail = "1"; // Active ou non les adresses mails sur les fiches du trombino visiblement
$auto_commail = "1"; // Active ou non l'envoie de mail pour chaque nouveaux commentaire posté sur un trombino au destinataire
$auto_site = "0"; // Active ou non l'affichage du site ou blog perso sur le trombino
$site_cookie = "cookie-fusion"; // Debut de nom du cookie
$site_tags = ""; // Tags autorises dans le forum
$ton_site = "http://www.tchat-fusion.org";
$adresse = "http://ub33.free.fr/photo/";
$nbr_moi = "1"; // Nombre de mois avant qu'un trombino soit désactiver
$logo ="http://www.Tchat-Fusion.org/bnr/bnr3.jpg";
$auto_rss = "0";
 
//Mailing
$nb_mail = "5";
$delais_mail = "60";
 
// UPLOAD
$size_error = "500000";
$max_size = "8000"; // Taille max en octets du fichier
$width_max = "300"; // Largeur max de l'image en pixels
$height_max = "300"; // Hauteur max de l'image en pixels
$target = "images/"; // Repertoire cible
// Connection au serveur mySQL
$trombinoV3 = @mysql_connect($sql_serveur, $sql_login, $sql_password) or die("Connection au serveur impossible !");
@mysql_select_db($sql_base);
?>
Je vous donne la suite des fichiers plus tard pour évité de pollué avec trop de code.

Cordialement Stéphane
snip74 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 09h23   #2
Modérateur
 
Inscription : septembre 2010
Messages : 7 131
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 131
Points : 8 491
Points : 8 491
faut plutôt du relatif
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 09h26   #3
Candidat au titre de Membre du Club
 
Inscription : juillet 2009
Messages : 193
Détails du profil
Informations personnelles :
Localisation : France

Informations forums :
Inscription : juillet 2009
Messages : 193
Points : 12
Points : 12
Bonjour stealth35,
Merci de ta réponse

Mais tu attent quoi par : ?
Citation:
Envoyé par stealth35 Voir le message
faut plutôt du relatif
Cordialement Stéphane
snip74 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 09h37   #4
Responsable Développement Web

 
Avatar de Bovino
 
Homme Didier Mouronval
Développeur Web
Inscription : juin 2008
Messages : 13 807
Détails du profil
Informations personnelles :
Nom : Homme Didier Mouronval
Âge : 41
Localisation : France, Gironde (Aquitaine)

Informations professionnelles :
Activité : Développeur Web
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : juin 2008
Messages : 13 807
Points : 35 789
Points : 35 789
Si on en croit le message d'erreur, tu cherches à atteindre un répertoire (/mnt/104/) sur lequel tu n'as pas les droits puisque toi, tu es dans le /mnt/170/
__________________
Pas de question technique par MP !
Tout le monde peut participer à developpez.com, vous avez une idée, contactez-moi !
Vous possédez un blog et aimeriez diffuser vos billets sur le forum, contactez-moi !
Mes formations video2brain : La formation complète sur JavaScriptJavaScript et le DOM par la pratiquePHP 5 et MySQL : les fondamentaux
Mon livre sur jQuery
Bovino est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 09h49   #5
Candidat au titre de Membre du Club
 
Inscription : juillet 2009
Messages : 193
Détails du profil
Informations personnelles :
Localisation : France

Informations forums :
Inscription : juillet 2009
Messages : 193
Points : 12
Points : 12
Bonjour Bovino,
Merci de ta réponse

Je suis un noob dans se domaine lol je comprend pas tout
exemple : moi j'ouvre filezilla je vais dans le dossier photo et dedans j'ai tout mes dossiers et fichier comme suite.

/photo/admin
/photo images
/photo/img
/photo/inc
/photo/Smileys
/photo/index.php
/photo/style.php
Etc...

Donc je comprend vraiment pas d'où sort (/mnt/104/) etc...
Et surtout comment réglé se problème car je mi connais pas assez :/

Citation:
Envoyé par Bovino Voir le message
Si on en croit le message d'erreur, tu cherches à atteindre un répertoire (/mnt/104/) sur lequel tu n'as pas les droits puisque toi, tu es dans le /mnt/170/
Cordialement Stéphane
snip74 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 09h54   #6
Modérateur
 
Inscription : septembre 2010
Messages : 7 131
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 131
Points : 8 491
Points : 8 491
ton lien est en absolue il faut faire du relatif
http://www.php-astux.info/chemins-relatif-absolu.php
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 10h17   #7
Candidat au titre de Membre du Club
 
Inscription : juillet 2009
Messages : 193
Détails du profil
Informations personnelles :
Localisation : France

Informations forums :
Inscription : juillet 2009
Messages : 193
Points : 12
Points : 12
Bonjour stealth35,
Merci de ton aide et de ta réponse

J'ai lut le lien que tu ma donné mes au risque de me faire passé pour un con je n'est pas tout compris

Le peut que j'ai compris dit moi si je me plante c'est que par exemple ici :

Code :
1
2
3
include_once ('/mnt/104/sdb/7/d/ub33/photo/inc/config.php');
include_once ('/mnt/104/sdb/7/d/ub33/photo/inc/fonctions.php');
include_once ('/mnt/104/sdb/7/d/ub33/photo/admin/hpage.php');
Je devrais remplacer par : ?

Code :
1
2
3
include_once ('/ub33/photo/inc/config.php');
include_once ('/ub33/photo/inc/fonctions.php');
include_once ('/ub33/photo/admin/hpage.php');
Si c'est le cas pourquoi sa marché avant et la sa ne marche plus et comment sa se fait que l'include commence par :

/mnt/104/sdb/7/d/ub33/photo ....

la je suis vraiment perdu a rien y comprendre :/

Citation:
Envoyé par stealth35 Voir le message
ton lien est en absolue il faut faire du relatif
http://www.php-astux.info/chemins-relatif-absolu.php
Cordialement Stéphane
snip74 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 10h20   #8
Modérateur
 
Inscription : septembre 2010
Messages : 7 131
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 131
Points : 8 491
Points : 8 491
faut enleve le / au début de ton path, puisque / est la racine du disque
tout ça c'est les bases de l'informatique ...
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 10h38   #9
Membre habitué
 
Avatar de Chen norris
 
Inscription : mai 2004
Messages : 124
Détails du profil
Informations personnelles :
Âge : 27
Localisation : France, Rhône (Rhône Alpes)

Informations forums :
Inscription : mai 2004
Messages : 124
Points : 101
Points : 101
Bonjour,

Les URL relatives étant ce qu'elles sont parfois, j'avais opté pour cette solution-ci qui fonctionne à tous les coups :

Code :
1
2
 
include_once(realpath(dirname(__FILE__).'/../../../somewhere/'));
__________________
Chen norris
C/C++, C#, Java, PHP & SQL coder
Web developer
Chen norris est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 10h41   #10
Candidat au titre de Membre du Club
 
Inscription : juillet 2009
Messages : 193
Détails du profil
Informations personnelles :
Localisation : France

Informations forums :
Inscription : juillet 2009
Messages : 193
Points : 12
Points : 12
Bonjour stealth35,
Encore merci de ton aide

Effectivement sa a bien enlevé certain erreur :p mais il a reste j'ai passé en revu les fichiers :
/photo/inc/config.php
/photo/inc/fonctions.php
/photo/admin/hpage.php

Y a aucune autre ligne qui commence par :
mnt/104/sdb/7/d/ub33/.... o_O


Erreur restant :

Citation:
Warning: main(mnt/104/sdb/7/d/ub33/photo/inc/config.php) [function.main]: failed to open stream: No such file or directory in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 3

Warning: main() [function.include]: Failed opening 'mnt/104/sdb/7/d/ub33/photo/inc/config.php' for inclusion (include_path='/mnt/170/sdc/7/d/ub33/include:.:/usr/php4/lib/php') in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 3

Warning: main(mnt/104/sdb/7/d/ub33/photo/inc/fonctions.php) [function.main]: failed to open stream: No such file or directory in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 4

Warning: main() [function.include]: Failed opening 'mnt/104/sdb/7/d/ub33/photo/inc/fonctions.php' for inclusion (include_path='/mnt/170/sdc/7/d/ub33/include:.:/usr/php4/lib/php') in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 4

Warning: main(mnt/104/sdb/7/d/ub33/photo/admin/hpage.php) [function.main]: failed to open stream: No such file or directory in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 5

Warning: main() [function.include]: Failed opening 'mnt/104/sdb/7/d/ub33/photo/admin/hpage.php' for inclusion (include_path='/mnt/170/sdc/7/d/ub33/include:.:/usr/php4/lib/php') in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 5

Ici comment j'ai modifier le code admin_message..php :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<?php
 
include_once ('mnt/104/sdb/7/d/ub33/photo/inc/config.php');
include_once ('mnt/104/sdb/7/d/ub33/photo/inc/fonctions.php');
include_once ('mnt/104/sdb/7/d/ub33/photo/admin/hpage.php');
 
 
if (!empty($_GET))
  {myExtract($_GET, $GLOBALS);}
else if (!empty($HTTP_GET_VARS))
  {myExtract($HTTP_GET_VARS, $GLOBALS);}
if (!empty($_POST))
  {myExtract($_POST, $GLOBALS);}
else if (!empty($HTTP_POST_VARS))
  {myExtract($HTTP_POST_VARS, $GLOBALS);}
 
$racine_mailing="mnt/104/sdb/7/d/ub33";
$mailing_fichier="photo/admin/mailing/mailing_list.txt";
$mailing_text="photo/admin/mailing/mailing_message.txt";
$num_ligne = 0 ;
 
 
 
  if ($option == "arreter") {
	if ($_GET['fichier']) {
		unlink($_GET['fichier']); 
		unlink($racine_mailing.$mailing_text); 
		echo "<div style='font-size: 18px; text-align: center; padding-top:25%;'>Suppression du fichier: ".$_GET['fichier']." demand&eacute;<br />";
		echo "Le mailing est annul&eacute;<br />";
		if (file_exists($racine_mailing.$mailing_fichier)) { echo "Une erreur est survenue: Le fichier ".$_GET['fichier']." existe toujours !!"; } else { echo "Le fichier ".$_GET['fichier']." a bien été supprim&eacute"; }		
	}
} else {
	if (file_exists($racine_mailing.$mailing_fichier)) { $affichage="no"; echo "<meta http-equiv='Refresh' content='$delais_mail; url=admin_message.php' />"; }	
	if (!$_POST['Submit'] && $affichage!="no") {
 
?>
 
 
<link rel="stylesheet" type="text/css" href="img/ajout.css"/>
<link rel="stylesheet" type="text/css" id="styles"/>
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css" media="all">
@import url("img/style.css");
</style>
<body>
<div id="content">
  <form method="post" name="mailing" id="mailing">
 
 
    <input type="hidden" name="date" value="<?php echo date("Y-m-d H:i:s") ?>" />
 
	<table>
      <tr>
		  <td class='noir' style="width: 100%; text-align: left; font-size: 18px;">Envoyer un mailing </td></tr>
		  <tr><td colspan='5' style="text-align: center;">
				<table>
 
						<tr><td style="white-space: nowrap; vertical-align: top;">Contenu du mail :</td></tr>
						<tr>
							<td><textarea cols="62" rows="12" name="texte"></textarea></td>
							<td>
								<table style="text-align: left;">
									<tr><td><input type="radio" name="choix" value="Membres" />Liste Membre
									<br /><input type="radio" name="choix" value="Spamlist" />Pub-list</td></tr>
									<tr><td><select name="choix_fichier"> 
		<?php 	
				$dir="mnt/104/sdb/7/d/ub33/photo/admin/mailing/liste";
				if ($handle = opendir($dir)) {
					while (false !== ($file = readdir($handle))) {
						if ($file != "." && $file != "..") { echo "<option value='".$file."'>".$file."</option> "; }
						}   
					closedir($handle);
				} 
		?>
 
									</select></td></tr>
								</table>		
							</td>
						</tr>
 
						<tr><td style="text-align: center; padding-top: 25px;"><input type="submit"  onclick="javascript:window.location='admin_message.php';" name="Submit" value="Envoyer le mail" />
							<input type="hidden" name="MM_insert" value="add" /></td>
						</tr>
				</table></td>
			<td style="width: 15%;">&nbsp;</td>
		</tr>
	</table>
  </form>
</div>
<center>
</body>
</html>
 
<?php
}
  if (file_exists($racine_mailing.$mailing_fichier)) { 
 
	$mailing_en_cours = 1;
	echo "<br /><br /><br />";
 
	envoi_mailing($racine_mailing ,$mailing_fichier, $mailing_text);
 
	exit;
 
} else {
 
	if ($_POST['Submit']) {
		if (!$_POST['choix'])  { 
			echo "<div style='font-size: 18px; padding-top: 25%; text-align: center;'>Tu dois selectionner une liste de diffusion<div><br /><a class='ferm_button' href='javascript:history.back()'><span style='margin-left: 5%;'>[ Page pr&eacute;c&eacute;dente ]</span></a><br /><br />"; exit; 
	  } else if ($_POST['texte'] == "") { 
			echo "<div style='font-size: 18px; padding-top: 25%; text-align: center;'>Tu n'as pas saisi de message !!<div><br /><a class='ferm_button' href='javascript:history.back()'><span style='margin-left: 5%;'>[ Page pr&eacute;c&eacute;dente ]</span></a><br /><br />"; exit; 
	  } else {
		echo "<meta http-equiv='Refresh' content='$delais_mail; url=admin_message.php' />";
 
			$objet_mail = str_replace(array(";","\n","\r")," ",$_POST['texte']);
			$list_mailing = "MESSAGE: ".$objet_mail."\n";
			$post_message = $_POST['texte'];
			$post_message = stripslashes($post_message);
			$texte_message ="<html><head></head><body>";
			$texte_message .= $post_message."</body>"; 
 
 
 
			if ($_POST['choix'] == "Membres") {
				$requete = "SELECT `idx`, `pseudo`, `email`, `sexe` FROM trombino_trombino";
				$act_requete = mysql_query($requete) or die(mysql_error());
				$mass_mail = mysql_fetch_assoc($act_requete); 
				do { 
					$list_mailing .= $mass_mail['email'].":".$mass_mail['pseudo']."\n";
			  } while ($mass_mail = mysql_fetch_assoc($act_requete)); 
			}
			if ($_POST['choix'] == "Spamlist") {
				$racine="mnt/104/sdb/7/d/ub33/photo/admin/mailing/liste/";
				$content .= file_get_contents($racine.$_POST['choix_fichier']); 
				$list_mailing .= str_replace(";", "\n", $content);
			}
 
			if (!$inF = fopen($racine_mailing.$mailing_text,"w")) { 
				echo "Echec de l'ouverture du fichier: ".$racine_mailing.$mailing_text."<br />"; 
				exit;
		  } else {
				fputs($inF,$texte_message); 
				fclose($inF); 
			}
			if (!$inF = fopen($racine_mailing.$mailing_fichier,"w")) { 
				echo "Echec de l'ouverture du fichier: ".$racine_mailing.$mailing_fichier."<br />"; 
				exit;
		  } else {
				fputs($inF,$list_mailing); 
				fclose($inF); 
				$contents = file_get_contents($racine_mailing.$mailing_fichier); 
				$taille_init = filesize($racine_mailing.$mailing_fichier);
				if (!$inF = fopen($racine_mailing.$mailing_fichier,"w")) { 
					echo "Echec de l'ouverture du fichier: ".$racine_mailing.$mailing_fichier."<br />"; 
					exit;
			  } else {
				$list_mailing = "Taille initial du fichier : " .$taille_init."\n";
				$list_mailing .= $contents;
				fputs($inF,$list_mailing); 
				fclose($inF); 			
				}
				envoi_mailing($racine_mailing, $mailing_fichier, $mailing_text);	
				unset($conf_post);
				}
			}
		}
	}
}
 
function envoi_mailing($racine_mailing, $mailing_fichier, $mailing_text) {
include ('mnt/104/sdb/7/d/ub33/photo/inc/config.php');
 
	$taille=filesize($racine_mailing.$mailing_fichier);
	$tab = file($racine_mailing.$mailing_fichier); 
 
		if (!$fp = fopen($racine_mailing.$mailing_text,"r+")) { 
			echo "Echec de l'ouverture du fichier lors de la fonction lecture : ".$mailing_text."<br />"; 
			exit;
	  } else {	
			$handle = fopen($racine_mailing.$mailing_text,"r+");
			$message .= fread($handle, filesize($racine_mailing.$mailing_text));
			fclose($handle);
		}
	if (count($tab) == '2') { 
		echo "<div style='font-size:16px; text-align: center;'>Le mailing a bien été envoyé. <br /> Suppression du fichier temporaire en cours</div>"; 
		$headers = 'MIME-Version: 1.0' . "\r\n"; 
		$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 
		@mail("pervy14@hotmail.com", "TCHAT-FUSION: Fin de mailing.", 
		"Bonjour,
 
		-- Le mailing a bien été a: ".$nb_mail_env." adresses <br /> -- Avec ce message : <br /> 
 
		".$message."",$headers);
 
		unlink($racine_mailing.$mailing_fichier); 
		unlink($racine_mailing.$mailing_text); 
		exit;
		}
	else {
	echo "le message est : " .$message. ".";
		echo "<div style='font-size:16px; text-align: center; padding-top:25%;'>Un mailing est en cours d'execution.<br /><br />";
		echo "<input type=\"submit\" name=\"Annuler\" Onclick=\"javascript: window.location='admin_message.php?option=arreter&fichier=$racine_mailing$mailing_fichier';\" value=\"Stopper cet envoi\" />";
		if (!$fp = fopen($racine_mailing.$mailing_fichier,"r+")) { 
			echo "Echec de l'ouverture du fichier lors de la fonction lecture : ".$racine_mailing.$mailing_fichier."<br />"; 
			exit;
	  } else {
			$fp = fopen($racine_mailing.$mailing_fichier,"r+");
			$num_ligne=1;
			$nb_pack=$nb_mail + 2;
			while (!feof($fp)) {
 
				$buffer = trim(fgets($fp, 4096));
 
 
				if ($num_ligne == 1) { $liste = explode(":", $buffer); $prop_avancement = 100 - round(($taille/$liste['1'])*100); $liste_modif.=$buffer."\n"; echo "<br /><br /><br /><div style='font-size:20px'>Etat d'avancement : <b>" .$prop_avancement."% </b>.</div>";}
				else if ($num_ligne == 2) {  $liste_modif.=$buffer."\n"; }
				else if ($num_ligne > 2 && $num_ligne <= $nb_pack && $buffer != "") { 
					$liste = explode(":", $buffer);
					$headers = 'MIME-Version: 1.0' . "\r\n"; 
					$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 
 
					@mail("".$liste['0']."", "TCHAT-FUSION: Actualités.", $message,$headers);
 
					}
				else if ($num_ligne > $nb_pack) { $liste_modif.=$buffer."\n"; }
				$num_ligne++;
			}
			fclose ($fp);
			echo "</div>";
 
	//Réecriture du fichier modifié.
 
			if (!$fp = fopen($racine_mailing.$mailing_fichier,"w+")) { 
				echo "Echec de l'ouverture du fichier lors de la fonction ecriture: ".$racine_mailing.$mailing_fichier."<br />"; 
				exit;
		  } else {
				fwrite($fp,$liste_modif);
				fclose($fp);
				exit;
			}
		}
	}
}
?>

Citation:
Envoyé par stealth35 Voir le message
faut enleve le / au début de ton path, puisque / est la racine du disque
tout ça c'est les bases de l'informatique ...
Cordialement Stéphane
snip74 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 10h49   #11
Modérateur
 
Inscription : septembre 2010
Messages : 7 131
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 131
Points : 8 491
Points : 8 491
mais mnt c'est le dossier de base ...
ton root a toi c'est ub33

donc

Code :
1
2
3
include_once ('photo/inc/config.php');
include_once ('photo/inc/fonctions.php');
include_once ('photo/admin/hpage.php');
si ton fichier est dans ub33 bien sur
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 11h01   #12
Candidat au titre de Membre du Club
 
Inscription : juillet 2009
Messages : 193
Détails du profil
Informations personnelles :
Localisation : France

Informations forums :
Inscription : juillet 2009
Messages : 193
Points : 12
Points : 12
Bonjour stealth35,
Vraiment merci de ton aide

Voila j'ai mis comme tu ma dit mais toujours c'est fichu erreur :

Citation:
Warning: main(photo/inc/config.php) [function.main]: failed to open stream: No such file or directory in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 3

Warning: main() [function.include]: Failed opening 'photo/inc/config.php' for inclusion (include_path='/mnt/170/sdc/7/d/ub33/include:.:/usr/php4/lib/php') in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 3

Warning: main(photo/inc/fonctions.php) [function.main]: failed to open stream: No such file or directory in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 4

Warning: main() [function.include]: Failed opening 'photo/inc/fonctions.php' for inclusion (include_path='/mnt/170/sdc/7/d/ub33/include:.:/usr/php4/lib/php') in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 4

Warning: main(photo/admin/hpage.php) [function.main]: failed to open stream: No such file or directory in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 5

Warning: main() [function.include]: Failed opening 'photo/admin/hpage.php' for inclusion (include_path='/mnt/170/sdc/7/d/ub33/include:.:/usr/php4/lib/php') in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 5
Citation:
Envoyé par stealth35 Voir le message
mais mnt c'est le dossier de base ...
ton root a toi c'est ub33

donc

Code :
1
2
3
include_once ('photo/inc/config.php');
include_once ('photo/inc/fonctions.php');
include_once ('photo/admin/hpage.php');
si ton fichier est dans ub33 bien sur
Cordialement Stéphane
snip74 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 11h24   #13
Modérateur
 
Inscription : septembre 2010
Messages : 7 131
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 131
Points : 8 491
Points : 8 491
ton fichier est :
photo/admin/mailing/admin_message.php

donc si tu fais include photo/inc/config.phpil va chercher : photo/admin/mailing/photo/inc/config.php

il faut donc remonter le chemin avec les ../
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 11h54   #14
Candidat au titre de Membre du Club
 
Inscription : juillet 2009
Messages : 193
Détails du profil
Informations personnelles :
Localisation : France

Informations forums :
Inscription : juillet 2009
Messages : 193
Points : 12
Points : 12
Bonjour stealth35,
Merci encore

Bah je me suis douté que tu aller me demandé de mettre ./ ou ../ j'avait donc déjà testé mais voila les erreurs son toujours la :

Citation:
Warning: main(../photo/inc/config.php) [function.main]: failed to open stream: No such file or directory in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 3

Warning: main() [function.include]: Failed opening '../photo/inc/config.php' for inclusion (include_path='/mnt/170/sdc/7/d/ub33/include:.:/usr/php4/lib/php') in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 3

Warning: main(../photo/inc/fonctions.php) [function.main]: failed to open stream: No such file or directory in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 4

Warning: main() [function.include]: Failed opening '../photo/inc/fonctions.php' for inclusion (include_path='/mnt/170/sdc/7/d/ub33/include:.:/usr/php4/lib/php') in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 4

Warning: main(../photo/admin/hpage.php) [function.main]: failed to open stream: No such file or directory in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 5

Warning: main() [function.include]: Failed opening '../photo/admin/hpage.php' for inclusion (include_path='/mnt/170/sdc/7/d/ub33/include:.:/usr/php4/lib/php') in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 5
Ps : avec un ./ ces les même erreur avec un seule ./ :

Citation:
Envoyé par stealth35 Voir le message
ton fichier est :
photo/admin/mailing/admin_message.php

donc si tu fais include photo/inc/config.phpil va chercher : photo/admin/mailing/photo/inc/config.php

il faut donc remonter le chemin avec les ../
Cordialement Stéphane
snip74 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 13h22   #15
Modérateur
 
Inscription : septembre 2010
Messages : 7 131
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 131
Points : 8 491
Points : 8 491
faut en mettre plusieurs ../../ pour remonter de plusieurs niveau
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 14h35   #16
Candidat au titre de Membre du Club
 
Inscription : juillet 2009
Messages : 193
Détails du profil
Informations personnelles :
Localisation : France

Informations forums :
Inscription : juillet 2009
Messages : 193
Points : 12
Points : 12
Bonjour stealth35,
Merci de cette réponse

Effectivement y a plus aucune erreur sur la page :p

Par contre quand je teste d'envoyer un message j'ai des erreurs, J'ai fait pas mal de testé pour trouvé d'où viens le souci mais ji arrive pas :/ a chaque fois sa me donne une erreur différente du se type :

Citation:
Warning: fopen(mnt/104/sdb/7/d/ub33/photo/admin/mailing/mailing_message.txt) [function.fopen]: failed to open stream: No such file or directory in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 138
Echec de l'ouverture du fichier: mnt/104/sdb/7/d/ub33/photo/admin/mailing/mailing_message.txt

Warning: fopen(mnt/104/sdb/7/d/ub33/photo/admin/mailing/mailing_message.txt) [function.fopen]: failed to open stream: No such file or directory in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 138
Echec de l'ouverture du fichier: mnt/104/sdb/7/d/ub33/photo/admin/mailing/mailing_message.txt


Warning: fopen(mnt/104/sdb/7/d/ub33/photo/admin/mailing/liste/mailing_message.txt) [function.fopen]: failed to open stream: No such file or directory in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 138
Echec de l'ouverture du fichier: mnt/104/sdb/7/d/ub33/photo/admin/mailing/liste/mailing_message.txt

Warning: fopen(mnt/104/sdb/7/d/ub33/photo/admin/mailing/liste) [function.fopen]: failed to open stream: No such file or directory in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 138
Echec de l'ouverture du fichier: mnt/104/sdb/7/d/ub33/photo/admin/mailing/liste

Warning: fopen(mnt/104/sdb/7/d/ub33/photo/admin/mailing/mailing_message.txt) [function.fopen]: failed to open stream: No such file or directory in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 138
Echec de l'ouverture du fichier: mnt/104/sdb/7/d/ub33/photo/admin/mailing/mailing_message.txt
Donc la après tout ces teste je ne voie pas d'où viens mon souci et je me suis arrêtée ici :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<?php
 
include_once ('../../../photo/inc/config.php');
include_once ('../../../photo/inc/fonctions.php');
include_once ('../../../photo/admin/hpage.php');
 
 
if (!empty($_GET))
  {myExtract($_GET, $GLOBALS);}
else if (!empty($HTTP_GET_VARS))
  {myExtract($HTTP_GET_VARS, $GLOBALS);}
if (!empty($_POST))
  {myExtract($_POST, $GLOBALS);}
else if (!empty($HTTP_POST_VARS))
  {myExtract($HTTP_POST_VARS, $GLOBALS);}
 
$racine_mailing="mnt/104/sdb/7/d/ub33";
$mailing_fichier="./photo/admin/mailing/mailing_list.txt";
$mailing_text="/photo/admin/mailing/mailing_message.txt";
$num_ligne = 0 ;
 
 
 
  if ($option == "arreter") {
	if ($_GET['fichier']) {
		unlink($_GET['fichier']); 
		unlink($racine_mailing.$mailing_text); 
		echo "<div style='font-size: 18px; text-align: center; padding-top:25%;'>Suppression du fichier: ".$_GET['fichier']." demand&eacute;<br />";
		echo "Le mailing est annul&eacute;<br />";
		if (file_exists($racine_mailing.$mailing_fichier)) { echo "Une erreur est survenue: Le fichier ".$_GET['fichier']." existe toujours !!"; } else { echo "Le fichier ".$_GET['fichier']." a bien été supprim&eacute"; }		
	}
} else {
	if (file_exists($racine_mailing.$mailing_fichier)) { $affichage="no"; echo "<meta http-equiv='Refresh' content='$delais_mail; url=admin_message.php' />"; }	
	if (!$_POST['Submit'] && $affichage!="no") {
 
?>
 
 
<link rel="stylesheet" type="text/css" href="img/ajout.css"/>
<link rel="stylesheet" type="text/css" id="styles"/>
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css" media="all">
@import url("img/style.css");
</style>
<body>
<div id="content">
  <form method="post" name="mailing" id="mailing">
 
 
    <input type="hidden" name="date" value="<?php echo date("Y-m-d H:i:s") ?>" />
 
	<table>
      <tr>
		  <td class='noir' style="width: 100%; text-align: left; font-size: 18px;">Envoyer un mailing </td></tr>
		  <tr><td colspan='5' style="text-align: center;">
				<table>
 
						<tr><td style="white-space: nowrap; vertical-align: top;">Contenu du mail :</td></tr>
						<tr>
							<td><textarea cols="62" rows="12" name="texte"></textarea></td>
							<td>
								<table style="text-align: left;">
									<tr><td><input type="radio" name="choix" value="Membres" />Liste Membre
									<br /><input type="radio" name="choix" value="Spamlist" />Pub-list</td></tr>
									<tr><td><select name="choix_fichier"> 
		<?php 	
				$dir="../photo/admin/mailing/liste";
				if ($handle = opendir($dir)) {
					while (false !== ($file = readdir($handle))) {
						if ($file != "." && $file != "..") { echo "<option value='".$file."'>".$file."</option> "; }
						}   
					closedir($handle);
				} 
		?>
 
									</select></td></tr>
								</table>		
							</td>
						</tr>
 
						<tr><td style="text-align: center; padding-top: 25px;"><input type="submit"  onclick="javascript:window.location='admin_message.php';" name="Submit" value="Envoyer le mail" />
							<input type="hidden" name="MM_insert" value="add" /></td>
						</tr>
				</table></td>
			<td style="width: 15%;">&nbsp;</td>
		</tr>
	</table>
  </form>
</div>
<center>
</body>
</html>
 
<?php
}
  if (file_exists($racine_mailing.$mailing_fichier)) { 
 
	$mailing_en_cours = 1;
	echo "<br /><br /><br />";
 
	envoi_mailing($racine_mailing ,$mailing_fichier, $mailing_text);
 
	exit;
 
} else {
 
	if ($_POST['Submit']) {
		if (!$_POST['choix'])  { 
			echo "<div style='font-size: 18px; padding-top: 25%; text-align: center;'>Tu dois selectionner une liste de diffusion<div><br /><a class='ferm_button' href='javascript:history.back()'><span style='margin-left: 5%;'>[ Page pr&eacute;c&eacute;dente ]</span></a><br /><br />"; exit; 
	  } else if ($_POST['texte'] == "") { 
			echo "<div style='font-size: 18px; padding-top: 25%; text-align: center;'>Tu n'as pas saisi de message !!<div><br /><a class='ferm_button' href='javascript:history.back()'><span style='margin-left: 5%;'>[ Page pr&eacute;c&eacute;dente ]</span></a><br /><br />"; exit; 
	  } else {
		echo "<meta http-equiv='Refresh' content='$delais_mail; url=admin_message.php' />";
 
			$objet_mail = str_replace(array(";","\n","\r")," ",$_POST['texte']);
			$list_mailing = "MESSAGE: ".$objet_mail."\n";
			$post_message = $_POST['texte'];
			$post_message = stripslashes($post_message);
			$texte_message ="<html><head></head><body>";
			$texte_message .= $post_message."</body>"; 
 
 
 
			if ($_POST['choix'] == "Membres") {
				$requete = "SELECT `idx`, `pseudo`, `email`, `sexe` FROM trombino_trombino";
				$act_requete = mysql_query($requete) or die(mysql_error());
				$mass_mail = mysql_fetch_assoc($act_requete); 
				do { 
					$list_mailing .= $mass_mail['email'].":".$mass_mail['pseudo']."\n";
			  } while ($mass_mail = mysql_fetch_assoc($act_requete)); 
			}
			if ($_POST['choix'] == "Spamlist") {
				$racine="../../../photo/admin/mailing/liste/";
				$content .= file_get_contents($racine.$_POST['choix_fichier']); 
				$list_mailing .= str_replace(";", "\n", $content);
			}
 
			if (!$inF = fopen($racine_mailing.$mailing_text,"w")) { 
				echo "Echec de l'ouverture du fichier: ".$racine_mailing.$mailing_text."<br />"; 
				exit;
		  } else {
				fputs($inF,$texte_message); 
				fclose($inF); 
			}
			if (!$inF = fopen($racine_mailing.$mailing_fichier,"w")) { 
				echo "Echec de l'ouverture du fichier: ".$racine_mailing.$mailing_fichier."<br />"; 
				exit;
		  } else {
				fputs($inF,$list_mailing); 
				fclose($inF); 
				$contents = file_get_contents($racine_mailing.$mailing_fichier); 
				$taille_init = filesize($racine_mailing.$mailing_fichier);
				if (!$inF = fopen($racine_mailing.$mailing_fichier,"w")) { 
					echo "Echec de l'ouverture du fichier: ".$racine_mailing.$mailing_fichier."<br />"; 
					exit;
			  } else {
				$list_mailing = "Taille initial du fichier : " .$taille_init."\n";
				$list_mailing .= $contents;
				fputs($inF,$list_mailing); 
				fclose($inF); 			
				}
				envoi_mailing($racine_mailing, $mailing_fichier, $mailing_text);	
				unset($conf_post);
				}
			}
		}
	}
}
 
function envoi_mailing($racine_mailing, $mailing_fichier, $mailing_text) {
include ('../../../photo/inc/config.php');
 
	$taille=filesize($racine_mailing.$mailing_fichier);
	$tab = file($racine_mailing.$mailing_fichier); 
 
		if (!$fp = fopen($racine_mailing.$mailing_text,"r+")) { 
			echo "Echec de l'ouverture du fichier lors de la fonction lecture : ".$mailing_text."<br />"; 
			exit;
	  } else {	
			$handle = fopen($racine_mailing.$mailing_text,"r+");
			$message .= fread($handle, filesize($racine_mailing.$mailing_text));
			fclose($handle);
		}
	if (count($tab) == '2') { 
		echo "<div style='font-size:16px; text-align: center;'>Le mailing a bien été envoyé. <br /> Suppression du fichier temporaire en cours</div>"; 
		$headers = 'MIME-Version: 1.0' . "\r\n"; 
		$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 
		@mail("pervy14@hotmail.com", "TCHAT-FUSION: Fin de mailing.", 
		"Bonjour,
 
		-- Le mailing a bien été a: ".$nb_mail_env." adresses <br /> -- Avec ce message : <br /> 
 
		".$message."",$headers);
 
		unlink($racine_mailing.$mailing_fichier); 
		unlink($racine_mailing.$mailing_text); 
		exit;
		}
	else {
	echo "le message est : " .$message. ".";
		echo "<div style='font-size:16px; text-align: center; padding-top:25%;'>Un mailing est en cours d'execution.<br /><br />";
		echo "<input type=\"submit\" name=\"Annuler\" Onclick=\"javascript: window.location='admin_message.php?option=arreter&fichier=$racine_mailing$mailing_fichier';\" value=\"Stopper cet envoi\" />";
		if (!$fp = fopen($racine_mailing.$mailing_fichier,"r+")) { 
			echo "Echec de l'ouverture du fichier lors de la fonction lecture : ".$racine_mailing.$mailing_fichier."<br />"; 
			exit;
	  } else {
			$fp = fopen($racine_mailing.$mailing_fichier,"r+");
			$num_ligne=1;
			$nb_pack=$nb_mail + 2;
			while (!feof($fp)) {
 
				$buffer = trim(fgets($fp, 4096));
 
 
				if ($num_ligne == 1) { $liste = explode(":", $buffer); $prop_avancement = 100 - round(($taille/$liste['1'])*100); $liste_modif.=$buffer."\n"; echo "<br /><br /><br /><div style='font-size:20px'>Etat d'avancement : <b>" .$prop_avancement."% </b>.</div>";}
				else if ($num_ligne == 2) {  $liste_modif.=$buffer."\n"; }
				else if ($num_ligne > 2 && $num_ligne <= $nb_pack && $buffer != "") { 
					$liste = explode(":", $buffer);
					$headers = 'MIME-Version: 1.0' . "\r\n"; 
					$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 
 
					@mail("".$liste['0']."", "TCHAT-FUSION: Actualités.", $message,$headers);
 
					}
				else if ($num_ligne > $nb_pack) { $liste_modif.=$buffer."\n"; }
				$num_ligne++;
			}
			fclose ($fp);
			echo "</div>";
 
	//Réecriture du fichier modifié.
 
			if (!$fp = fopen($racine_mailing.$mailing_fichier,"w+")) { 
				echo "Echec de l'ouverture du fichier lors de la fonction ecriture: ".$racine_mailing.$mailing_fichier."<br />"; 
				exit;
		  } else {
				fwrite($fp,$liste_modif);
				fclose($fp);
				exit;
			}
		}
	}
}
?>
Citation:
Envoyé par stealth35 Voir le message
faut en mettre plusieurs ../../ pour remonter de plusieurs niveau
et l'erreur que j'ai actuellement c'est :

Citation:
Warning: fopen(mnt/104/sdb/7/d/ub33/photo/admin/mailing/mailing_message.txt) [function.fopen]: failed to open stream: No such file or directory in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 138
Echec de l'ouverture du fichier: mnt/104/sdb/7/d/ub33/photo/admin/mailing/mailing_message.txt
Il se peut que j'ai changer une ligne qui ne fallait pas touché :$

Cordialement Stéphane
snip74 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 14h43   #17
Modérateur
 
Inscription : septembre 2010
Messages : 7 131
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 131
Points : 8 491
Points : 8 491
faut le faire pour tout les chemins, c'est du basiques tout ça
si t'as une erreurs c'est que le chemin n'est pas bon, pas besoin de reposter à chaque fois
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 14h54   #18
Candidat au titre de Membre du Club
 
Inscription : juillet 2009
Messages : 193
Détails du profil
Informations personnelles :
Localisation : France

Informations forums :
Inscription : juillet 2009
Messages : 193
Points : 12
Points : 12
Bonjour stealth35,
Encore merci

Oui je suis toute a fait d'accord avec toi que c'est inutile de re poster a chaque fois.

Le souci c'est que chaque fois que j'essaie de mettre le bon chemin ou que je modifie j'ai une erreur différente la j'ai changer le chemin les fichier text son revenu mais l'erreur a changer et je ne trouve vraiment pas quoi changer pour la ligne 138 qui représente cette ligne :

Code :
if (!$inF = fopen($racine_mailing.$mailing_text,"w")) {
Donc après avoir changer pas mal de truc dans se code :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<?php
 
include_once ('../../../photo/inc/config.php');
include_once ('../../../photo/inc/fonctions.php');
include_once ('../../../photo/admin/hpage.php');
 
 
if (!empty($_GET))
  {myExtract($_GET, $GLOBALS);}
else if (!empty($HTTP_GET_VARS))
  {myExtract($HTTP_GET_VARS, $GLOBALS);}
if (!empty($_POST))
  {myExtract($_POST, $GLOBALS);}
else if (!empty($HTTP_POST_VARS))
  {myExtract($HTTP_POST_VARS, $GLOBALS);}
 
$racine_mailing="mnt/104/sdb/7/d/ub33";
$mailing_fichier="./photo/admin/mailing/mailing_list.txt";
$mailing_text="/photo/admin/mailing/mailing_message.txt";
$num_ligne = 0 ;
 
 
 
  if ($option == "arreter") {
	if ($_GET['fichier']) {
		unlink($_GET['fichier']); 
		unlink($racine_mailing.$mailing_text); 
		echo "<div style='font-size: 18px; text-align: center; padding-top:25%;'>Suppression du fichier: ".$_GET['fichier']." demand&eacute;<br />";
		echo "Le mailing est annul&eacute;<br />";
		if (file_exists($racine_mailing.$mailing_fichier)) { echo "Une erreur est survenue: Le fichier ".$_GET['fichier']." existe toujours !!"; } else { echo "Le fichier ".$_GET['fichier']." a bien été supprim&eacute"; }		
	}
} else {
	if (file_exists($racine_mailing.$mailing_fichier)) { $affichage="no"; echo "<meta http-equiv='Refresh' content='$delais_mail; url=admin_message.php' />"; }	
	if (!$_POST['Submit'] && $affichage!="no") {
 
?>
 
 
<link rel="stylesheet" type="text/css" href="img/ajout.css"/>
<link rel="stylesheet" type="text/css" id="styles"/>
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css" media="all">
@import url("img/style.css");
</style>
<body>
<div id="content">
  <form method="post" name="mailing" id="mailing">
 
 
    <input type="hidden" name="date" value="<?php echo date("Y-m-d H:i:s") ?>" />
 
	<table>
      <tr>
		  <td class='noir' style="width: 100%; text-align: left; font-size: 18px;">Envoyer un mailing </td></tr>
		  <tr><td colspan='5' style="text-align: center;">
				<table>
 
						<tr><td style="white-space: nowrap; vertical-align: top;">Contenu du mail :</td></tr>
						<tr>
							<td><textarea cols="62" rows="12" name="texte"></textarea></td>
							<td>
								<table style="text-align: left;">
									<tr><td><input type="radio" name="choix" value="Membres" />Liste Membre
									<br /><input type="radio" name="choix" value="Spamlist" />Pub-list</td></tr>
									<tr><td><select name="choix_fichier"> 
		<?php 	
				$dir="../../../photo/admin/mailing/liste";
				if ($handle = opendir($dir)) {
					while (false !== ($file = readdir($handle))) {
						if ($file != "." && $file != "..") { echo "<option value='".$file."'>".$file."</option> "; }
						}   
					closedir($handle);
				} 
		?>
 
									</select></td></tr>
								</table>		
							</td>
						</tr>
 
						<tr><td style="text-align: center; padding-top: 25px;"><input type="submit"  onclick="javascript:window.location='admin_message.php';" name="Submit" value="Envoyer le mail" />
							<input type="hidden" name="MM_insert" value="add" /></td>
						</tr>
				</table></td>
			<td style="width: 15%;">&nbsp;</td>
		</tr>
	</table>
  </form>
</div>
<center>
</body>
</html>
 
<?php
}
  if (file_exists($racine_mailing.$mailing_fichier)) { 
 
	$mailing_en_cours = 1;
	echo "<br /><br /><br />";
 
	envoi_mailing($racine_mailing ,$mailing_fichier, $mailing_text);
 
	exit;
 
} else {
 
	if ($_POST['Submit']) {
		if (!$_POST['choix'])  { 
			echo "<div style='font-size: 18px; padding-top: 25%; text-align: center;'>Tu dois selectionner une liste de diffusion<div><br /><a class='ferm_button' href='javascript:history.back()'><span style='margin-left: 5%;'>[ Page pr&eacute;c&eacute;dente ]</span></a><br /><br />"; exit; 
	  } else if ($_POST['texte'] == "") { 
			echo "<div style='font-size: 18px; padding-top: 25%; text-align: center;'>Tu n'as pas saisi de message !!<div><br /><a class='ferm_button' href='javascript:history.back()'><span style='margin-left: 5%;'>[ Page pr&eacute;c&eacute;dente ]</span></a><br /><br />"; exit; 
	  } else {
		echo "<meta http-equiv='Refresh' content='$delais_mail; url=admin_message.php' />";
 
			$objet_mail = str_replace(array(";","\n","\r")," ",$_POST['texte']);
			$list_mailing = "MESSAGE: ".$objet_mail."\n";
			$post_message = $_POST['texte'];
			$post_message = stripslashes($post_message);
			$texte_message ="<html><head></head><body>";
			$texte_message .= $post_message."</body>"; 
 
 
 
			if ($_POST['choix'] == "Membres") {
				$requete = "SELECT `idx`, `pseudo`, `email`, `sexe` FROM trombino_trombino";
				$act_requete = mysql_query($requete) or die(mysql_error());
				$mass_mail = mysql_fetch_assoc($act_requete); 
				do { 
					$list_mailing .= $mass_mail['email'].":".$mass_mail['pseudo']."\n";
			  } while ($mass_mail = mysql_fetch_assoc($act_requete)); 
			}
			if ($_POST['choix'] == "Spamlist") {
				$racine="../../../photo/admin/mailing/liste/";
				$content .= file_get_contents($racine.$_POST['choix_fichier']); 
				$list_mailing .= str_replace(";", "\n", $content);
			}
 
			if (!$inF = fopen($racine_mailing.$mailing_text,"w")) { 
				echo "Echec de l'ouverture du fichier: ".$racine_mailing.$mailing_text."<br />"; 
				exit;
		  } else {
				fputs($inF,$texte_message); 
				fclose($inF); 
			}
			if (!$inF = fopen($racine_mailing.$mailing_fichier,"w")) { 
				echo "Echec de l'ouverture du fichier: ".$racine_mailing.$mailing_fichier."<br />"; 
				exit;
		  } else {
				fputs($inF,$list_mailing); 
				fclose($inF); 
				$contents = file_get_contents($racine_mailing.$mailing_fichier); 
				$taille_init = filesize($racine_mailing.$mailing_fichier);
				if (!$inF = fopen($racine_mailing.$mailing_fichier,"w")) { 
					echo "Echec de l'ouverture du fichier: ".$racine_mailing.$mailing_fichier."<br />"; 
					exit;
			  } else {
				$list_mailing = "Taille initial du fichier : " .$taille_init."\n";
				$list_mailing .= $contents;
				fputs($inF,$list_mailing); 
				fclose($inF); 			
				}
				envoi_mailing($racine_mailing, $mailing_fichier, $mailing_text);	
				unset($conf_post);
				}
			}
		}
	}
}
 
function envoi_mailing($racine_mailing, $mailing_fichier, $mailing_text) {
include ('../../../photo/inc/config.php');
 
	$taille=filesize($racine_mailing.$mailing_fichier);
	$tab = file($racine_mailing.$mailing_fichier); 
 
		if (!$fp = fopen($racine_mailing.$mailing_text,"r+")) { 
			echo "Echec de l'ouverture du fichier lors de la fonction lecture : ".$mailing_text."<br />"; 
			exit;
	  } else {	
			$handle = fopen($racine_mailing.$mailing_text,"r+");
			$message .= fread($handle, filesize($racine_mailing.$mailing_text));
			fclose($handle);
		}
	if (count($tab) == '2') { 
		echo "<div style='font-size:16px; text-align: center;'>Le mailing a bien été envoyé. <br /> Suppression du fichier temporaire en cours</div>"; 
		$headers = 'MIME-Version: 1.0' . "\r\n"; 
		$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 
		@mail("pervy14@hotmail.com", "TCHAT-FUSION: Fin de mailing.", 
		"Bonjour,
 
		-- Le mailing a bien été a: ".$nb_mail_env." adresses <br /> -- Avec ce message : <br /> 
 
		".$message."",$headers);
 
		unlink($racine_mailing.$mailing_fichier); 
		unlink($racine_mailing.$mailing_text); 
		exit;
		}
	else {
	echo "le message est : " .$message. ".";
		echo "<div style='font-size:16px; text-align: center; padding-top:25%;'>Un mailing est en cours d'execution.<br /><br />";
		echo "<input type=\"submit\" name=\"Annuler\" Onclick=\"javascript: window.location='admin_message.php?option=arreter&fichier=$racine_mailing$mailing_fichier';\" value=\"Stopper cet envoi\" />";
		if (!$fp = fopen($racine_mailing.$mailing_fichier,"r+")) { 
			echo "Echec de l'ouverture du fichier lors de la fonction lecture : ".$racine_mailing.$mailing_fichier."<br />"; 
			exit;
	  } else {
			$fp = fopen($racine_mailing.$mailing_fichier,"r+");
			$num_ligne=1;
			$nb_pack=$nb_mail + 2;
			while (!feof($fp)) {
 
				$buffer = trim(fgets($fp, 4096));
 
 
				if ($num_ligne == 1) { $liste = explode(":", $buffer); $prop_avancement = 100 - round(($taille/$liste['1'])*100); $liste_modif.=$buffer."\n"; echo "<br /><br /><br /><div style='font-size:20px'>Etat d'avancement : <b>" .$prop_avancement."% </b>.</div>";}
				else if ($num_ligne == 2) {  $liste_modif.=$buffer."\n"; }
				else if ($num_ligne > 2 && $num_ligne <= $nb_pack && $buffer != "") { 
					$liste = explode(":", $buffer);
					$headers = 'MIME-Version: 1.0' . "\r\n"; 
					$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 
 
					@mail("".$liste['0']."", "TCHAT-FUSION: Actualités.", $message,$headers);
 
					}
				else if ($num_ligne > $nb_pack) { $liste_modif.=$buffer."\n"; }
				$num_ligne++;
			}
			fclose ($fp);
			echo "</div>";
 
	//Réecriture du fichier modifié.
 
			if (!$fp = fopen($racine_mailing.$mailing_fichier,"w+")) { 
				echo "Echec de l'ouverture du fichier lors de la fonction ecriture: ".$racine_mailing.$mailing_fichier."<br />"; 
				exit;
		  } else {
				fwrite($fp,$liste_modif);
				fclose($fp);
				exit;
			}
		}
	}
}
?>
Pourquoi j'ai encore cette fichu erreur alors que je pense que j'ai tout bien mis ?

Citation:
Warning: fopen(mnt/104/sdb/7/d/ub33/photo/admin/mailing/mailing_message.txt) [function.fopen]: failed to open stream: No such file or directory in /mnt/170/sdc/7/d/ub33/photo/admin/mailing/admin_message.php on line 138
Echec de l'ouverture du fichier: mnt/104/sdb/7/d/ub33/photo/admin/mailing/mailing_message.txt
De plus quand je relit mon code je voie mailing_message.txt mais y a aucun fichier avec se nom je pense que c'est pour le select mais bon je suis pas sur vue que se code c'est un ami a moi qui la créer mes il a des souci personnel donc il ne viens plus sur internet pour le moment et depuis des mois :s

Citation:
Envoyé par stealth35 Voir le message
faut le faire pour tout les chemins, c'est du basiques tout ça
si t'as une erreurs c'est que le chemin n'est pas bon, pas besoin de reposter à chaque fois
Cordialement Stéphane
snip74 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 14h56   #19
Modérateur
 
Inscription : septembre 2010
Messages : 7 131
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 131
Points : 8 491
Points : 8 491
c'est pas bon ça :

Code :
$racine_mailing="mnt/104/sdb/7/d/ub33";
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 15h10   #20
Candidat au titre de Membre du Club
 
Inscription : juillet 2009
Messages : 193
Détails du profil
Informations personnelles :
Localisation : France

Informations forums :
Inscription : juillet 2009
Messages : 193
Points : 12
Points : 12
Bonjour stealth35,
Encore merci infiniment de ton aide

Je suis un boulet en php ^^ je pense que sa c'est remarqué

Mais le peut que j'arrive a comprendre avec toute votre aide la aussi j'avais déjà testé un autre chemin j'avoue que je n'aurait jamais pensé a ../../ qui ne fonctionne pas pour cette ligne :

Code :
$racine_mailing="../../ub33";
Donc j'avais essayer des trucs dans se style :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
 
$racine_mailing="./ub33";
 
$racine_mailing="../ub33";
 
$racine_mailing="../../ub33";
 
$racine_mailing="/home/ub33";
 
$racine_mailing="./home/ub33";
 
$racine_mailing="../home/ub33";
Se qui na servie a rien vue que sa ne fonctionne pas

Citation:
Envoyé par stealth35 Voir le message
c'est pas bon ça :

Code :
$racine_mailing="mnt/104/sdb/7/d/ub33";
Cordialement Stéphane
snip74 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 04h19.


 
 
 
 
Partenaires

Hébergement Web