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

WordPress PHP Discussion :

Supprimer un message Undefined index php


Sujet :

WordPress PHP

  1. #1
    Nouveau Candidat au Club
    Femme Profil pro
    graphiste, intégrateur du dimanche et panawan référenceur
    Inscrit en
    Mai 2014
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Somme (Picardie)

    Informations professionnelles :
    Activité : graphiste, intégrateur du dimanche et panawan référenceur
    Secteur : Industrie

    Informations forums :
    Inscription : Mai 2014
    Messages : 4
    Points : 1
    Points
    1
    Par défaut Supprimer un message Undefined index php
    Bonjour, bonjour


    Suite a l'installation de l'extension custom-password-protected-text/cppt.php, puis son utilisation, un message "notice Undefined index: wp-postpass....php" se place juste au dessus :
    http://www.auer.fr/chauffage/docutech

    je vous sollicite car je ne sais pas développer, juste comprendre (un peu ) et intégrer des trucs très simples.

    J'ai gratter un peu avant et (1-) notice ce n'est pas grave, d'ou l'éxé de mon script, (2-) si j'ai bien compris il faudrait mettre un truc du genre " display _errors = off"

    j'ai ouvert l'éditeur de l'extension, je regarde ce Zuperbe php, et puis rien... :-) je ne sais pas trop quoi, ni comment faire... je trouve rien sur les forums...

    Saving the designer !!!


    Merci d'avance

  2. #2
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Est-ce que cela fonctionne en dehors de l'erreur ?
    L'erreur est due au fait que le cookie contenant le mot de passe n'existe pas.
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  3. #3
    Expert éminent sénior

    Homme Profil pro
    Développeur Web
    Inscrit en
    Septembre 2010
    Messages
    5 382
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Puy de Dôme (Auvergne)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Septembre 2010
    Messages : 5 382
    Points : 10 410
    Points
    10 410
    Par défaut
    La doc est ici http://www.php.net/manual/fr/functio...-reporting.php

    Donc en haut de ta page cppt.php située à l'adresse indiquée par le rapport de bug, tu peux essayer de mettre
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    error_reporting(E_ALL & ~E_NOTICE);
    mais es-tu certaine que le script fonctionne correctement ?
    Normalement les erreurs on les corrige plutôt que de les planquer sous le tapis

  4. #4
    Nouveau Candidat au Club
    Femme Profil pro
    graphiste, intégrateur du dimanche et panawan référenceur
    Inscrit en
    Mai 2014
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Somme (Picardie)

    Informations professionnelles :
    Activité : graphiste, intégrateur du dimanche et panawan référenceur
    Secteur : Industrie

    Informations forums :
    Inscription : Mai 2014
    Messages : 4
    Points : 1
    Points
    1
    Par défaut
    ...je souhaiterai bien agir alors, si il s'agit du cookie de mot de passe qui n'existe pas, que dois-je faire ? (j'ai lu un truc pour comprendre cookies et entête http, mais pff... je ne sais toujours pas ce que je dois faire)

    l'utilisation de l'extension pour customiser mon message "page privée" fonctionne bien; j'ai pu y intégrer un formulaire de demande mot de passe, qui envoie bien, lui aussi la demande dans ma boite mail, sauf qu'au "submit" j'ai une page qui me dit
    Notice: Undefined index: post_password in /web/clients/s/socinda4/chauffage/wp-login.php on line 399
    Warning: Cannot modify header information - headers already sent by (output started at /web/clients/s/socinda4/chauffage/wp-login.php:399) in /web/clients/s/socinda4/chauffage/wp-login.php on line 399
    Warning: Cannot modify header information - headers already sent by (output started at /web/clients/s/socinda4/chauffage/wp-login.php:399) in /web/clients/s/socinda4/chauffage/wp-includes/pluggable.php on line 876
    désolée du niveau bac à sable...

  5. #5
    Expert éminent sénior

    Homme Profil pro
    Développeur Web
    Inscrit en
    Septembre 2010
    Messages
    5 382
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Puy de Dôme (Auvergne)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Septembre 2010
    Messages : 5 382
    Points : 10 410
    Points
    10 410
    Par défaut
    Bonjour,

    Là tu es mal embarquée. Soit l'extension a un bug tout au moins dans le contexte dans lequel tu l'utilise (incompatible avec le thème que tu utilises, attention aux versions) soit il y a eu un problème lors de l'installation/configuration.

    En tous les cas, au point où tu en es (en considérant les messages d'erreurs renvoyés) il est inutile de chercher à gratter dans le code, mieux vaut refaire l'installation en ayant pris soin de te renseigner sur les compatibilités/versions et de bien respecter la mise en place.

  6. #6
    Nouveau Candidat au Club
    Femme Profil pro
    graphiste, intégrateur du dimanche et panawan référenceur
    Inscrit en
    Mai 2014
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Somme (Picardie)

    Informations professionnelles :
    Activité : graphiste, intégrateur du dimanche et panawan référenceur
    Secteur : Industrie

    Informations forums :
    Inscription : Mai 2014
    Messages : 4
    Points : 1
    Points
    1
    Par défaut
    Bonjour,

    Merci pour les conseils, bon je retire tout, et je reprends à zéro en regardant bien les versions..

  7. #7
    Membre actif Avatar de zaza576
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Août 2013
    Messages
    175
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Août 2013
    Messages : 175
    Points : 275
    Points
    275
    Par défaut
    Bonjour,

    peux tu nous montrer ce qu'il se passe autour de la ligne 85 de ton fichier /web/clients/s/socinda4/chauffage/wp-content/plugins/custom-password-protected-text/cppt.php car c'est dans ces eaux-là que le problème subsiste !
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    function googleIsYourF*ck*ngFriend(String url, String maQuestion){
        goTo(url);
        reponse = find(maQuestion);
        if(isAcceptable(reponse)){
            clickOn(By.xpath("//button[@id='resolvedButton']"));
        }
        sendMessage("Merci");
    }
    
    googleIsYourF*ck*ingFriend("http://www.google.fr", "ma question");

  8. #8
    Nouveau Candidat au Club
    Femme Profil pro
    graphiste, intégrateur du dimanche et panawan référenceur
    Inscrit en
    Mai 2014
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Somme (Picardie)

    Informations professionnelles :
    Activité : graphiste, intégrateur du dimanche et panawan référenceur
    Secteur : Industrie

    Informations forums :
    Inscription : Mai 2014
    Messages : 4
    Points : 1
    Points
    1
    Par défaut
    voila le fichier ( pour zaza)

    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
    <?php
    /**
     * @package Custom Password Protected Text
     */
    /*
    Plugin Name: Custom Password Protected Text
    Plugin URI: <a href="http://www.marcelloscacchetti.it/en/" target="_blank">http://www.marcelloscacchetti.it/en/</a>
    Description: Custom text message for password protected pages
    Version: 1.0.0
    Author: Marcello Scacchetti
    Author URI: <a href="http://www.marcelloscacchetti.it/" target="_blank">http://www.marcelloscacchetti.it/</a>
    License: GPLv2 or later
    */
     
    /*
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    */
     
    define('CPPT_VERSION', '1.0.0');
    define('CPPT_PLUGIN_URL', plugin_dir_url( __FILE__ ));
     
     
    add_action('admin_menu', 'sampleoptions_add_page_fn');
    // Add sub page to the Settings Menu
    function sampleoptions_add_page_fn() {
    	add_options_page('Custom Password Protected Text', 'Custom Password Protected Text', 'administrator', __FILE__, 'options_page_fn');
    }
     
    function options_page_fn() {
    ?>
    	<div class="wrap">
    		<div class="icon32" id="icon-options-general"><br></div>
    		<h2>Custom Password Protected Text Options</h2>
    		Set in the field below the text you want to display on password protected pages/posts instead of the WordPress default one.
    		<form action="options.php" method="post">
    		<?php settings_fields('cppt_options'); ?>
    		<?php do_settings_sections(__FILE__); ?>
    		<p class="submit">
    			<input name="Submit" type="submit" class="button-primary" value="<?php esc_attr_e('Save Changes'); ?>" />
    		</p>
    		</form>
    	</div>
    <?php
    }
     
    add_action('admin_init', 'sampleoptions_init_fn' );
    // Register our settings. Add the settings section, and settings fields
    function sampleoptions_init_fn(){
    	register_setting('cppt_options', 'cppt_options' );
    	add_settings_section('main_section', 'Main Settings', 'section_text_fn', __FILE__);
    	add_settings_field('plugin_wp_editor', 'Custom Password Protected Text', 'setting_wp_editor_fn', __FILE__, 'main_section');
    }
     
    function section_text_fn() {
    	//echo "<h1>Section!!!</h1>";
    }
     
    function setting_wp_editor_fn() {
    	$options = get_option('cppt_options');
    	$settings = array(
    		'tinymce' => array( 'plugins' => 'wordpress' ),
    		'textarea_name' => 'cppt_options[plugin_wp_editor]' ,
    		'textarea_rows' => 15
    	);
    	wp_editor($options['plugin_wp_editor'], 'plugin_wp_editor', $settings);
    }
     
     
    function replace_the_password_form($content) {
     global $post;
     $options = get_option('cppt_options');
     // if there's a password and it doesn't match the cookie
     if ( !empty($post->post_password) && stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH])!=$post->post_password ) {
       $label = 'pwbox-' . ( empty($post->ID) ? rand() : $post->ID );
           $output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post">
           <p>' . $options['plugin_wp_editor'] . '</p>
           <p><label for="' . $label . '">' . __("Password:") . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr__("Submit") . '" /></p>
           </form>
           ';
       return $output;
     }
     else return $content;
    }
    add_filter('the_password_form','replace_the_password_form');
     
    ?>

Discussions similaires

  1. supprimer un message wordpress avec php et xmlrpc
    Par johnny-57 dans le forum WordPress
    Réponses: 0
    Dernier message: 20/09/2012, 13h37
  2. Réponses: 8
    Dernier message: 03/04/2007, 10h01
  3. Undefined index: trie in D:\nom\visual\visual.php
    Par Alain15 dans le forum Langage
    Réponses: 2
    Dernier message: 28/07/2006, 09h17
  4. [Php] error : Undefined index: MyBrainFound
    Par cyrill.gremaud dans le forum Langage
    Réponses: 3
    Dernier message: 14/02/2006, 11h39
  5. [MySQL] les messages de mon index.php.
    Par cari dans le forum PHP & Base de données
    Réponses: 14
    Dernier message: 18/01/2006, 09h21

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