IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

PHP5.3.2 vers 5.3.4


Sujet :

Langage PHP

Mode arborescent

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé Avatar de ETVigan
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Avril 2010
    Messages
    660
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Gard (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : Finance

    Informations forums :
    Inscription : Avril 2010
    Messages : 660
    Par défaut PHP5.3.2 vers 5.3.4
    Bonjour,

    j'ai souhaité passer à PHP 5.3.4 hier et ce matin, php ne tourne plus.
    Je rétrograde à 5.3.2 et idem.... même en reboutant mon pc et en redémarrant PHP.
    Quand, j'essaye d'exécuter un virtualhost, j'ai une fenêtre qui s'ouvre me demandant avec quel logiciel il faut ouvrir le script.
    J'ai 2 sources, index et date.php

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
     INDEX.PHP
    <!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=utf-8" />
    <!-- ============================================================================================================================ -->
    <!-- ===                        Style                                                                                         === -->
    <!-- ============================================================================================================================ -->
    <link href="../css/jecrapahute.css" rel="stylesheet" type="text/css"/>
    <!-- ============================================================================================================================ -->
    <title>Class Date Test</title>
    </head>
    <?php
    // =============================================================================================================================== //
    require_once $_SERVER['DOCUMENT_ROOT'] .  "/class/equate.php";       
    require_once $_SERVER['DOCUMENT_ROOT'] .  "/class/date.php";       
    // =============================================================================================================================== //
    /**
    *	Définition ds champs
    *	====================
    */	
    require_once $_SERVER['DOCUMENT_ROOT'] . "/config/constants.php";
    require_once $_SERVER['DOCUMENT_ROOT'] . "/config/newFuncts.php";  
    
    	$birthdate = new Date (  "naissance"	,   MUST    ,   "Date de naissance"                 ,   TODAY              			) ;
    	$birthdate->setDefault() ;
    // 	$birthdate->debug() ;
    /**
    *	Interception du bouton SUBMIT
    *	=============================
    */	
       	if (isset($_POST['Submit']))
    		{//	if ($this->debug)
    				user_error("POST SUBMIT CATCHED" , E_USER_NOTICE) ;
     			if ($birthdate->isFieldValid())
    				{	# Formulaire valide
        				# =================
    					$result = $birthdate->getFieldValue() ;
     					$msg    = "Date Valide[".$result."]" ;
    					user_error("Date Valide[$result]", E_USER_NOTICE) ;
        			}
         		else 
    				{	# Formulaire invalide
        				# ===================
    					$msg    = "Date Invalide ! " ;
    					user_error("Date Invalide", E_USER_NOTICE) ;
    				}
    
        	}
    
    /**
    * 	HTML FORM DEFINITION
    *
    */	
     	require_once $_SERVER['DOCUMENT_ROOT'] . "/config/newFuncts.php";  
    ?>
    
    <body>
    
    <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" name="date" id="date">
      <table width="818" border="1">
        <tr>
          <td width="100">&nbsp;</td>
          <td width="400"><div align="center">Test de la classe <em>DATE</em></div></td>
          <td width="100">&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><?php $birthdate->display() ?></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td colspan="3"><hr /></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td width="400"><label>
            <input name="msg" type="text" id="msg" value="<?php if (isset($msg)) echo $msg ?>" size="50" maxlength="50" />
          </label></td>
          <td><div align="center">
            <input type="submit" name="Submit" id="Submit" value="Submit" />
          </div></td>
        </tr>
      </table>
      <hr />
    </form>
    </body>
    </html>
    Puis la classe:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
     DATE.PHP
    <?php
    /**
    * 	DATE[validation] constructor
    *
    */	
    class Date // extends Form
    {	private	$defYY = NULL , $YY = NULL ;
    	private	$defMM = NULL , $MM = NULL ;
    	private	$defDD = NULL , $DD = NULL ;
    	private $month   = array	(	"01"   =>  "Jan" , 	"02"   =>  "Fev"  ,	"03"  =>  "Mar"  ,	"04"   	=>  "Avr" ,
    									"05"   =>  "Mai" ,	"06"   =>  "Juin" ,	"07"  =>  "Juil" ,	"08"	=>  "Aou" ,
    									"09"   =>  "Sep" ,	"10"   =>  "Oct"  ,	"11"  =>  "Nov"  ,	"12"  	=>  "Dec" 
    								) ;
    
    	function __construct($name, $must, $legend, $default, $debug=false)
    	{	$this->name   = $name ;
    		$this->must   = $must ;
    		$this->legend = $legend ;
    		$this->value  = (isset( $_POST["$this->name"] ) ) ? trim($_POST["$this->name"]) : NULL ;
    		$this->debug  = $debug ;
    
    		if (isset($default))
    			switch($default) 
    			{	case TODAY 	:	$this->date = date("Ymd") ; 
    								break ;
    								
    				default		: 	user_error("Invalid Date default", E_USER_ERROR) ;
    								break ;
    			}		
    		else
    			$this->date = date("Ymd") ; 
    // ==================================================================	20101109
    /*
    		$this->YY	= $this->fill(substr($this->date,0,4),4) ;		//	========
    		$this->MM	= $this->fill(substr($this->date,4,2),2) ;  	//	01234567	
    		$this->DD	= $this->fill(substr($this->date,6,2),2) ;  	// 	YYYYMMDD
    
    		if ($this->debug)
    			var_dump("===> CONSTRUCT DATE =>: ",$this->date) ;
    */
    	}
    	
    	function __destruct()
    	{	}
    	
    	function execute()
    	{		}
    
    /**
    *	validate
    *	========
    */
    	function validate()
    	{	return( checkdate($this->fill($this->MM,2), $this->fill($this->DD,2),  $this->fill($this->YY,4) )  ? OK : ERRDATE) ;  }
    	
    /**
    *	debug
    *	=====
    */
    	function debug()
    	{	var_dump($this->defYY , $this->YY , $this->defMM ,  $this->MM ,	$this->defDD , $this->DD )	 ;
    	}
    	
    /**
    *	setDefault
    *	==========
    */
    	function setDefault($defYY=NULL, $defMM=NULL, $defDD=NULL)
    	{	$this->defYY = ($defYY != NULL) ? $defYY : date("Y") ;
    		$this->defMM = ($defMM != NULL) ? $defMM : date("m") ;
    		$this->defDD = ($defDD != NULL) ? $defDD : date("d") ;
    	}
    	
    /**
    *	pickup
    *	=======
    *
    */	
    	function pickup($start,$end,$len,$frmfld,$default)
    	{	echo "<select name='" . $frmfld . "' id='" . $frmfld . "'>\n";
    		for ($i = $start ; $i <= $end ; $i++)
    		{	$d = $this->fill($i,$len) ;
     			if (strcmp($default,$d) == 0)
    				echo '  <option value="' . $d . '" selected">' . $d. "</option>\n" ;
    			else
    				echo '  <option value="' . $d .           '">' . $d . "</option>\n" ;
    		}
    		echo "</select>\n" ;
    	}
    /**
    *	select
    *	=======
    *
    */	
    	function select($valarray,$frmfld,$default)
    	{	echo "<select name='" . $frmfld . "' id='" . $frmfld . "'>\n";
    		foreach ($valarray as $key => $value)
    		{	if (strcmp($default,$key) == 0)
    				echo '  <option value="' . $key . '" selected">' . $value . "</option>\n" ;
    			else
    				echo '  <option value="' . $key .           '">' . $value . "</option>\n" ;
    		}
    		echo "</select>\n" ;
    	}
    	
    /**
    *	fill
    *	====
    */
    	function fill($str,$len)
    	{	//user_error("==> fill[".$str."]  <= [".strlen($str)."] < [".$len."]",E_USER_NOTICE) ;
    		for ($i = 0 ; strlen($str) < $len ; $i++)
    		{	//user_error("+" , E_USER_NOTICE) ;
    			$str = "0" . $str ;
    		}
    		//user_error("==> fill[".$str."] - [".$len."]",E_USER_NOTICE) ;
    		return($str) ;
    	}
    
    /**
    *	display
    *	=======
    *
    */	
    	function display()
    	{	$this->DD = (isset($_POST["DD"])) ? $_POST["DD"] : date("d") ;
    		$this->MM = (isset($_POST["MM"])) ? $_POST["MM"] : date("m") ;  // format interne
    		$this->YY = (isset($_POST["YY"])) ? $_POST["YY"] : date("Y") ; 
    		
    		echo "<fieldset><legend  class='form_lbl'>" ;
    		echo $this->legend ;
    		echo "</legend>" ;
    		
    		echo '<span class="form_fld fieldset">' ;
    		$this->pickup(1,31,2, $name="DD",$default=$this->DD) ;
    		echo '</span>' ;    	
    		echo '<span class="form_bkg fieldset">' ;
    		echo "-" ;
    		echo '</span>' ;    	
    		
    		echo '<span class="form_fld fieldset">'  ;
    		$this->select($this->month, $name="MM",$default=$this->MM) ; //array_search($this->MM, $this->month)) ;
    		echo '</span>' ;    	
    		echo '<span class="form_bkg">' ;
    		echo "-" ;
    		echo '</span>' ;    	
    		
    		echo '<span class="form_fld">'  ;
    		$this->pickup(1920,2020,4, $name="YY",$default=$this->YY) ;
    		echo '</span>' ;    
    			
    		echo "</fieldset>" ;
    
    		$this->YY = (isset($_POST["YY"])) ? $_POST["YY"] : date("Y") ;		
    		$this->MM = (isset($_POST["MM"])) ? $_POST["MM"] : date("m") ;	  // format interne	
    		$this->DD = (isset($_POST["DD"])) ? $_POST["DD"] : date("d") ;		
     
    		$this->value = $this->getFieldValue() ;
    		user_error("display(2) => Date de naissance[".$this->value."]", E_USER_NOTICE) ;
    	}
    /**
    *	getFieldName
    *	============
    *
    */	
    	function getFieldName()
    	{	return($this->name) ; }
    	
    /**
    *	getFieldLegend
    *	==============
    *
    */	
    	function getFieldLegend()
    	{	return($this->legend) ; }
    	
    /**
    *	getFieldValue
    *	=============
    *
    */	
    	function getFieldValue($format="YYYY-MM-DD")
    	{	switch($format)
    		{	case "YYYYMMDD" 	:	$this->value = sprintf("%04s%02s%02s",$this->YY, $this->MM, $this->DD) ;
    									break ;
    								
    			case "YYYY-MM-DD" 	:	$this->value = sprintf("%04s-%02s-%02s",$this->YY, $this->MM, $this->DD) ;
    									break ;
    								
    			case "YYYY-MON-DD" 	:	$this->value = sprintf("%04s-%02s-%02s",$this->YY, $this->month[$this->MM], $this->DD) ;
    									break ;
    								
    			default				:   user_error("Invalid format parameter in getFieldValue[".$format."]", E_USER_ERROR) ;
    		}
    		user_error("===>getFieldValue[$this->value]" , E_USER_NOTICE) ;										 
    		return( $this->value ) ; 
    	}
    /**
    *	isFieldValid
    *	============
    *
    */	
    	function isFieldValid()
    	{	$rc = $this->validate() ;
    		user_error("isFielValid[".$rc."]", E_USER_NOTICE) ;
    		return( $rc ) ; 	
    	}
    }
    /** =========================================================================================================================================================
    *	End Of Class: DATE
    * ======================================================================================================================================================== */
    ?>
    Voici ce que j'ai à l'écran:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
     setDefault() ; // $birthdate->debug() ; /** * Interception du bouton SUBMIT * ============================= */ if (isset($_POST['Submit'])) {// if ($this->debug) user_error("POST SUBMIT CATCHED" , E_USER_NOTICE) ; if ($birthdate->isFieldValid()) { # Formulaire valide # ================= $result = $birthdate->getFieldValue() ; $msg = "Date Valide[".$result."]" ; user_error("Date Valide[$result]", E_USER_NOTICE) ; } else { # Formulaire invalide # =================== $msg = "Date Invalide ! " ; user_error("Date Invalide", E_USER_NOTICE) ; } } /** * HTML FORM DEFINITION * */ require_once $_SERVER['DOCUMENT_ROOT'] . "/config/newFuncts.php"; ?>
    càd la partie en gras de index.php en tête de ce fichier.

    Je mets mon php.ini en tant que php.asm en pièce attachée.

    Cela doit être con comme la lune mais je ne vois pas....

    Merci à tous pour votre aide
    Fichiers attachés Fichiers attachés

Discussions similaires

  1. [Oracle] Migration PHP4+oracle 8i vers PHP5+oracle 9i
    Par erox44 dans le forum PHP & Base de données
    Réponses: 1
    Dernier message: 14/03/2008, 14h05
  2. [PHP 4] vers [PHP5] Windows
    Par lenoil dans le forum IIS
    Réponses: 6
    Dernier message: 24/05/2007, 15h48
  3. Réponses: 3
    Dernier message: 08/03/2007, 15h13
  4. [Debian + Apache2] PHP4 vers PHP5
    Par Jean_Benoit dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 2
    Dernier message: 01/05/2006, 17h43
  5. [POO] class php4 vers php5, redefinition de $this
    Par jeff_! dans le forum Langage
    Réponses: 1
    Dernier message: 23/03/2006, 19h33

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo