Jump to content

leszer

Members
  • Posts

    15
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

leszer's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yep, knew I was going to feel like an idiot when I got the reply that fixed it. Like I said, I was just too close to it and I'd messed with the code so many times. I got it just about right and missed the stupid "."
  2. Issues as in either a blank screen or 500 - Internal Server Error. Now, if I don't try to pass the glob into a table I can view the images in a straight line down the page.
  3. Hi and thanks for the help ahead of time. I've changed this code about 25 times and I'm sure I'm missing something simple but all I get are issues and I'm not sure if it's me or Yahoo hosting. This is my code, all I'm doing is pulling images from a directory with a glob and trying to output them into a table with 2 columns that grows if necessary. Maybe someone has a better way altogether, I'm happily open to learning new ways to do things. I think I'm simply too close to the project at this point. Thanks again. <?php $folder = 'images/'; $filetype = '*.*'; $files = glob($folder.$filetype); $count = 0; $count = count($files); $cols = 2; echo '<table width="100%" cellspacing="3"><tr>'; foreach($files as $file) { if($count %$cols == 0) echo '</tr><tr><td colspan="2"><hr /></td></tr><tr>'; echo '<td align="center"><img src="' . $file '" /></a></td>'; $count++; } echo '</table>' . "\r\n"; ?>
  4. Hello! So I couldn't think of a better forum to post this under... The idea is I need to limit access to a site. The login names/passwords already exist for a different system and we can export a file from there. The problem is I need to use this for the .htpasswd file but the passwords are not encrypted and I do not want to run several hundred through a normal encryption tool singly. So before I go through the brain teaser of making a tool to encrypt the passwords (but not the usernames) I was curious if anyone had run across a tool or the need to do so yet and if they mind sharing their code. Thanks!
  5. That works perfect. Excellent even. Thank you both very much! Closing the topic as solved.
  6. So... if (date(strtotime( 'saturday'))) $date=strtotime('saturday'); else $date=strtotime('-1 saturday'); ?? Edit: forgot to put php in code. There's a bug in that. ON a Saturday it would create two weeks of values. I think you'd need to check if the current day is friday and use that instead of "next friday" EDIT: No I got that backward. If it is a saturday then it needs to start on the current day. So, it is the $date value that needs to be modified.
  7. So I was wondering if anyone could come up with a good way of having a drop down box list the dates of the previous week starting from Saturday. The dates would need to go from Saturday to the coming/current friday. Or would I just be better off having it list the days 'Saturday' to 'Friday'. Any thoughts?
  8. Fails on: mysql_num_rows() expects parameter 1 to be resource
  9. Hi, First, thanks to all of the freaks on this forum who've helped me off and on during my coding efforts. I tend to do well until I over-think my problem. Now, what I'm trying to do right now is query a table for the current week saturday to Friday, no matter the day. The code I've come up with doesn't give me any errors but.. also doesn't work so I'm sure I've not thought something through. [code <?php $username="root"; $password=""; $database="flash"; $lsat=strtotime( "last saturday" ); if (date(strtotime( "friday" ))) $fri=date(strtotime( "friday" )); else $fri=date(strtotime( "next friday")); mysql_connect("localhost",$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM events WHERE Date>=$lsat and Date<=$fri"; $result=mysql_query($query); $num=mysql_num_rows($result); mysql_close(); ?>
  10. Yes it does and that worked perfectly. So glad I don't have to go back and nest all that in a function. Thank you very much!
  11. You're saying I have to go wrap my whole another.php script in a function to be returned in the email script? I was hoping for a way around that because the another.php script is a file which is including the scripts of 3 other pages and formatting them into one style. Would I then have to go back to those files and wrap them in functions also?
  12. Trying to use an include() in a script to send an email, not working out. Basically I have a pretty drastic page I've formatted out and I want it to be shipped out in an email in that format. I thought it would be simple to get an include in a php code to email but the email works.. and doesn't have anything in it. I've tried with and without quotes, any help appreciated. <html> <body> <? //change this to your email. $to = "me@me.com"; $from = "me@me.com"; $subject = "stuff"; $message="<?php include("another.php"); ?>" $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; //options to send to cc+bcc //$headers .= "Cc: [email]maa@p-i-s.cXom[/email]"; //$headers .= "Bcc: [email]email@maaking.cXom[/email]"; // now lets send the email. mail($to, $subject, $message, $headers); echo "Message has been sent....!"; ?> </html> </body>
  13. lol SOB, I knew it was going to be something stupid when it came down to it. Thanks for catching it! I've done it on other projects but forgot to echo. Thanks again!
  14. Getting that $id into the url. It's not working. It literally shows up as $id, not the # of the record.
  15. Not sure why I'm having such trouble making this work. Seems I've done it before but I can't wrap my head around it. The basic idea is that I want to throw the $id into the URL link in the table for the First and Last name to allow the record to be selected for editing. Easy... or so it seemed. <html> <title>Visitors Logs</title> <body> <center><h1>Visitors Log</h1></center> <center><h3><?php echo date('m/d/Y H:i'); ?></h3></center> <center><input type="button" value="Click here to login" onclick="window.location.href='login.php'" /></center> <br /><br /> <?php $username="root"; $password=""; $database="safety"; mysql_connect("localhost",$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM login WHERE Date=CURDATE()"; $result=mysql_query($query); $num=mysql_num_rows($result); mysql_close(); ?> <table border="1" cellspacing="2" cellpadding="2"> <tr> <th><font face="Arial, Helvetica, sans-serif">Last Name</font></th> <th><font face="Arial, Helvetica, sans-serif">First Name</font></th> <th><font face="Arial, Helvetica, sans-serif">Company</font></th> <th><font face="Arial, Helvetica, sans-serif">Badge</font></th> <th><font face="Arial, Helvetica, sans-serif">Employee<br> You're Visiting</font></th> <th><font face="Arial, Helvetica, sans-serif">Time In</font></th> <th><font face="Arial, Helvetica, sans-serif">Time Out</font></th> <th><font face="Arial, Helvetica, sans-serif">Visitor & Contractor <br>Safety Video Reviewed</font></th> <th><font face="Arial, Helvetica, sans-serif">Employee Safety <br>Video Reviewed</font></th> </tr> <?php $i=0; while ($i < $num) { $id=mysql_result($result,$i,"ID"); $f1=mysql_result($result,$i,"LastName"); $f2=mysql_result($result,$i,"FirstName"); $f3=mysql_result($result,$i,"Company"); $f4=mysql_result($result,$i,"Badge"); $f5=mysql_result($result,$i,"TowEmp"); $f6=mysql_result($result,$i,"TimeIn"); $f7=mysql_result($result,$i,"TimeOut"); $f8=mysql_result($result,$i,"VCvid"); $f9=mysql_result($result,$i,"Tvid"); ?> <tr> <td><font face="Arial, Helvetica, sans-serif"><a href=logout.php?ID=$id><?php echo $f1; ?></a></font></td> <td><font face="Arial, Helvetica, sans-serif"><a href=logout.php?ID=$id><?php echo $f2; ?></a></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f5; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f6; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f7; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f8; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f9; ?></font></td> </tr> <?php $i++; } ?> </body> </html>
×
×
  • 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.