Do you have <?php and ?> in your .inc file?...
----- Original Message -----
From: Ted Goranson <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Saturday, January 13, 2001 12:35 AM
Subject: [PHP] ereg works in .php, not in .inc
> Friends--
>
> I have a script that processes another script for display. I change
> all variables named similar to "$Help1x1" to Help:
>
> The following line accomplishes this readily when used in a .php
> suffixed script when called directly from browser.
>
> $content = ereg_replace ("[\$]Help[0-9]x[a-z]? =",
> "<STRONG>Help:</STRONG>", $content);
>
> However, if I instead call a .php script that includes an .inc with
> this command, it doesn't work. If important, the entire script is
> below. Sometimes, the last two str_replace lines also fail from .inc.
>
> Is this something simple that I'm missing?
>
> Best, Ted
>
> <?php
>
> $fp = fopen("/usr/local/apache/php/Level1Questions.inc", "r");
> $content = fread($fp, 100000);
> $content = str_replace ("//", "", $content);
> $content = str_replace ("<?php", "", $content);
> $content = str_replace ("?>", "", $content);
> $content = str_replace ("**", "<BR><BR>", $content);
> $content = str_replace ("Question:", "<STRONG>Question:</STRONG>",
$content);
> $content = str_replace ("Answer:", "<STRONG>Answer:</STRONG>", $content);
> $content = str_replace ("Answers:", "<STRONG>Answers:</STRONG>",
$content);
> $content = str_replace ("@@@", "</STRONG></P>", $content);
> $content = str_replace ("@@", "<P align=center><STRONG>", $content);
> $content = str_replace ("++++++", "<HR>", $content);
> $content = ereg_replace ("[\$]Help[0-9]x[a-z]? =",
> "<STRONG>Help:</STRONG>", $content);
> $content = ereg_replace ("[\$]BigHelp[0-9]x[0-9] =",
> "<STRONG>TEXT:</STRONG>", $content);
>
> echo "$content";
>
> ?>
> _____________
> Ted Goranson
> Fusecap and Sirius-Beta, Virginia Beach USA
> 757/426-6704
> [EMAIL PROTECTED]
> Symmetry Conference: http://www.isis-s.unsw.edu.au
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]