Jump to content

foreach error


tarantoo

Recommended Posts

Hello,

 

Dear friends can you help me with this piece of code..

 

<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');

$host		=	""; // your mysql server address
$user		=	""; // your mysql username
$pass		=	""; // your mysql password
$databasename	=	""; // your mysql database

session_start();
$data = null;
if(!(@mysql_connect("$host","$user","$pass") && @mysql_select_db("$databasename"))) {

    
    exit;
}

include_once 'functions.php';
require_once "includes/pluggable.php";


foreach( glob("plugins/*/index.php")  as $plugin) {  
  require_once($plugin);  
}  

hook_action('initialize');

$site = mysql_fetch_object(mysql_query("SELECT * FROM settings"));
?>

 

I am keep getting warning error for line 22... this line:"  foreach( glob("plugins/*/index.php")  as $plugin) {  " it says PHP warning: Invalid argument supplied for foreach()

 

Can somebody please help me recode it, or tell me what is the problem? I know that is array problem, but don't know how to fix this :(

 

btw. Can this be host error?

 

Thanks ahead!

 

Link to comment
https://forums.phpfreaks.com/topic/265661-foreach-error/
Share on other sites

  • 2 weeks later...
  • 9 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.