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

  FORUM HardWare.fr
  Programmation
  PHP

  Warning: preg_match() [function.preg-match] j'ai besoin d'un aidé

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Warning: preg_match() [function.preg-match] j'ai besoin d'un aidé

n°1856204
mr-mehdi
Posté le 28-02-2009 à 06:26:40  profilanswer
 

Warning: preg_match() [function.preg-match]: Unknown modifier '/' in /usr/var/www/virtual/x-x-x.com/htdocs/template_registration.php on line 680
 
 
line 680  
 
  if(preg_match("/\/".$domain_url."/cart_items.html/",$_SERVER['PHP_SELF']))
 
 
 
Warning: preg_match() [function.preg-match]: Unknown modifier '/' in /usr/var/www/virtual/x-x-x.com/htdocs/template_registration.php on line 684
 
 
 
line 684
 
  if(!preg_match("/\/".$domain_url."/cart_items.html/",$_SERVER['PHP_SELF'])){  ?>
 
 
si koi le faute dans les line  
 
et si koi  le bonne line

mood
Publicité
Posté le 28-02-2009 à 06:26:40  profilanswer
 

n°1856224
PierreC
Posté le 28-02-2009 à 11:18:38  profilanswer
 

uen expression régulière doit etre cadré par un caractère en début et fin. En général on utilise le slash, mais dans ton cas vue que tu recherche un path c'est pas l'idéal, je crois qu'on peux tu un # (ou peut etre n'importe quel autre caractère)
 
je testerai cela : (pas testé)
if(preg_match("#/".$domain_url."/cart_items.html#",$_SERVER['PHP_SELF']))  
 
a+


---------------
Du tofu en Alsace : www.tofuhong.com
n°1856299
FlorentG
Unité de Masse
Posté le 28-02-2009 à 16:36:16  profilanswer
 

Et pour une string simple, mieux vaut utiliser strpos, qui sera beaucoup plus performante :)

Code :
  1. if(strpos($_SERVER['PHP_SELF'], '/' . $domain_url . '/cart_items.html') !== false) {
  2.  ...
  3. }


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

  Warning: preg_match() [function.preg-match] j'ai besoin d'un aidé

 

Sujets relatifs
Besoin d'une grosse aidebesoin d'aide pour finaliser mon site (position text et hover)
aide pour coder un petit scriptAide
aide en codage en phpEtudiante en lettre recherche aide pour devoir !!2eme édition
Etudiante en lettre recherche aide pour devoir !!Menu multilevel (besoin de mettre le sous-menu a gauche!!)
Plus de sujets relatifs à : Warning: preg_match() [function.preg-match] j'ai besoin d'un aidé


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