|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
file handling help
i have stored data in a text file "data.txt" and i want to search a email address
form that file can i do like this $filename="data.txt"; $fptr=fopen($filename,"r"); $content=fread($fptr,filesize ($filename)); fclose($fptr); if(strstr($content,$email)) { echo <<< THIS <font color="red" size="+2" face="verdana"> You have already signed the guestbook </font> THIS; will this work or there is any thing to be added or deleted |
|
#2
|
|||
|
|||
|
RE: file handling help
well i dont really know much about text files, but i'm thinkin it would be easier to use a database if you can get your hands on one.
Once again, not knowing much about text files, but from the looks of it, that doesnt even search the text file for an email address, it just opens it and reads the contents, theres no comparisons like i think you would need to do. |
|
#3
|
|||
|
|||
|
RE: file handling help
i'm not sure whether what you're trying will work or not harsha. interesting approach either way, i might take the following route Note: Prior to PHP 4.2.0, array_search() returns NULL on failure instead of FALSE. |
|
#4
|
|||
|
|||
|
RE: file handling help
mr D1NGO
i know that it is easier to code using database but it is life if every thing goes smoothly what is the use there should be some difficulties like here using text files then only we get experience in coding hope you understood |
|
#5
|
|||
|
|||
|
RE: file handling help
yes that is true harsha, although, when trying to solve a problem, finding a solution is not good enough, its all about finding the best solution.
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > file handling help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|