Jump to content

file() array error???


darkfreaks

Recommended Posts

hey guys im using a script i coded that uses the php file() function to grab text off a webpage and return it however i have it set up so if it doesnt match a certain text  to return the content of the page but when i echo it out

 

 

i get the form then the word

Array=>

 

what am i doing wrong :confused:

 

<?php
$user=$_POST['user'];
if(empty($user)){
?>
<form method="post">
<input type="text" name="user">
<input type="submit" name="submit" value="Assimilate!">
</form>
<?php
}else{
$url='http://vampirefreaks.com/profile.php?user=';
$user=$_POST['user'];
$file = file("$url$user");

foreach($file as $lines)
{
$line=strip_tags($lines);
$line=trim("$line");
if ($line != ''){
$line=preg_replace('/\s+/',' ',$line);
$line=preg_replace('/\s+$/',' ',$line);
//echo "$line<br>\n";
$form='<form method="post">
<input type="text" name="user">
<input type="submit" name="submit" value="Assimilate!">
</form>';
if($line == 'THIS USER DOES NOT EXIST'){$message="this user is dead<br />$form";break;}
if ($line == 'THIS USER HAS BEEN DELETED BY VF ADMIN Reason for Deletion:')
{$message="$line $user $form";}
if ($line == 'THIS USER HAS BEEN DELETED BY VF ADMIN Reason for Deletion: Picture Theft')
{$message="$line $user $form";}
if ($line == 'THIS USER HAS BEEN DELETED BY VF ADMIN Reason for Deletion: pervert')
{$message="$line $user $form";}
if ($line == 'THIS USER HAS BEEN DELETED BY VF ADMIN Reason for Deletion: Nudity. You left out the word "demented looking" from your username btw.')
{$message="$line $user $form";}
if ($line == 'THIS USER HAS BEEN DELETED BY VF ADMIN Reason for Deletion: Nudity')
{$message="$line $user $form";}
if ($line == 'THIS USER HAS BEEN DELETED BY VF ADMIN Reason for Deletion: Previously deleted pervert.')
{$message="$line $user $form";}
if ($line == 'THIS USER HAS BEEN DELETED BY VF ADMIN Reason for Deletion: inappropriate images')
{$message="$line $user $form";}
if ($line == 'THIS USER HAS BEEN DELETED BY VF ADMIN Reason for Deletion: Previously Deleted Pervert')
{$message="$line $user $form";}
if ($line == 'THIS USER HAS BEEN DELETED BY VF ADMIN Reason for Deletion: Spamming')
{$message="$line $user $form";}
if ($line == 'THIS USER HAS BEEN DELETED BY VF ADMIN Reason for Deletion: prev. deleted pedo')
{$message="$line $user $form";}
if ($line == 'THIS USER HAS BEEN DELETED BY VF ADMIN Reason for Deletion: This Is Not A Sex Site.')
{$message="$line $user $form";}
if ($line == 'THIS USER HAS BEEN DELETED BY VF ADMIN Reason for Deletion: Spam')	
{$message="$line $user $form";}
if ($line == 'THIS USER HAS BEEN DELETED BY VF ADMIN Reason for Deletion: Picture Theft')	
{$message="$line $user $form";}
if($line=='This User Has Been Suspended') 
{ $by=$reason = next($file);//gets the next pointer in the array
  $reason = next($file);//gets the next pointer in the array
  $message="$user
Has Been Suspended By VF Admin For:$by$reason$form";
}
}
}
if ($message)
{ echo "<font color=red>$message</font>";} else{
echo'<form method="post">
<input type="text" name="user">
<input type="submit" name="submit" value="Assimilate!">
</form>';
echo "$file";
}
}
?>

Link to comment
https://forums.phpfreaks.com/topic/189761-file-array-error/
Share on other sites

tried that but then i get

 

Array=> 1-100

 

then the contents of the page.

 

however this all worked before i put in the following if statement

 

<?php
if($line=='This User Has Been Suspended') 
{ $by=$reason = next($file);//gets the next pointer in the array
  $reason = next($file);//gets the next pointer in the array
  break;
  $message="$userHas Been Suspended By VF Admin For:$by$reason$form";
}?>

 

is it possible it is not exiting the arrayed next loop? :confused:

Link to comment
https://forums.phpfreaks.com/topic/189761-file-array-error/#findComment-1001445
Share on other sites

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.