Re: Script Problems
| From: | David Tod Sigafoos | Date: | Tue, 28 Nov 2000 17:49:34 +0000 |
| Subject: | Re: Script Problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27636@lists.php.net to get a copy of this message | ||
Hello Mark,
Tuesday, November 28, 2000, 9:37:35 AM, you wrote:
MB> My apologies if this message shows up twice on the mail list, my
MB> original posting doesn't appear to have gone through.......
MB> I am in the process of moving my website off of a linux box running
MB> php3, on to a Win2k server running php4 and several of my scripts
MB> have stopped working correctly. The problem is I keep getting
MB> undefined variable errors on scripts that ran perfectly fine under
MB> php3. For example;
MB> <tr>
MB> <td bgcolor="#006699" align="center" width="245">
MB> <input type="hidden" name="app"
MB> value="application">
MB> <font face="Arial, Helvetica, sans-serif" color="#FFFFFF"
size="2">>Model Number</font><br>
MB> <input type="text" name="model" size="22"
MB> maxlength="20"
MB> value="<?php echo $model?>">
MB> </td>
MB> Returns - Warning: Undefined Variable: model in .....Then the file
MB> name and line number.
MB> This one:
MB> <td bgcolor="#006699" align="center" width="245">
MB> <input type="hidden" name="parts"
MB> value="primary_description">
MB> <font face="Arial, Helvetica, sans-serif" color="#FFFFFF"
size="2">>Parts Description</font><br>
MB> <input type="text" name="part" size="22"
MB> maxlength="25"
MB> value="<?php echo $part?>">
MB> </td>
MB> Returns - Warning: Undefined Variable: part in .......etc., etc.
MB> Everything runs fine under php3 and linux, but falls apart under
MB> php4 and Win2k. Any suggestions?
There is a php.ini setting for the level of errors which will be
displayed.
This is a real problem as simply changing the level does nothing to
correct poor coding practices (no offense here not talking
specifically to you).
I recently tried using a script that was very highly touted for what
it does and indeed if you turn off all errors it does see nice. But
why would people design that way. There were so many errors the the
script was completely crippled. An not just variables unassigned ..
but just sloppy (to me) practices like array[bgcolor] instead of
array['bgcolor'] or defining bgcolor before hand.
Sorry .. getting off soap box
--
DSig
David Tod Sigafoos
mailto:dsig@teleport.com