View Single Post
  #8   Spotlight this post!  
Unread 26-01-2005, 13:54
AIBob's Avatar
AIBob AIBob is offline
AI Programmer
AKA: Bob Frank DOT org
FRC #0358 (Hauppauge Robotic Eagles)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Long Island, NY (in Binghamton now)
Posts: 297
AIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to behold
Send a message via ICQ to AIBob Send a message via AIM to AIBob Send a message via MSN to AIBob Send a message via Yahoo to AIBob
Re: PHP Coding HELP!!!

Try this:
profile.php
PHP Code:
<?php
$name
=strtolower($_GET["name"]);
$fname="profiles.txt";
if((
$fp=fopen($fname,"r")))
{
   
$lines=split("
"
,fread($fp,filesize($fname)));
   
$done=0;
   foreach(
$lines as $line)
   {
      if(!
$done)
      {
         
$prof=split("///",$line);
         if(
strtolower($prof[0])==$name)
         {
            echo 
$prof[1];
            
$done=1;
         }
      }
   }
   if(!
$done) echo "User profile not found";
   
fclose($fp);
}
else
{
   echo 
"There was an error in opening the profiles file";
}
?>
profiles.txt:
Code:
bob///this is the first line of the profile<br>this is the second.<br>etc...
frank///this is the first line of the profile<br>this is the second.<br>etc...
then just go to:
profile.php?name=bob
__________________
- from B B frank


Last edited by AIBob : 26-01-2005 at 14:02. Reason: missed something in my code..