Newbie help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
johnperkins21
Forum Contributor
Posts: 140
Joined: Mon Oct 27, 2003 4:57 pm

Post by johnperkins21 »

It's an internal dev server.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

is there any way for you to upload it to a different server to see if it is infact your computer?
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

johnperkins21 wrote:Apparently I should just give up. Now I just get a blank page. I tried another php page in the same directory and it works fine (another image gallery that I d/l to get ideas). It is very strange.

For the record:

Server is Red Hat 8 running Apache 1.3.22 with PHP 4.3.2.
Using IE 6.0.2 locally to view and Dreamweaver to edit the files directly on the server (just switched to Wordpad though 10 minutes ago). Local machine running WinXP completely updated. If you guys have any ideas, I'd be happy to hear 'em.
i hate the added crap dreamweaver puts there. have you thought about getting emacs or xemacs? (both have winblows ports)

how about testing it with a browser that understands what a standard is? (ie: not M$IE)
Last edited by m3rajk on Wed Oct 29, 2003 2:26 pm, edited 1 time in total.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

A quick side note on adding elements to arrays: it is quite important to declare $var = array(); before adding elements with $var[] = 'value';

If you don't, $var is initially undefined. This can create a big security risk particularly if register globals is on. An attacker could set an initial value for your $var if you do not.

The max E_ALL error reporting level will report undefined vars - always develop with that.
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

i have mine on e-all &~ notice

that was the default.

i guess my misthought that it was needed was actually a good thing since it's more secure.
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

McGruff wrote:The max E_ALL error reporting level will report undefined vars - always develop with that.
Just wanting to state that my configuration does not show you any errors, as below snippet shows, when adding array val's without declaring the array per se.

Code: Select all

PHP Version: 4.3.4RC2-dev
Display Errors: 1
Error Level: E_ALL
Register Globals: Off

<?php
$array[] = '<pre>';
$array[] = 'PHP Version: '.phpversion()."\n";
$array[] = 'Display Errors: '.ini_get('display_errors')."\n";
$array[] = 'Error Level: '.(ini_get('error_reporting') == '2047' ? 'E_ALL' : 'Not E_ALL')."\n";
$array[] = 'Register Globals: '.(ini_get('register_globals') == '' ? 'Off' : 'On')."\n";
$array[] = '</pre>';

foreach ($array as $val) { echo $val; }
show_source(__FILE__);
?>
User avatar
johnperkins21
Forum Contributor
Posts: 140
Joined: Mon Oct 27, 2003 4:57 pm

Post by johnperkins21 »

I ended up getting it to work. My problem had something to do with the way Macromedia Dreamweaver created the file. I have switched to using JEdit and things are working properly. I was also trying to open the file directly in my browser as opposed to loading it from the site (ie. localhost/directory/file.php)

Thank you very much for all the help guys. I greatly appreciate it.
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

heh. somehow i'm not suprised macromedia's added crap caused an issue. there's a thread on editors, if you wanna look at what toehrs use.

a number (two imparticular that i mention) are free and quite versatile

viewtopic.php?t=6288
Post Reply