Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Old 07-01-2009, 06:06 PM   PM User | #1
Peuplarchie
Regular Coder

 
Join Date: Feb 2006
Posts: 262
Thanks: 23
Thanked 1 Time in 1 Post
Peuplarchie is an unknown quantity at this point
Post Match $var in text file ?

Good day to you all,
stupid as it sound, all the thing that I have tried to match a variable into a text file and execute according to it result.


PHP Code:

$active 
"user_list.txt";
$pos strpos($active$_SESSION['username']);
if (
$pos === false) {
echo 
"<b id=\"userinfo\"><img src=\"enligne.png\" valign=\"bottom\" width=\"13px\"/></b>";
} else {
echo 
"<b id=\"userinfo\"><img src=\"horsligne.png\" valign=\"bottom\" width=\"13px\"/></b>";

Thanks !
Peuplarchie is offline   Reply With Quote
Old 07-01-2009, 07:16 PM   PM User | #2
tomws
Senior Coder

 
tomws's Avatar
 
Join Date: Nov 2007
Location: Arkansas
Posts: 2,590
Thanks: 29
Thanked 323 Times in 319 Posts
tomws will become famous soon enoughtomws will become famous soon enough
You're using strpos incorrectly. The first argument is a string. Giving a filename doesn't make it magically open the file. You'll need to take a look at fopen, fgets (or fread), or maybe others (file, file_get_contents, et cetera).
__________________
If your question can be typed into the Google search box, you haven't yet done enough research. [A]bort, [R]etry, [F]ail?

Are you a Help Vampire?
tomws is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 08:44 AM.

Home - Contact Us - Archives - Link to CF - Resources - Top 

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.