Posted by Floortje on 03/15/07 13:23
Sonnich schreef:
> Hi!
>
> I want to have a number of strings in another file, which I can
> include everywhere... but I cannot make them reachable from the top
> file. I have looked at var and global to to this but without luck.
> The idea is to have all text the same place, which minimses changes
> and spelling errors.
>
> something like error messages stored:
>
> <?
> $sError001="stupid user";
> $sError002="not available";
> ?>
>
> and then :
>
> include "errormsgs.php";
> echo $sError001;
This should work. You have another error. \
Btw set it up a little different. That way you can allways change ur
error code without redoing the same echo over and over again.
include('somefile');
showerror(1);
function showerror($no)
{
$errors=array(
1=>'wrong page',
2=>'hack attempt'
)
echo $errors[$no];
// do stuff here later
}
--
Arjen
http://www.hondenpage.com
Navigation:
[Reply to this message]
|