Jump to content

makexitxcount

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

makexitxcount's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I´m trying to do a username/password verification, but it´s not working, even when the user/pass is correct, it will ask for the pass three times and then deny me the acces to the page, does somebody know what i´m doing wrong the passwords.txt has the following format: username|password and here´s the code [code=php:0]<?php if (!isset($PHP_AUTH_USER)) { header('WWW-Authenticate: Basic realm="Acceso restringido"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } $fich = file("passwords.txt"); $i=0; $validated=false; while ($fich[$i] && !$validated) { $field = explode("|",$fich[$i]); if (($PHP_AUTH_USER==$field[0]) && ($PHP_AUTH_PW==chop($field[1]))) $validated=true; $i++; } if (!$validated) { header('WWW-Authenticate: Basic realm="Acceso restringido"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } ?> <html> <head> <title>Restricted Area</title> </head> <body> Acces granted to the <B>restricted area</B> w/ username <?php echo $PHP_AUTH_USER?>. </body> </html>[/code]
  2. that´s what i did, maybe it has nothing to do with the one that you post, but when i saw it before, i thought it was the same (i need more sleep  ;D) Here´s what i´ve finally done: [code=php:0]  <?php while ($row_rstTecnic = mysql_fetch_assoc($rstTecnic)){   if($row_rstTecnic['EstatTecnic']=="A"){         echo '<tr><td>'.$row_rstTecnic['NomTecnic'].'</td>';       echo '<td><a href="tecnic.php?tecnic='.$row_rstTecnic['NumTecnic'].'" title="View details for '.$row_rstTecnic['NomTecnic'].'">see</a></td></tr>';   }   else {       echo '<td>&nbsp;</td></tr>';   } } echo '</table>'; ?>[/code]
  3. i did it like the second script that you post up there, and now it works fine
  4. The right side is the page that i have right now, i want the names on the left side of the table to dissapear too, as the image on the left, they disappear when the 'EstatTecnic' from the mysql db is different from A [URL=http://img101.imageshack.us/my.php?image=sinttulo3jw3.jpg][IMG]http://img101.imageshack.us/img101/6936/sinttulo3jw3.th.jpg[/img][/URL] thnxs
  5. [quote author=ronverdonk link=topic=102545.msg407125#msg407125 date=1154427748] Sorry, the 2nd echo <table>  must go out. Ronald [/quote] hey,thanks, that´s nearly what i wanted to do, now i only need the names on the left side to dissapear with the see too, if you can help me you´ll be my hero :)
  6. my problem was that when i tried to put a <table> or a <tr> tag between the php code didn´t recognized as html, so i put them at the top but it wasn´t working. right now i´m working with an other script, but it keeps with the same problem. [code=php:0]<table align="center"width="400" border="4" cellpadding="2" cellspacing="0" bordercolor="#FF3300" bgcolor="#FF6600" summary="Un Listado de todos los Tecnicos almacenados en la base de datos">       <caption align="center" class="TEXTO2">       Técnicos Base de Datos       </caption> <?php echo '<table>' ; while ($row_rstTecnic = mysql_fetch_assoc($rstTecnic)){   echo '<tr>               <td>', $row_rstTecnic['NomTecnic'] ,'</td>';   if($row_rstTecnic['EstatTecnic']=="A"){       echo '<td><a href="tecnic.php?tecnic=', $row_rstTecnic['NumTecnic'] ,'" title="View details for ', $row_rstTecnic['NomTecnic'] ,'">see</a></td>';   }else{       echo '</td>&nbsp;<td>';   }   echo '</tr>'; } echo '</table>'; ?>[/code]
  7. I´m trying to do a table linked with a mysql db, but i got a problem, i want the values only to appear when they´re tag "EstatTecnic" is different from "A". First i couldn´t make the link "see" dissapear with their chained named on the left cell, the named dissapear but the "see" didn´t. They told me to change the code to what i post below, but it doesn´t work, somebody have a clue of what is going wrong? i uploaded a picture of what i want to have and what i have right now: [img]http://img155.imageshack.us/img155/1210/sinttulo1ql5.jpg[/img] thnxs [code=php:0]<? while ($row_rstTecnic = mysql_fetch_assoc($rstTecnic)){ if($row_rstTecnic['EstatTecnic']=="A"){ echo $row_rstTecnic['NomTecnic'].'</td><td><a href="tecnic.php?tecnic='.$row_rstTecnic['NumTecnic'].'">see</a></td>'; }else{ echo '</td><td></td>'; }; ?> </tr> <? }; ?> </table>[/code]
  8. i´m trying to hide the values "NomTecnic" and the text "see" when "EstatTecnic" is different from A, but i just can do it with the "NomTecnic" value, does somebody knows how to make "see" to not show up when the value "EstatTecnic"  is different from A. Thanks <?php do { ?>         <tr>   <td><?php if($row_rstTecnic['EstatTecnic']=="A"){ echo $row_rstTecnic['NomTecnic'];} ?></td>         <td> <a href="tecnic.php?tecnic=<?php echo $row_rstTecnic['NumTecnic']; ?>">see</a></td>       </tr>       <?php } while ($row_rstTecnic = mysql_fetch_assoc($rstTecnic)); ?>     </table>
×
×
  • 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.