473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

PHP Notice: Undefined offset: 5 .$a 237

Notice: Undefined offset: 5 in D:\xampp\htdocs\dianlu2010\sys\inc\function.php on line 237

Expand|Select|Wrap|Line Numbers
  1. function showtable($var,$up,$down,$left) {
  2.     global $tree,$linktype;
  3.  
  4.     $a1='<table border="0" cellpadding="0" cellspacing="0" class="mainTB"> <tr> <td ';
  5.     $a2_w='class="blankFile"';
  6.     $a2_b='class="blackFile"';
  7.     $a3='></td> <td rowspan="2" ';
  8.     $a4_b='class="row"';
  9.     $a4_w='';
  10.     $a5='></td> <td rowspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="tableblack" align="center" valign="middle">';
  11.     $linktype=array(
  12.     '<img src="http://bytes.com/topic/php/images/url.gif" width="16" height="16" title="直接连接">'
  13.     ,
  14.     '<img src="http://bytes.com/topic/php/images/dir.gif" width="16" height="16" title="内含内容">'
  15.     ,
  16.     '<img src="http://bytes.com/topic/php/images/list.gif" width="16" height="16" title="列表">'
  17.     );
  18.     $a6='</td> </tr> </table></td> <td rowspan="2" ';
  19.     $a7_b='class="row"';
  20.     $a7_w='';
  21.     $a8='></td> <td rowspan="2">';
  22.     $otable='';
  23.     $a9='</td> </tr> <tr> <td ';
  24.     $a10_b='class="blackFile"';
  25.     $a10_w='class="blankFile"';
  26.     $a11='></td> </tr> </table>';
  27.  
  28.     $right=0;
  29.     $tree_readme='<a onmouseover="show_div(event,'.$var->id.','.$var->type.')" style="cursor: hand;">'.$var->name.'</a>';
  30.     if($var->child_id) $right=1;
  31.     echo $a1.($up?$a2_b:$a2_w).$a3.($left?$a4_b:$a4_w).$a5.$linktype[$var->type].$tree_readme.$a6.($right?$a7_b:$a7_w).$a8;        //237
  32.  
  33.     if($var->child_id){
  34.         $new_up=0;
  35.         $new_left=$new_down=1;
  36.         for ($i=0;$i<count($var->child_id);$i++){
  37.             if($i!=0) $new_up=1;
  38.             if(($i+1)==count($var->child_id)) $new_down=0;
  39.             showtable($tree[$var->child_id[$i]],$new_up,$new_down,$new_left);
  40.         }
  41.     }
  42.     echo $a9.($down?$a10_b:$a10_w).$a11;
  43. }
May 26 '14 #1
2 1753
Rabbit
12,516 Expert Mod 8TB
You have no line 237
May 26 '14 #2
Luuk
1,047 Expert 1GB
you are probably referring to line 31:
Expand|Select|Wrap|Line Numbers
  1.  echo $a1.($up?$a2_b:$a2_w).$a3.($left?$a4_b:$a4_w).$a5.$linktype[$var->type].$tree_readme.$a6.($right?$a7_b:$a7_w).$a8;        //237
Undefined offset means that the value of '$var-<type' is not a member of the $linktype array.

That why '$linktype[$var->type]' returns the error "Undefined offset"
May 27 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Steven | last post by:
Hi All, I am moving some php code from a Linux machine to a Windows 2000 machine with the code belowe I get the following error : Notice: Undefined offset: 1 in c:\inetpub\wwwroot\test.php on...
1
by: google | last post by:
Hello, I'm having major problems trying to get my head round this problem. I'm trying to generate an error free script, however, I still cannot sort out this loop. I get a "Notice:...
4
by: Richard Lawrence | last post by:
Hi there, I'm having a problem with PHP which I'm not sure how to best solve. Here is the code: $fp = fopen("comments.txt", "r"); while(!feof($fp)) { $line = fgets($fp, 1024); list($key,...
2
by: neridaj | last post by:
Hello, I'm trying to figure out how to get rid of these errors: Notice: Undefined offset: 1 in output_fns.php on line 315 Notice: getimagesize() : Read error! in output_fns.php on line 315...
6
by: raydiamond4u | last post by:
Hello. My name is Raymond. My code is generating the following error: Notice: Undefined offset: 2 in C:\wamp\www\imagegallery\supportfile\include\config.php on line 25 How do i correct the error?...
1
by: atang | last post by:
Hi, I found the code here, it's excately what i am looking for, ie8 give this error "Notice: Undefined offset: 49 in.." which is this line "if ($num_of_chars==$required)", i'm a newbie, i don't know...
6
by: tbebest | last post by:
Hi , i have a form and it has A problem: i upload my 3 image and it uploaded in definded path but in insert in db filed there are empty: Notice: Undefined offset: 0 in C:\wamp\www Notice:...
4
by: Kevon | last post by:
Hello, I'm designing a photo gallery for my website, I've followed several tutorials online about how to go about doing this, with great success, I have come up with a set of codes, however I keep...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.