Jump to content

newb

Members
  • Posts

    454
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://www.otakuflix.com/

Profile Information

  • Gender
    Not Telling

newb's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. <filesMatch "^(download.php?hash=(.*))$"> deny from all </filesMatch> why doesnt this work in htaccess?
  2. <filesMatch "^(download.php?hash=(.*))$"> not working..
  3. fixed: heres code if anyone runs into a similar problem: function returnstats ($url,$name) { global $stats; echo '<tr>'; echo '<td width="" valign="top"><p>'.$name.'</p></td>'; $sum = 0; for($i = 1; $i <=4; $i++) { if (preg_match('|<td class="'.$i.' page" style="background-color:#ccc"><a href="'.$url.'">(.*)</a></td> <td class="'.$i.' sum">(.*)</td>|Ui',$stats,$result)) { switch ($i) { case 1: $sum1 = $result[2]; break; case 2: $sum2 = $result[2]; break; case 3: $sum3 = $result[2]; break; default: $sum = $result[2]; } $sum = $result[2]; } if ($i == 4) { $sum = $sum1+$sum2+$sum3; } echo '<td width="" valign="top"><p>'.$sum.'</p></td>'; } echo '</tr>'; }
  4. well i updated my code a bit and removed the variable variables and made a function instead. function returnstats ($url,$name) { global $stats; echo '<tr>'; echo '<td width="" valign="top"><p>'.$name.'</p></td>'; for($i = 0; $i <=4 ; $i++) { if (preg_match('|<td class="'.$i.' page" style="background-color:#ccc"><a href="'.$url.'">(.*)</a></td> <td class="'.$i.' sum">(.*)</td>|Ui',$stats,$result)) { echo '<td width="" valign="top"><p>'.$result[2].'</p></td>'; } if ($i == 4) { } } echo '</tr>'; } so is it possible to get the total sum of previous data pulled from the preg_match result within the for loop or what?
  5. when $i = 4, im trying to get the sum of the values and store it in a variable but idk how. im using variable variables.. for($i = 0; $i < 5; $i++) { $varname = 'testimonyletters_'.$i.''; if (preg_match('|<td class="'.$i.' page" style="background-color:#ccc"><a href="'.$url.'">(.*)</a></td> <td class="'.$i.' sum">(.*)</td>|Ui',$stats,$result)) { $$varname = $result[2]; } if ($i == 4) { $$varname = ($varname_1+$varname_2+$varname_3); } } i would like the $testimonyletters_4 variable to be the sum of the previous variables 1-3. when $i == 4, my current code is not working. any idea how to fix this?
  6. whats a more efficient way of achieviing the same results with less code: switch ($info) { case name: return $row['username']; break; case group: return $row['usergroupid']; break; case email: return $row['email']; break; case posts: return $row['posts']; break; case usertitle: return $row['title']; break; case securitytoken: return $row['securitytoken']; break; case lastvisitdate: return $row['lastvisitdate']; break; case joindate: return $row['joindate']; break; case pmtotal: return $row['pmtotal']; break; case pmunread: return $row['pmunread']; break; nothing is wrong with this btw just looking for a better way of getting columns from the database w/o having to go back and add a case each time i want to.
  7. nvmd fixed added ,varname to end of query
  8. the results in my query are showign up like this: how can i get them to show up like this instead: here's my query: SELECT varname FROM table WHERE cat_id =8 ORDER BY varname+0 ASC any help is appreciated, thanks.
  9. yeah...this doesnt work sometimes like if the client IP is blocking pings w/ a firewall...oh well..i dont know any other solutions =/
  10. here is the fix... $cmd = "/bin/ping -c 5 ".$_SERVER['REMOTE_ADDR']; $ping = shell_exec($cmd); if(strlen($ping) < 5) { echo "? ms"; } else { preg_match("/rtt min\/avg\/max\/mdev = (.*)\/(.*)\/(.*)\/(.*) ms/", $ping, $matches); $urping = number_format($matches[1],0)." ms"; }
  11. do u know a website that does this already? maybe i can use curl to fetch results from it or something..
  12. bah...can you do it with javascript or something?
×
×
  • 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.