PHP Classes

blank page

Recommend this page to a friend!

      Cascading Vertical Menu  >  All threads  >  blank page  >  (Un) Subscribe thread alerts  
Subject:blank page
Summary:executes ok but the page is blank
Messages:2
Author:Greg Barber
Date:2009-07-02 04:07:20
Update:2009-07-02 04:12:07
 

  1. blank page   Reply   Report abuse  
Picture of Greg Barber Greg Barber - 2009-07-02 04:07:21
Hi,

Am trying to get this class to work and have the page executing with no erros but the page that is displayed is blank (ie there is no menu as I expected).

The image size I am using for the menu items is 120 x 16 pixels so I think I have the menu size correct.

I have 2 top level menu objects with the second one having a sub-level object (this is what I am starting with, when I get the code working I will add more items to the menu. As you can see I have started with the test file you provided with the class, modified the image names and commented out the lines I don't need yet.

Hope you can help. Here is my code.

<html>
<head>
<style type="text/css">
body {
margin-top: 5px;
padding-top: 5px;
margin-left: 5px;
padding-left: 5px;
}
.menu {
border: 1px, solid, #00004F;
}
.choice {

}
.sub {
border: 1px solid #000000;
}
</style>
</head>
<body>
<?php
// Testing menu class
require_once('cascading_vertical_menu.class');

// Choices... choice(up image, down image, URL, image alt, css_class)
$c1 = new choice('images/home_up.gif','images/home_dn.gif','index.php', 'Home', 'choice');
$c2 = new choice('images/reports_up.gif','images/reports_dn.gif','reports.php', 'Reports', 'choice');
//$c3 = new choice('images/test_up.gif','images/test_down.gif','menu_test.php', 'THIS', 'choice');
$sc1 = new choice('images/RTReports_up.gif','images/RTReports_down.gif','RTReports.php', 'RT Reports', 'sub');
//$sc2 = new choice('images/test_up.gif','images/test_down.gif','index.html', 'SUB2', 'sub');
//$sc3 = new choice('images/test_up.gif','images/test_down.gif','index.html', 'SUB3', 'sub');
//$sc4 = new choice('images/test_up.gif','images/test_down.gif','index.html', 'SUB-SUB1', 'sub-sub');
//$sc5 = new choice('images/test_up.gif','images/test_down.gif','index.html', 'SUB-SUB1', 'sub-sub');
//$sc6 = new choice('images/test_up.gif','images/test_down.gif','index.html', 'SUB-SUB1', 'sub-sub');
//$sc7 = new choice('images/test_up.gif','images/test_down.gif','index.html', 'SUB-SUB1', 'sub-sub');

// Vert menu... cascading_verticle_menu(top, left, height, width, css_class)
$v = new cascading_vertical_menu(10, 10, 32, 120, 'menu');

// Elements must be added in a top down manner
// Add some elements
$v->add($c1);
$v->add($c2);
//$v->add($c3);

// Second level
$c2->add($sc1);
//$c1->add($sc2);
//$c3->add($sc6);
//$c3->add($sc7);

// Third level
//$sc2->add($sc4);
//$sc2->add($sc5);

// Fourth level
//$sc4->add($sc3);

// Output vertical menu
echo $v->write();
echo "Script executes ok."
?>
</body>
</html>


  2. Re: blank page   Reply   Report abuse  
Picture of Greg Barber Greg Barber - 2009-07-02 04:12:07 - In reply to message 1 from Greg Barber
Actually that last nice means it's not a blank page after all...forgot I put that there. The only thing that appears on the page is the last echo statement.