Jump to content

dustinnoe

Members
  • Posts

    187
  • Joined

  • Last visited

    Never

Everything posted by dustinnoe

  1. Checked and rechecked, found nothing. It's really annoying.
  2. Somewhere in apache my .htaccess rules are being cached. Even if I remove rules completely from .htacess they are still being applied to URLs. This is really annoying on a development machine where I am constantly changing rules. How do I disable caching? I can't even figure out how to flush the cache. I have googled this thing to death and I can't find anything. HELP!
  3. Check out this thread http://www.webmasterworld.com/forum92/138.htm the solution is about midway down the page
  4. I am running apache 1.3.33 and I have the following rewriteRules #Calendar RewriteRule ^calendar$ calendar/ [R] RewriteRule ^calendar/?$ calendar.php #day view RewriteRule ^calendar/today$ calendar/today/ [R] RewriteRule ^calendar/today/?$ calendar.php?action=day&date=today RewriteRule ^calendar/([0-9]+)-([0-9]+)-([0-9]+)$ calendar/$1-$2-$3/ [R] RewriteRule ^calendar/([0-9]+)-([0-9]+)-([0-9]+)/?$ calendar.php?action=day&date=$1-$2-$3 #add event RewriteRule ^calendar/add-event/(single-day|multi-day)$ calendar/add-event/$1/ [R] RewriteRule ^calendar/add-event/(single-day|multi-day)/?$ calendar.php?action=add-event-$1 Now my problem is that no matter what I enter after calendar/ it always rewrites to calendar.php So that... calendar/today/ -rewrites to> calendar.php calendar/not_even_a_rule/ -rewrites to> calendar.php calendar/just/does/not/matter/ -rewrites to> calendar.php Also the [R] flag just seems to be ignored. This setup works great under apache 2.0, any idea why it's behaving this way?
  5. Better yet... <?php $arr2 = $arr; $arr = serialize($arr2); array_multisort ( $arr2['tip_date'] , SORT_ASC, SORT_STRING , $arr2['service_name'] , SORT_ASC, SORT_STRING , $arr2['service_id'] , SORT_ASC, SORT_NUMERIC , $arr2['tip_id'] , SORT_ASC, SORT_NUMERIC , $arr2['tip_point'] , SORT_ASC, SORT_NUMERIC , $arr2['tip_odds'] , SORT_ASC, SORT_NUMERIC , $arr2['result'] , SORT_ASC, SORT_STRING , $arr2['tip_text'] , SORT_ASC, SORT_STRING ); $arr = unserialize($arr); ?> Now the original remains the same and the copy is sorted
  6. <?php $arr2 = serialize($arr); array_multisort ( $arr['tip_date'] , SORT_ASC, SORT_STRING , $arr['service_name'] , SORT_ASC, SORT_STRING , $arr['service_id'] , SORT_ASC, SORT_NUMERIC , $arr['tip_id'] , SORT_ASC, SORT_NUMERIC , $arr['tip_point'] , SORT_ASC, SORT_NUMERIC , $arr['tip_odds'] , SORT_ASC, SORT_NUMERIC , $arr['result'] , SORT_ASC, SORT_STRING , $arr['tip_text'] , SORT_ASC, SORT_STRING ); $arr2 = unserialize($arr2); ?> This will fix it but now the copy becomes the original and the original gets sorted.
  7. just use your fav text editor to replace all instances of <? with <?php Should take about 30secs
  8. What if strlen($sql) < 25ish? would you go for saving a few milliseconds then?
  9. I thought we were just voting on setting the query into it's own variable as opposed to setting the result of mysql_query() in $sql. I do like thorpe's submission as an overall solution though.
  10. $_GET['id']
  11. try this. It will force Qtyset to be an int <?php function getShipping($ShipCountry, $ShipState, $Qtyset, $QtyDivision){ $Qtyset = intval($Qtyset); // rest of code } ?>
  12. Your server may not recognize the php short tags. Use <?php instead of <? when echoing variables.
  13. Can we see some code?
  14. I like the second option because most of my queries are rather long so the code just looks cleaner. In the case of a short UPDATE or DELETE query I will go with something similar to the first option.
  15. <?php $pattern = "/(?im)x|y|z/"; // Using (?im) sets caseless multi line matching $string = "this is the x string for test Z and Y are at end and are not detected"; preg_match_all($pattern, $string, $matches); print_r($matches); ?>
  16. <?php $str = "This is a line of text ending with..."; $str=preg_replace('/[\.]{3}/', 'X',$str); echo $str; ?> Try that. Worked for me.
  17. <a href="http://alistapart.com/articles/holygrail">This tutorial</a> explains how I approach three column layouts. It has worked well for me concerning cross-browser compatibility. http://alistapart.com/articles/holygrail
  18. Just supply a direct link to the file.
  19. Personally, I think using tar pits is the way to go. Eat up the spammers resources. http://en.wikipedia.org/wiki/Tarpit_(networking) I use akismet for comment spam. http://akismet.com/
  20. <?php $chdir = ftp_chdir($conn_id, $destination); if (!$chdir) { //Execute failure code } ?>
  21. That's a good way. You don't have to remember which parameter in mktime() is the day. I always have to reference the manual.
  22. <?php $one_day_ago = mktime(0,0,0,0,-1, 0); ?> Seems a little easier to go this route.
  23. <?php if ( isset($_SESSION['User_Name']) && isset($_SESSION['Password']) ) { $query = "SELECT * FROM business_info WHERE {$_SESSION['User_Name']}='{$User_Name}' AND {$_SESSION['Password']} = '{$Password}'"; } ?> Using curly braces forces PHP to interpret the variables. Hope that helps!
  24. I've never heard of anyone doing that but I'm not sure if it can be done. Your best bet would be to read the css file line by line against some sort of regex to make sure it conforms to css rules. There are a limited number of characters allowed in css so I think the task would be rather easy and would beef up your security.
  25. Depending on the gateway you are using they should have some sort of developers library.
×
×
  • 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.