Mod Adk Portal (2.1.1)

Adk portal is a portal integrated to SMF, with multiple extensions and features.
The portal is aimed at simple and intuitive to the Administrator.
It has all the characteristics of portal, in addition to having a great set of downloads, system of internal pages, etc.

Mod Adk Seo (3.0)

Adk Seo is an internal system of SMF to improve your ranking.
It has powerful features to appear on the top of major search engines.
With this product, you can change your urls, choose your format, encouraging social activity on your site, place their own sitemaps, etc.
Mod Adk Blog (3.0)

Adk blog is an internal system of SMF to help encourage business users.
This product will create a space where your users can use as your own blog, creating categories, entries, and managing your comments.


PHP: Búsqueda de valor en *.txt


Board:

Tutoriales para tu Web

Topic:

PHP: Búsqueda de valor en *.txt


Description:

Tutoriales que no tengan que ver con smf, sino para tu web.

Author Topic: PHP: Búsqueda de valor en *.txt  (Read 1438 times)

0 Members and 1 Guest are viewing this topic.

PHP: Búsqueda de valor en *.txt

PHP: Búsqueda de valor en *.txt
« on: September 12, 2010, 01:33:43 PM »
Ok tengo unos codigo que ya me esta funcionando pero quiero que cuando busque un nombre de todo los detalles que tenga ese usuarios.

Codigo: buscador.php

Code: [Select]
<html>
<form name="form1" method= "POST" action="search.php">
<input type ="text" name= "Buscar">
<input type = "submit" name = "enviar">
</form>
</html>

Codigo: search.php

Code: [Select]
<?php
if((!empty($_POST["searchterm"]))|| isset($_POST["searchterm"])){
         
$file fopen ("info.txt""r");
         
$linea trim(fgets($file));
         
$encontrado = ($linea == $_POST["searchterm"]);
          while (!
feof($file) && !$encontrado) {
               
$linea trim(fgets($file));
               
$encontrado = ($linea==$_POST["searchterm"]);}
           
//end while
              
fclose ($file);
}
       if (!
$encontrado) {
              echo 
'<br> El codigo no fue encontrado';
       } else {
             echo 
'Lo encontré: '.$linea;
      }
?>


y la informacion del info.txt esta colocada haci

user1
Vencimiento: 08/11/2010
user2
Vencimiento: 08/11/2010
user3
Vencimiento: 08/11/2010
user4
Vencimiento: 08/11/2010

Pero cuando coloco en el buscador la palabra user1 solo me aparece

Lo encontré:user1

y necesito que apareca las segunda linia tambien

Lo encontré:user1
Vencimiento: 08/11/2010

a ver si pueden ayudarme a ver que es lo que necesita el cogo o que hace falta

mafia7

  • Full Member
  • ***
  • Posts: 102



Sorry visitor. To access the SMF Personal answers, you need to Register or Login.

Atte. SMF Personal

Tags

 


 
Application Parser To Mod

It is a system developed by SMF Personal, similar to parse smf, but with the difference that it not only show us the steps to install mods but also show us the steps to uninstall and update mods.
The mods that can be analyzed are obviously those who are raised in SMF Personal.
Section Mods

In this section you will find all mods done by the staff and users of SMF Personal.
The mods are displayed in a simple and easy to read.
Section Tutorials

In this section you will find all the tutorials made by our staff and users of SMF Personal.
The tutorials are displayed in a simple and easy to read.

SMF 2.0.2 | SMF © 2011, Simple Machines | Adk Portal 2.1.1 © SMF personal  & Adk Seo 3.0
This site is not affiliated with or endorsed by Simple Machines