Could you explain me why this outputs a white (blank) page

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
dimitris
Forum Contributor
Posts: 110
Joined: Wed Jan 14, 2004 3:47 am
Location: Athens, Greece

Post by dimitris »

Straterra wrote:Can you run this code for me please?
That's my results:
PHP Version: 4.3.1
Display Errors: Off
Error Level: Not E_ALL
Register Globals: On

It would be better if display errors was set to On!
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

Yeah, it would..I mean..jeez. With those settings, its hard to tell WHAT it is!
User avatar
dimitris
Forum Contributor
Posts: 110
Joined: Wed Jan 14, 2004 3:47 am
Location: Athens, Greece

Post by dimitris »

Straterra wrote:Yeah, it would..I mean..jeez. With those settings, its hard to tell WHAT it is!
I will send an email to the post-graduate who has the authority to maintain the webserver!
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

I think I also don't get is the fact that you never give your variables values..You just start off with $motherboard_report = ereg_replace("\r\n","<br>",$motherboard_report); . The way I can see that the variable has anything inside of it, is if you are putting stuff into it via connect.inc (require_once ("../../ww/connect.inc");).
User avatar
dimitris
Forum Contributor
Posts: 110
Joined: Wed Jan 14, 2004 3:47 am
Location: Athens, Greece

Post by dimitris »

Straterra wrote:I think I also don't get is the fact that you never give your variables values..You just start off with $motherboard_report = ereg_replace("\r\n","<br>",$motherboard_report); . The way I can see that the variable has anything inside of it, is if you are putting stuff into it via connect.inc (require_once ("../../ww/connect.inc");).
Ahh i see! $motherboard_report as well as the other variables are initiated from the previous page where there is a form with input buttons!
(Remember that i splitted the code into two pages!-The first is feeded with records about an existing record e.g. id:PC206-01 and then you submit all the changes to the second page update_step.php)
If you want i can give the url to test it yourself!
User avatar
dimitris
Forum Contributor
Posts: 110
Joined: Wed Jan 14, 2004 3:47 am
Location: Athens, Greece

Post by dimitris »

As i understand the blank pages aren't really blank but they should report various errors if the php.ini Display Errors was set to On.
Am I right? :wink:
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

Si, senor..Gimme a second and I will rewrite that page that SHOULD work.

Alrighty. First of all, use

Code: Select all

if(isset($POST['submit'])){
      if((strlen($POST['new_id'])>0){
instead of

Code: Select all

if(isset($HTTP_POST_VARS['submit'])){
      if((strlen($HTTP_POST_VARS['new_id'])>0){
Now, if the variable $motherboard_report is being posted to the document, use this to give the variable what is actually posted

Code: Select all

$motherboard_report = $Post['the_item_it_is_posted_from'];
Do this for every variable, but make sure to put it after

Code: Select all

if(isset($POST['submit'])){
      if((strlen($POST['new_id'])>0){
and before

Code: Select all

$motherboard_report = ereg_replace("\r\n","<br>",$motherboard_report);
            $lancard_report = ereg_replace("\r\n","<br>",$lancard_report);
            $vgacard_report = ereg_replace("\r\n","<br>",$vgacard_report);
            $soundcard_report = ereg_replace("\r\n","<br>",$soundcard_report);
            $keyboard_report = ereg_replace("\r\n","<br>",$keyboard_report);
            $mouse_report = ereg_replace("\r\n","<br>",$mouse_report);
            $monitor_report = ereg_replace("\r\n","<br>",$monitor_report);
            $speakers_report = ereg_replace("\r\n","<br>",$speakers_report);
            $software = ereg_replace("\r\n","<br>",$software);
Last edited by Straterra on Sat Feb 14, 2004 12:33 pm, edited 1 time in total.
User avatar
dimitris
Forum Contributor
Posts: 110
Joined: Wed Jan 14, 2004 3:47 am
Location: Athens, Greece

Post by dimitris »

Straterra wrote:Si, senor..Gimme a second and I will rewrite that page that SHOULD work.
Gracias, senor.. :D
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

Look up ^^^. I just edited my post from before.
User avatar
dimitris
Forum Contributor
Posts: 110
Joined: Wed Jan 14, 2004 3:47 am
Location: Athens, Greece

Post by dimitris »

Straterra wrote:Look up ^^^. I just edited my post from before.
Do you mean $_POST['xxxxx']
instead of $POST['xxxxx']
?
Thanks for your help!
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

LoL, yeah....
User avatar
dimitris
Forum Contributor
Posts: 110
Joined: Wed Jan 14, 2004 3:47 am
Location: Athens, Greece

Post by dimitris »

Straterra wrote:LoL, yeah....
I tested it with the same blank results unfortunately!
I don't use this technique with $x=$_POST['x']; with no problem in other pages!Such insert a new pc!
I have to go now unfortunately too! See my link to see the problem generated:
http://rainbow.cs.unipi.gr/~p01109/cs/t ... d=PC206-01
Post Reply