php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6460 bug in eregi_replace???
Submitted: 2000-08-31 06:11 UTC Modified: 2000-09-21 10:27 UTC
From: anpe at sensei dot org Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.1pl2 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: anpe at sensei dot org
New email:
PHP Version: OS:

 

 [2000-08-31 06:11 UTC] anpe at sensei dot org
php  FILE
<-----  BEGIN ------>
<?php
function traduceChar($phrase) {
  switch($phrase) {
    case "charPreferences":	$tmp = "Preferencias"; break;
    case "charDoTests":	$tmp = "Hacer Tests"; break;
    case "charHistory":	$tmp = "Historial"; break;
    case "charMail":	$tmp = "Correo"; break;
    case "charHelp":	$tmp = "Ayuda"; break;
    default: $tmp = "$phrase : Error"; break;
    }
    return $tmp;
}





function loadPage($htmlArchive) {

if ( file_exists("./$htmlArchive") )    {
	$fd = fopen("./$htmlArchive" , "r");
	while (!feof($fd)) {
		$buffer = fgets($fd, 4096);
		if ( eregi( "<#([A-Z]+)>", $buffer ) ) {
	      	    echo eregi_replace( "<#([A-Z]+)>", traduceChar("\\1") ,$buffer );
    		    }
	    else	
		    {
	    	    echo $buffer;
		    }
	  }
          fclose ($fd);
}
else

 {
 die("Error");
 }

}loadPage("menu.html");
?>

<-----  END ------>


Next menu.html

<-----  BEGIN ------>
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<link rel='stylesheet' type='text/css' href='style.css'>
<body bgcolor='#FFFFFF' topmargin='0' leftmargin='0' 
marginheight='0' marginwidth='0' text='#000000'
link='#FF66CC' alink='#FF99FF' vlink='#FF66CC'>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH=100%>
<TR><TD ALIGN=LEFT><IMG SRC="icons/logo.jpg"></TD></TR>
<TR HEIGHT="1"><TD HEIGHT="1" BGCOLOR="#000000"><IMG SRC="icons/nullb.gif" HEIGHT="1" WIDTH="1"></TD></TR>
</TABLE><TABLE BORDER="0" ALIGN=CENTER CELLSPACING="0" CELLPADDING="3" BGCOLOR="FFFFDD" WIDTH=100%>
<TR ALIGN=CENTER>
<TD><A HREF="<#hrefPreferences>"><IMG SRC="icons/admin.gif" BORDER="0"></A></TD>
<TD><A HREF="<#hrefTests>"><IMG SRC="icons/test.gif" BORDER="0"></A></TD>
<TD><A HREF="<#hrefHistory>"><IMG SRC="icons/grafico.gif" BORDER="0"></A></TD>
<TD><A HREF="<#hrefMail>"><IMG SRC="icons/mailbox.gif" BORDER="0"></A></TD>
<TD><A HREF="<#hrefHelp>"><IMG SRC="icons/admiracion.gif" BORDER="0"></A></TD>
</TR>
<TR ALIGN=CENTER>
<TD><A HREF="<#hrefPreferences>"><#charPreferences></A></TD>
<TD><A HREF="<#hrefTests>"><#charDoTests></A></TD>
<TD><A HREF="<#hrefHistory>"><#charHistory></A></TD>
<TD><A HREF="<#hrefMail>"><#charMail></A></TD>
<TD><A HREF="<#hrefHelp>"><#charHelp></A></TD>
</TR>
</TABLE><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH=100%>
<TR HEIGHT="1" ><TD HEIGHT="1" BGCOLOR="#000000"><IMG SRC="icons/nullb.gif" HEIGHT="1" WIDTH="1"></TD></TR>
</TABLE>
</BODY>
</HTML>
<-----  END ------>


Modules Compiled --> Mysql
No php.ini modified
Standar Setup like the INSTALL file

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-31 06:23 UTC] anpe at sensei dot org
This Script is a simple Traduction of some HTML Tags
 [2000-08-31 08:45 UTC] stas@php.net
so, what's the problem there? Could you please cut down your code to shortest reproducing script possible and clearly describe what's the problem? Also, before doing this, please check 4.0.2.
 [2000-09-21 10:27 UTC] sniper@php.net
No feedback. And not enough info either. 

--Jani
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 23:00:01 2026 UTC