ebiz Posted December 10, 2008 Share Posted December 10, 2008 HI I've been having this problem for a while now and cannot figure out what is causing the problem. I've designed a website that sells dvds using PHP. I keep getting an error saying there is an undefined offset in one of the lines of my code. Here is the line (30): list($customer_firstname, $customer_lastname, $code , $description, $price) = split('\|',$theline); and here are the error messages if it helps: Notice: Undefined offset: 4 in /nas/students/c/cdbaker/unix/public_html/ebassignment/listpurchases.php on line 30 Notice: Undefined offset: 3 in /nas/students/c/cdbaker/unix/public_html/ebassignment/listpurchases.php on line 30 Notice: Undefined offset: 2 in /nas/students/c/cdbaker/unix/public_html/ebassignment/listpurchases.php on line 30 10.99 £ ANY HELP WOULD BE GREATLY APPRECIATED!!! Thanks Quote Link to comment https://forums.phpfreaks.com/topic/136386-help-undefined-offset/ Share on other sites More sharing options...
premiso Posted December 10, 2008 Share Posted December 10, 2008 $theline, when split does not contain an array with 5 indexes. Quote Link to comment https://forums.phpfreaks.com/topic/136386-help-undefined-offset/#findComment-711657 Share on other sites More sharing options...
ebiz Posted December 10, 2008 Author Share Posted December 10, 2008 Sorry i'm a real beginner with PHP, could you explain this a bit more. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/136386-help-undefined-offset/#findComment-711727 Share on other sites More sharing options...
Maq Posted December 10, 2008 Share Posted December 10, 2008 Can you do: print_r($theline); and tell me what the output is? Quote Link to comment https://forums.phpfreaks.com/topic/136386-help-undefined-offset/#findComment-711733 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.