Jump to content

sneamia

Members
  • Posts

    62
  • Joined

  • Last visited

    Never

Everything posted by sneamia

  1. I personally find that method the best. It many benefits of using an iframe without actually using one. You would need to use index.php page GET variable as a switch. switch (htmlentities($_REQUEST['page'])) { case 'pagename': require_once('content/news.php'); break; case 'details': require_once('content/productdetails.php'); break; default: require_once('content/index.php'); } There is nothing wrong with what he posted.
  2. First, try isset or empty instead == ''. Second, I see no reason in using preg_match, as thorpe mentioned. There is no reason to include the overhead of the regex engine. Just do if ($_SERVER['PHP_SELF'] == '/index.php?page=login/') { if (empty($_SESSION['uniqueid'])) { header("Location: index.php?page=login"); exit; } } Right?
  3. Yes, except I did what he asked. I'm assuming he knows what's best for his site, and if he provides more specifics, then we can optimize and tune for display purposes.
  4. I believe your original post is simplest, modifying the width of a cell in a table.
  5. To go along with instructions you requested: <style> td { width:100px; text-align:center; } td img { display:inline; } </style> <table> <tr> <td><img src="..." alt="..." /></td> <td><img src="..." alt="..." /></td> <td><img src="..." alt="..." /></td> <td><img src="..." alt="..." /></td> <td><img src="..." alt="..." /></td> <td><img src="..." alt="..." /></td> <td><img src="..." alt="..." /></td> <td><img src="..." alt="..." /></td> <td><img src="..." alt="..." /></td> <td><img src="..." alt="..." /></td> </tr> </table> That's one way to do it. And I believe it should work.
  6. Tricky, tricky. Switching around the order on us.
  7. No vibration = no fun.
  8. Ok, I wrote it for you. Let me know what you think. <?php // d is the begin date in the format yyyy-mm-dd // hpd is the number of hours in a normal workday; 10 by default // h is the number of hours needed foreach ($_GET as $key => $value) { $_GET[$key] = htmlentities($value); } $begin_date = isset($_GET['d']) ? $_GET['d'] : '2007-01-01'; $total_days = $_GET['h'] / (isset($_GET['hpd']) ? $_GET['hpd'] : 10); $days = 0; $temp_date = explode('-', $begin_date); while ($days < $total_days) { if ((date('D', mktime(0, 0, 0, $temp_date[1], $temp_date[2], $temp_date[0])) != 'Sat') && (date('D', mktime(0, 0, 0, $temp_date[1], $temp_date[2], $temp_date[0])) != 'Sun')) { $temp_date = explode('-', $begin_date); $begin_date = date('Y-m-d', mktime(0, 0, 0, $temp_date[1], $temp_date[2] + 1, $temp_date[0])); $days++; } else { $temp_date = explode('-', $begin_date); $begin_date = date('Y-m-d', mktime(0, 0, 0, $temp_date[1], $temp_date[2] + 1, $temp_date[0])); } } echo $begin_date; ?> http://sneamia.net/junk/Jahnoes/?d=2007-01-01&h=101 for a test. And sorry for the triple post.
  9. And I can't edit my post, so I guess double posting is the only option. Why is "60 * 60 * 24" there? Doesn't that convert from days to seconds?
  10. This is what I would do: Find begin date and total days needed to work. Determine if the start date is a weekend. If it isn't, $day++. Else, nothing. Add one day to the start date (through a timestamp or some other method). Check if it is a weekend. If it isn't, $workday++. Else, nothing. Add one day. Check if it is a weekend. If it isn't, $workday++. Else, nothing. ... Until the $workday = the amount of days to work. And you end up with the final date. Of course, once you get the basic code down and working, you can work on optimizing it, such as adding two to the date when you hit Saturday. Let me know if it makes any sense.
×
×
  • 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.