PDA

View Full Version : Add variable to print_standard_error ..etc


Moya
03-30-2005, 02:53 PM
Hello All,

Is it possible to add variables to a standard error?

for example

I have the standard error as

"You are not allow to post because blah blah"

Now I want to change it to

"You are not allow to post because you are at the IP:xxx.xxx.xxx.xxxx"

==> The IP:xxx.xxx.xxx.xxxx is the variable generated from the php files.

Please show me how to incorporate this one onto vb error message

Thanks

Marco van Herwaarden
03-30-2005, 02:57 PM
You can define parameters passed by reference into error messages (phrases).

Use '{1}' for the first passed parameter.

Moya
03-31-2005, 03:24 PM
Hi MarcoH64,

Thanks for replying to my thread. Would you please be more specific.

I only see this like as eval(print_standard_error("invalidid")). How would we pass the parameters?

Thanks

Marco van Herwaarden
03-31-2005, 06:37 PM
You are right, when using the print_standard_error function you can not use parameters for phrases.

You can with the satement:
construct_phrase($vbphrase['my_phrase_with_parameter'], $parameter)retrieve the phrase with a parameter replacement.

If you now use the following for the error (mind the extra ', 0'):
print_standard_error('my text', 0);
The error text will now not be retrieved from a phrase by the print_standard_error function, but instead the text you pass will be used.

Moya
03-31-2005, 08:52 PM
Thanks

I will try tonite