Jump to content

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...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.