PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.comp.lang.php > Re: include
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Re: include

Réponse
 
LinkBack Outils de la discussion
Vieux 24/07/2007, 22h13   #1
Rik
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: include

On Tue, 24 Jul 2007 23:04:46 +0200, Jean Pierre Daviau <Once@WasEno.ugh>
wrote:
> global $autoexec;
> $autoexec = "C:\backJP\autoexec.bat";


> --- snip ----
>
> require_once('paths.inc');
> function updateFichier(){
> if (!$myBool = fopen ($autoexec, "a")) {
> echo "Cant create($autoexec)";
> exit;
> }
>
> The include file is printed on screen
> The function exit with Cant create the file
>
> If I write
> function updateFichier(){
> global $autoexec;
> $autoexec = "autoexec.bat";


This last line is not neccesary

> ......
> it works . . .


You obviously missed something in scopes. I suggest you read up on it:
<http://www.php.net/global>

This very example is explained over there.
--
Rik Wasmus
  Réponse avec citation
Vieux 25/07/2007, 15h32   #2
Jean Pierre Daviau
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: include

It seems that the include path are not considered as files.
is_file($autoexec) returns false

I changed this:
--- inc file ----
$autoexec = "auto.bat";
$path = "\n%path%=%path%;c:\php\php.exe";
----

> --- snip ----

require_once('paths.inc');

function updateFichier(){
global $autoexec, $path;
> if (!$myBool = fopen ($autoexec, "a")) {
> echo "Cant create($autoexec)";
> exit;
> }
>
> The include file is printed on screen
> The function exit with Cant create the file



  Réponse avec citation
Vieux 26/07/2007, 15h36   #3
Jean Pierre Daviau
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: include

Nothing works.

The doc points that the function should be in the include. This
is not what I want.


Thanks.


  Réponse avec citation
Vieux 26/07/2007, 15h39   #4
Rik
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: include

On Thu, 26 Jul 2007 16:36:54 +0200, Jean Pierre Daviau <Once@WasEno.ugh>
wrote:

> Nothing works.
>
> The doc points that the function should be in the include. This
> is not what I want.


That's not what's wrong. You probably cannot create a file in C:\Program
Files\EasyPHP1-8\php\ due to rights
--
Rik Wasmus
  Réponse avec citation
Vieux 26/07/2007, 17h54   #5
Jean Pierre Daviau
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: include


On Xp I have all permissions and I set those folders for writing
and reading. Still does not work


  Réponse avec citation
Vieux 25/08/2007, 20h17   #6
6eWmA67gxAebq@jeanpierredaviau.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: include

On 26 juil, 12:42, "Jean Pierre Daviau" <O...@WasEno.ugh> wrote:
> I am on the command line how do I create the permission?
>
> get_include_path() === .;C:\php5\pear
> I putted the file there and EasyPhp is not running.
>
> "Rik" <luiheidsgoe...@hotmail.com> a écrit dans le message denews: op.tv2tnwltqnv3q9@metallium...
>
>
>
> > On Thu, 26 Jul 2007 16:36:54 +0200,JeanPierreDaviau
> > <O...@WasEno.ugh> wrote:

>
> >> Nothing works.

>
> >> The doc points that the function should be in the include.
> >> This
> >> is not what I want.

>
> > That's not what's wrong. You probably cannot create a file in
> > C:\Program Files\EasyPHP1-8\php\ due to rights
> > --
> > Rik Wasmus- Masquer le texte des messages précédents -

>
> - Afficher le texte des messages précédents -


The solution is to enclose the .inc variables in between <??>¨
--------- path.inc ---------------
<?php
$autoexec = "auto.bat";
$path = "\n%path%=%path%;c:\php\php.exe";

--------- eof path.inc ---------------
?>

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 20h45.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09653 seconds with 14 queries