Page 1 of 1

Warning: Invalid argument supplied for foreach()

Posted: Tue Apr 04, 2006 10:41 am
by ukpir8radio
Script URL: www.ukpir8radio.co.uk/link/links.php
Version of script: 1.02
Version of PHP: PHP Version 4.3.11
Hosting company: worldwidehosting4u.com
Have you searched THIS FORUM for your problem: yes
(if not please do before posting)
If so, what terms did you try: Warning: Invalid argument

Write your message below: i have installed and reinstalled to see if it was my mistake, but when you browse the links page i get the following messgae come up
Warning: Invalid argument supplied for foreach() in /home/ukpir8ra/public_html/link/links.php on line 42
line 42 is the following

Code: Select all

foreach ($lines as $thisline)
anyone have any ideas?

Posted: Wed Apr 05, 2006 9:49 am
by Klemen
Hi,

1. Is the linkinfo.txt file on the server?

2. Try adding this code to the top of links.php file:

Code: Select all

error_reporting(E_ALL ^ E_NOTICE);
You can paste it to line 33, just above require "settings.php";

3. Does the error go away when you add your first link to LinkMan (using form or in admin panel)?

Regards

Posted: Wed Apr 05, 2006 11:36 am
by ukpir8radio
i added the line u said, and it didnt have any affect at all.

Warning: Invalid argument supplied for foreach()

Posted: Wed Apr 05, 2006 11:54 am
by Doodlebug
I have exactly the same problem. Does yours appear to work correctly from the admin panel?

My site is: http://www.loulousbijouterie.com

Posted: Wed Apr 05, 2006 11:55 am
by ukpir8radio
yes

Posted: Wed Apr 05, 2006 12:44 pm
by Doodlebug
This should be my links page:
http://www.loulousbijouterie.com/silver ... kman.links

As you can see i get the error message every time, but in the admin panel, it shows the two links i have added.

Posted: Wed Apr 05, 2006 1:56 pm
by Klemen
Hi,

@ukpir8radio:
Does it work with this file instead of original links.php?
http://www.phpjunkyard.com/extras/links_nofile.zip

@Doodlebug:
You have a different error - the header.txt and footer.txt files are probably missing from your LinkMan folder. Make sure they are in the LinkMan folder, even if empty.

Let me know if you two get it to work.

Regards

Posted: Wed Apr 05, 2006 2:24 pm
by ukpir8radio
after a bit of tinkering i now just get this error

Code: Select all

Can't open the link file (linkinfo.txt) for reading!

Posted: Wed Apr 05, 2006 3:40 pm
by Klemen
Ok, I made one change, please try with this file again (it is a different one then before so download it again):
http://www.phpjunkyard.com/extras/links_nofile.zip

Have you made any other changes to any of the files?

What is the EXACT chmod setting for your linkinfo.txt file?