Click to See Complete Forum and Search --> : Please help me, whats wrong with my script?


rickwu
09-29-2005, 04:44 PM
new error below :(

NogDog
09-29-2005, 09:59 PM
Based on the error message, my first guess would be that the /home/x/public_html/a directory does not have the correct permissions on it to allow the script to write files to it. Note that the webserver does not run the script under your personal login name, but under its own name, typically called "nobody" on many installations. Therefore you will either need to set write permission for "world" on that directory, or possibly just for "group" if you belong to the same group as the "nobody" user (check with your sysadmin if you don't know).

LimpBagel
09-29-2005, 10:09 PM
Yeah, most file copy problems are permissions.

rickwu
09-30-2005, 12:41 AM
fixed

rickwu
09-30-2005, 10:44 AM
new error below :(

rickwu
09-30-2005, 10:45 AM
I amusing php4.3.11, after research, stripos is php5 only, so how to make my script work in 4.3.1??

It shows this error:

Fatal error: Call to undefined function: stripos() in /home/x/public_html/a/index.php on line 33

here my script, please how to fix it?

}
$sp1=stristr($interesting_table,"color=E8E8E8> ");
$sp2=stristr($sp1,"</td>");
$num=substr($sp1,19,stripos($sp1,$sp2)-19);
$sp3=stristr($sp2,"&nbsp;");
$sp4=stristr($sp3,"</a>");
$domain=substr($sp3,6,stripos($sp3,$sp4)-6);
$query="UPDATE `overture` SET `value` = '$num', `status` = '-1' WHERE `domain` = '".$table[0]."' LIMIT 1";
mysql_query($query);
}
?>

NogDog
09-30-2005, 04:35 PM
You could do this:

strpos(strtoupper($sp1), strtoupper($sp2)

rickwu
09-30-2005, 10:44 PM
Do I delete all the lines , and add that? or replace which line(s)?

NogDog
09-30-2005, 11:38 PM
Wherever you have stripos($str1, $str2) replace it with strpos(strtoupper($str1), strtoupper($str2)). (Basically it's making strpos() case-insensitive, which is the only difference between stripos() and strpos().)

rickwu
09-30-2005, 11:47 PM
like this?

$num=substr($sp1,19,strpos(strtoupper($sp1), strtoupper($sp2))-19);
$domain=substr($sp3,6,strpos(strtoupper($sp3), strtoupper($sp4))-6);




it also say this error:
Warning: file_get_contents(http://url): failed to open stream: HTTP request failed!

here is the script, how do i fix it:
$de_cautat=file_get_contents($_FILES['fisier1']['name']);


Thanks nogdog! you are THE best!