Warning: Invalid argument supplied for foreach()

Problems installing LinkMan?
Post Reply
ukpir8radio
Posts: 4
Joined: Tue Apr 04, 2006 10:33 am

Warning: Invalid argument supplied for foreach()

Post 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?
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post 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
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
ukpir8radio
Posts: 4
Joined: Tue Apr 04, 2006 10:33 am

Post by ukpir8radio »

i added the line u said, and it didnt have any affect at all.
Doodlebug
Posts: 4
Joined: Wed Apr 05, 2006 10:10 am

Warning: Invalid argument supplied for foreach()

Post 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
ukpir8radio
Posts: 4
Joined: Tue Apr 04, 2006 10:33 am

Post by ukpir8radio »

yes
Doodlebug
Posts: 4
Joined: Wed Apr 05, 2006 10:10 am

Post 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.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post 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
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
ukpir8radio
Posts: 4
Joined: Tue Apr 04, 2006 10:33 am

Post 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!
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post 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?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply