28, May 2012

more strange errors..php related - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: more strange errors..php related
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: more strange errors..php related  (Read 1836 times)
aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 886
1148 credits
Members referred : 4



« on: Oct 17, 2006, 05:39:08 am »

getting these errors when i try to edit my profile on third evolution site:

Quote
Warning: strpos(): Offset not contained in string. in /hsphere/local/home/meth0d42/3rd-evolution.net/edit_profile.php on line 114

Warning: strpos(): Offset not contained in string. in /hsphere/local/home/meth0d42/3rd-evolution.net/edit_profile.php on line 115

Warning: strpos(): Offset not contained in string. in /hsphere/local/home/meth0d42/3rd-evolution.net/edit_profile.php on line 114

Warning: strpos(): Offset not contained in string. in /hsphere/local/home/meth0d42/3rd-evolution.net/edit_profile.php on line 115

Warning: strpos(): Offset not contained in string. in /hsphere/local/home/meth0d42/3rd-evolution.net/edit_profile.php on line 114

Warning: strpos(): Offset not contained in string. in /hsphere/local/home/meth0d42/3rd-evolution.net/edit_profile.php on line 115

Warning: strpos(): Offset not contained in string. in /hsphere/local/home/meth0d42/3rd-evolution.net/edit_profile.php on line 114

Warning: strpos(): Offset not contained in string. in /hsphere/local/home/meth0d42/3rd-evolution.net/edit_profile.php on line 115

Warning: strpos(): Offset not contained in string. in /hsphere/local/home/meth0d42/3rd-evolution.net/edit_profile.php on line 114

Warning: strpos(): Offset not contained in string. in /hsphere/local/home/meth0d42/3rd-evolution.net/edit_profile.php on line 115

Warning: strpos(): Offset not contained in string. in /hsphere/local/home/meth0d42/3rd-evolution.net/edit_profile.php on line 114

Warning: strpos(): Offset not contained in string. in /hsphere/local/home/meth0d42/3rd-evolution.net/edit_profile.php on line 115

Warning: strpos(): Offset not contained in string. in /hsphere/local/home/meth0d42/3rd-evolution.net/edit_profile.php on line 114

Warning: strpos(): Offset not contained in string. in /hsphere/local/home/meth0d42/3rd-evolution.net/edit_profile.php on line 115

this is the code it is referring to, see inside the function GetLvl

Code:
<?php

$handle 
fopen("http://hiscore-web.runescape.com/lang/en/aff/runescape/hiscorepersonal.ws?user1=".$userdata['user_name'],"r"); 
if(
$handle){ 
   while (!
feof($handle)) { 
   
$contents .= fread($handle8192);} 
fclose($handle);}
function 
GetLvl($skill)
{
$str1 strstr($GLOBALS['contents'], '>'.$skill.'<');
if(strpos($str1't"')>40){return '';}
$pos1 strpos($str1't"',strpos($str1't"')+1)+3;
return substr($str1$pos1strpos($str1,'<',$pos1)-$pos1);}
$attack GetLvl(Attack);
$strength GetLvl(Strength);
$defence GetLvl(Defence);
$hitpoints GetLvl(Hitpoints);
$ranged GetLvl(Ranged);
$player_prayer GetLvl(Prayer);
$magic GetLvl(Magic);
include 
ADMIN."hiscores/combat_formula.php";
echo 
"<tr>
<td class='tbl'>Combat Level</td>
<td class='tbl'><input type='text' name='user_combat' value='"
.$combat_level."' maxlength='7' class='textbox'></td>
</tr>"
;

?>

once again these errors come out of no where.. with no changes being made to the file in months


Last blog : phpHaze 1.59.1 in Development
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #1 on: Oct 17, 2006, 10:03:37 am »

And when did you start getting this error? Was it at the same time your other errors started?


Last blog : Are You Stumbling Yet?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Oct 17, 2006, 10:07:14 am »

Meth0d,

create a file on this server with this code:
<?php phpinfo(); ?>

and tell us the URL

I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #3 on: Oct 17, 2006, 11:31:59 am »

These are warnings. That's not a problem.

The site should work fine.

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 886
1148 credits
Members referred : 4



« Reply #4 on: Oct 17, 2006, 05:30:14 pm »

http://3rd-evolution.net/php-info.php

Yes the errors appear around the same time as the other ones...

It does mess up the page, it can't find my data from runescape.com anymore


Last blog : phpHaze 1.59.1 in Development
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Oct 17, 2006, 05:55:10 pm »

http://3rd-evolution.net/php-info.php

Yes the errors appear around the same time as the other ones...

It does mess up the page, it can't find my data from runescape.com anymore
OK, I don't think that a changed server config is the problem, but maybe you site is bad coded and after the last php update this is the result.

Another situation could be that you site has al this problems before but the configuration doesn't show errors. In this case you need to switch of the errors:
ini_set('display_errors', 'Off');

otherwise I have no advice (at least non that you wanna hear)

aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 886
1148 credits
Members referred : 4



« Reply #6 on: Oct 18, 2006, 07:01:11 am »

ok i know what the problem is now.. the webmasters of runescape.com (where this code gets its data from) have put extra line breaks in their code, for example, their old style of coding looked like this:

Code:
<tr><td>Some Text</td></tr>

Whereas, now their code has been changed, and it appears like this when you view the source:

Code:
<tr>
<td>
Some Text
</td>
</tr>

If you see above in the php code for the function, "GetLvl" ..it searches for certain characters in a string in the source code of their page using $GLOBALS['Contents'].. but now it can not find that data because they added those linebreaks.. Tried to explain this the best i could.. any ideas?


Last blog : phpHaze 1.59.1 in Development
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #7 on: Oct 18, 2006, 11:19:30 am »

I really don't understand what the problem is, but anyway if the problem is the linebreaks, why don't you simply remove them?

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 886
1148 credits
Members referred : 4



« Reply #8 on: Oct 20, 2006, 02:13:44 am »

I really don't understand what the problem is, but anyway if the problem is the linebreaks, why don't you simply remove them?

I can't remove them, runescape.com is not my website haha!

Anyways, I have fixed this problem.

Solution you ask? Of course!

These lines:
Code:
<?php
function GetLvl($skill)
$str1 strstr($GLOBALS['contents'], '>'.$skill.'<');
?>


Were changed to this:

Code:
<?php
function GetLvl($skill)
$str1 strstr($GLOBALS['contents'], $skill);
?>


By taking out the

Quote
'>'. and .'<'

PHP can now read the text exactly, without looking for closing and opening "< or >".


Last blog : phpHaze 1.59.1 in Development
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=4450
Tags : php Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: more strange errors..php related
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 02:15:28 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.