Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Please Explain In English
Old 01-23-2009, 01:58 PM Please Explain In English
Super Talker

Posts: 113
Name: Paul
Trades: 0
Would someone be kind enough to explain in english what this error actually means:

Warning: Invalid argument supplied for foreach() in /home/videotom/public_html/Plugins.class.php(1) : eval()'d code(1) : eval()'d code on line 109


Usually this clears when the permissions are set to 777 but on this host we cant go above 755 (see other thread if interested)If I can understand what the error is I may be able to fix it
fattony is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-23-2009, 02:02 PM Re: Please Explain In English
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
It looks like you have given an eval() string as a parameter to a foreach() function, when a foreach usually takes an array.
The code would help though...
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 01-23-2009, 02:53 PM Re: Please Explain In English
Super Talker

Posts: 113
Name: Paul
Trades: 0
Basically I get a number of error when I upload the script, this is due to the domain license I add to the script, (this is generated automatically)

This is a copy of the generated code which provides me a domain license system, once I chomd the relevent files the errors go away:

// PLEASE DO NOT EDIT BELOW
// PLEASE DO NOT EDIT BELOW
// PLEASE DO NOT EDIT BELOW

function p($b,$e,$m) {
$a = 1;
$i = 0;
$b2 = $b;
while (($e >> $i)>0) {
if ((($e >> $i) & 1) == 1) {
$a = mo(($a * $b2) , $m);
}
$b2 = mo(($b2 * $b2) , $m);
$i++;
}
return $a;
}

function mo ($g, $l) {
return $g - ($l * floor ($g/$l));
}

function d($c, $d, $n) {
$da = split(" ", $c);
for ($u=0; $u<count ($da); $u++) {
if ($da[$u] == "") {
array_splice($da, $u, 1);
}
}

for ($u=0; $u< count($da); $u++) {
$rm = p($da[$u], $d, $n);
$de.= substr ($rm, 1, strlen($rm)-2);
}

for ($u=0; $u<strlen($de); $u+=2) {
$rd .= chr(substr ($de, $u, 2) + 30);
}
return $rd;
}

// YOU CAN EDIT THE TEXT BELOW
// YOU CAN EDIT THE TEXT BELOW
// YOU CAN EDIT THE TEXT BELOW


$E = array("Your license has expired! Please contact the vendor to purchase a script or resolve any issues.","You don't have a license for this script! Please contact the vendor to purchase a script or resolve any issues.","The activation could not be contacted. Please check that your server has access to external HTTP servers, or contact email removed with your site's URL and the name of the product and vendor.");


// PLEASE DO NOT EDIT BELOW
// PLEASE DO NOT EDIT BELOW
// PLEASE DO NOT EDIT BELOW

$n=49657723;
$k=26670337;

$v=12;
$p=61;

$h = str_replace("www.","",$_SERVER["HTTP_HOST"]);
if(file_exists($v."_".$p.".key"))
{
$f=fopen($v."_".$p.".key","r");
fseek($f,0);
$data = d(fread($f,1000),$k,$n);
fclose($f);
}
else
{
$data = "";
}

$dm = substr($data,0,32);
$time = intval(substr($data,32));


if(time()-date("Z",time()) > $time || md5($h) != $dm)
{
$cu=curl_init("http://www.electrifire.co.uk/validate.php/$h/$v/$p");
curl_setopt($cu,CURLOPT_RETURNTRANSFER, 1);
$newkey = curl_exec($cu);
if($newkey == "EXPIRED")
{
$licerror = $E[0];
}
elseif($newkey == "INVALID")
{
$licerror = $E[1];
}

if(!$licerror)
{
$f=fopen("$v"."_$p.key","w");
fwrite($f,$newkey);
}
}

if($licerror)
{
die($licerror);

}

I have 2 files in the script called:

11_54.key

11_57.key

Thes both need permissions of 777 otherwise I get errors and I've currently got this error:

Warning: Invalid argument supplied for foreach() in /home/videotom/public_html/Plugins.class.php(1) : eval()'d code(1) : eval()'d code on line 109

The generated code is added at the top of the plugins.class file
which I have set to 777 to try and clear this error, normally what I have just explained clears all errors but not this time. sorry for the long post but hope this helps someone explain my error

Last edited by fattony; 01-23-2009 at 02:59 PM..
fattony is offline
Reply With Quote
View Public Profile
 
Old 01-24-2009, 07:13 AM Re: Please Explain In English
Super Talker

Posts: 113
Name: Paul
Trades: 0
does anyone have any suggestions?
fattony is offline
Reply With Quote
View Public Profile
 
Old 01-24-2009, 12:00 PM Re: Please Explain In English
Super Talker

Posts: 113
Name: Paul
Trades: 0
$10 if someone can help me just pm me your paypal email
fattony is offline
Reply With Quote
View Public Profile
 
Old 01-24-2009, 02:50 PM Re: Please Explain In English
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
It's just an idea, but it's the only I have.
If you upload the files via ftp, you might have a different user set as the owner of the files than the user running the web server, meaning that the file will not be writable by PHP.

Try to use a file manager into the browser (surely those plesk or cpanel interfaces do have something like this) to install the files (upload a zip file, and unzip them from the manager).
This might set the right owner for the newly installed files.

No guaranties, but it's worth a try.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 01-24-2009, 04:04 PM Re: Please Explain In English
Decaf's Avatar
Ultra Talker

Posts: 489
Name: Adam
Trades: 0
Invalid argument supplied for foreach()

You didn't fill out the arguments correctly. I would show you but the code posted above does not contain the foreach() function.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Decaf is offline
Reply With Quote
View Public Profile Visit Decaf's homepage!
 
Reply     « Reply to Please Explain In English
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.25174 seconds with 12 queries