PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > <? tag not reconised, <?php works ok
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
<? tag not reconised, <?php works ok

Réponse
 
LinkBack Outils de la discussion
Vieux 16/02/2008, 12h16   #1
JoeB
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut <? tag not reconised, <?php works ok

Hi,

Since the ISP changed somthing, the opening php tag no longer works.

<? echo("joe"); ?>

fails, where as this code:

<?php echo("joe"); ?>

works as expected.

Is there a setting in the phpinfo where i can see if this is disabled?
PHPinfo reports version 4.4.7.

This is the 1st time ive seen this error, and its a masive headache as
the web design co (the old company) wrote the entire site (1000's of
pages) using <? instead of <?php



Please please me!!


Joe

  Réponse avec citation
Vieux 16/02/2008, 12h29   #2
Iván Sánchez Ortega
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: <? tag not reconised, <?php works ok

JoeB wrote:

> Since the ISP changed somthing, the opening php tag no longer works.
>
> <? echo("joe"); ?>
>
> fails, where as this code:
>
> <?php echo("joe"); ?>
>
> works as expected.
>
> Is there a setting in the phpinfo where i can see if this is disabled?
> PHPinfo reports version 4.4.7.


Yes, it's called "short_tags" and is disabled by default.

Having it enabled may cause some problems when using "<?xml" at the start of
your XHTML documents.

> This is the 1st time ive seen this error, and its a masive headache as
> the web design co (the old company) wrote the entire site (1000's of
> pages) using <? instead of <?php


Well, then just write a script to do the dirty work for you.

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

MSN:i_eat_s_p_a_m_for_breakfast@hotmail.com
Jabber:ivansanchez@jabber.org ; ivansanchez@kdetalk.net
  Réponse avec citation
Vieux 16/02/2008, 13h31   #3
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: <? tag not reconised, <?php works ok

JoeB wrote:
> Hi,
>
> Since the ISP changed somthing, the opening php tag no longer works.
>
> <? echo("joe"); ?>
>
> fails, where as this code:
>
> <?php echo("joe"); ?>
>
> works as expected.
>
> Is there a setting in the phpinfo where i can see if this is disabled?
> PHPinfo reports version 4.4.7.
>
> This is the 1st time ive seen this error, and its a masive headache as
> the web design co (the old company) wrote the entire site (1000's of
> pages) using <? instead of <?php
>
>
>
> Please please me!!
>
>
> Joe
>
>


In addition to what Iván said, plan on changing all of those short tags.
But while there are 100's of pages, I suspect there aren't 1000's of
source files - probably most of those pages are generated from a few
scripts.

It's a good thing you got rid of that old design company.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 16/02/2008, 13h34   #4
JoeB
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: <? tag not reconised, <?php works ok

On 16 Feb, 12:29, Iván Sánchez Ortega <ivansanchez-...@rroba-
escomposlinux.-.punto.-.org> wrote:
> JoeB wrote:
> > Since the ISP changed somthing, the opening php tag no longer works.

>
> > <? echo("joe"); ?>

>
> > fails, where as this code:

>
> > <?php echo("joe"); ?>

>
> > works as expected.

>
> > Is there a setting in the phpinfo where i can see if this is disabled?
> > PHPinfo reports version 4.4.7.

>
> Yes, it's called "short_tags" and is disabled by default.
>
> Having it enabled may cause some problems when using "<?xml" at the start of
> your XHTML documents.
>
> > This is the 1st time ive seen this error, and its a masive headache as
> > the web design co (the old company) wrote the entire site (1000's of
> > pages) using <? instead of <?php

>
> Well, then just write a script to do the dirty work for you.
>
> --
> ----------------------------------
> Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-
>
> MSN:i_eat_s_p_a_m_for_breakf...@hotmail.com
> Jabber:ivansanc...@jabber.org ; ivansanc...@kdetalk.net


Ive managed to find and replace most of them, the only ones i cannot
find is the ones where there is a new line directly after the tag:

<?
code...


Can someone come up with a way of finding these? Im using textpad,
and it supports regex find expressions.


Thanks for all the ..


Jeo
  Réponse avec citation
Vieux 16/02/2008, 16h13   #5
Michael Fesser
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: <? tag not reconised, <?php works ok

..oO(JoeB)

>Ive managed to find and replace most of them, the only ones i cannot
>find is the ones where there is a new line directly after the tag:
>
><?
>code...


Huh? Why can't your editor find a simple "<?" string, regardless of
whether there's a line break following or not? This shouldn't matter.

>Can someone come up with a way of finding these? Im using textpad,
>and it supports regex find expressions.


The regex could be something like

<\?\n

HTH
Micha
  Réponse avec citation
Vieux 16/02/2008, 16h40   #6
JoeB
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: <? tag not reconised, <?php works ok

On 16 Feb, 16:13, Michael Fesser <neti...@gmx.de> wrote:
> .oO(JoeB)
>
> >Ive managed to find and replace most of them, the only ones i cannot
> >find is the ones where there is a new line directly after the tag:

>
> ><?
> >code...

>
> Huh? Why can't your editor find a simple "<?" string, regardless of
> whether there's a line break following or not? This shouldn't matter.
>
> >Can someone come up with a way of finding these? Im using textpad,
> >and it supports regex find expressions.

>
> The regex could be something like
>
> <\?\n
>
> HTH
> Micha


HI,

My editor can find "<?" but it finds thousands of them, most of which
are already "<?php"

The odd one is <? which i cannot find. The editor says it cannot run a
regex with \n in it!

J
  Réponse avec citation
Vieux 16/02/2008, 19h18   #7
Iván Sánchez Ortega
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: <? tag not reconised, <?php works ok

JoeB wrote:

> My editor can find "<?" but it finds thousands of them, most of which
> are already "<?php"


Quick and dirty solution: just do that, and then replace "<?phpphp"
with "<?php" ;-)

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Oye, ¿tenéis un poco de cinta adhesiva? Es que se me está soltando el
propulsor a chorro de la espalda.
-- Piers Sellers, astronauta del Discovery, al Control de
Misión de la NASA, al percatarse de cierto peligro durante la pasada misión
STS-121.
  Réponse avec citation
Vieux 16/02/2008, 19h26   #8
Charles Calvert
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: <? tag not reconised, <?php works ok

On Sat, 16 Feb 2008 05:34:00 -0800 (PST), JoeB <joe@kybert.com> wrote
in
<1d68b85b-6e7e-4c44-9a34-6ff0000aa8c3@p73g2000hsd.googlegroups.com>:

>On 16 Feb, 12:29, Iván Sánchez Ortega <ivansanchez-...@rroba-
>escomposlinux.-.punto.-.org> wrote:
>> JoeB wrote:
>> > Since the ISP changed somthing, the opening php tag no longer works.

>>
>> > <? echo("joe"); ?>

>>
>> > fails, where as this code:

>>
>> > <?php echo("joe"); ?>

>>
>> > works as expected.

>>
>> > Is there a setting in the phpinfo where i can see if this is disabled?
>> > PHPinfo reports version 4.4.7.

>>
>> Yes, it's called "short_tags" and is disabled by default.
>>
>> Having it enabled may cause some problems when using "<?xml" at the start of
>> your XHTML documents.
>>
>> > This is the 1st time ive seen this error, and its a masive headache as
>> > the web design co (the old company) wrote the entire site (1000's of
>> > pages) using <? instead of <?php

>>
>> Well, then just write a script to do the dirty work for you.

>
>Ive managed to find and replace most of them, the only ones i cannot
>find is the ones where there is a new line directly after the tag:
>
><?
>code...
>
>Can someone come up with a way of finding these? Im using textpad,
>and it supports regex find expressions.


TextPad doesn't support line endings in regular expressions (at least
not as of 4.7, the version that I have).

Why not just write a php script to handle it? You can run php from
the command-line too.
--
Charles Calvert | Software Design/Development
Celtic Wolf, Inc. | Project Management
http://www.celticwolf.com/ | Technical Writing
(703) 580-0210 | Research
  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 07h22.


Édité par : vBulletin® version 3.7.3
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 ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,15719 seconds with 16 queries