Jump to content

Error Messages


onlyican

Recommended Posts

Hey guys

Let me explain a bit here

I run PHP on my machine, using the Apache (on a Windows Based System)

I also go down to the office some times to work on scrips
Which is running PHP on IIS

On My Machine I get error messages (Notice: Failed: ect ect)
But down the office I get a different message
A Notice
Notce: Unidifined index
which shows when I run a statement such as

echo "<input type='text' name='field' value='".$_POST["field"]."' />";

The error will be coming up as $_POST["field"] as not defined

A simple way round this is something like

$field = isset($_POST["field"]) ? $_POST["field"] : "";
echo "<input type='text' name='field' value='".$field."' />";

so I am not asking bout the error
BUT
When I build a script, I build it at home, and then show my boss on his machine, which means spending 10 mins correcting these errors

How do I set it to show me these errors on my machine

Cheers guys
Link to comment
https://forums.phpfreaks.com/topic/26441-error-messages/
Share on other sites

hmmm.  All that I can think of is that your office PHP installation is pre-4.1.0, when $HTTP_POST_VARS was used instead of $_POST.  If it is pre-4.1.0 I'd say the best thing is to upgrade or failing that, use $HTTP_POST_VARS, etc. instead.

Hope that helps.
Link to comment
https://forums.phpfreaks.com/topic/26441-error-messages/#findComment-120919
Share on other sites

no that does not help
As I said, the error is coming up as the var $_POST["field"] does not exists
if I post the form, which means $_POST["field"] is now set, then the error goes

I want to get those errors on my screen, so I can clean them up before I show him the result again
And for information, both versions of PHP are POST V5
Link to comment
https://forums.phpfreaks.com/topic/26441-error-messages/#findComment-120935
Share on other sites

ok, that kinda didn't work, although it should have, so what I done instead was I have a inc_header.php file, on the top of every page.

so I added some PHP code
error_reporting(2047);
(2047 is E_ALL)

Thanks for the help

and before you say it, yes I did restart the server
Link to comment
https://forums.phpfreaks.com/topic/26441-error-messages/#findComment-120964
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.