Jump to content

danbopes

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Everything posted by danbopes

  1. Do you have any other .htaccess files, such as in a "saucy-cakes" folder? The .jpg would have to be from another rewrite somewhere. I would suggest turning on rewritelog, and see how things are being rewritten.
  2. This is a different issue entirely, no longer is about multiple mod_rewrites, it's about mod_alias working together with mod_rewrite. <VirtualHost *:80> ServerName demo1.example.com ServerAlias www.demo1.example.com DocumentRoot "/var/www/demo1" Alias /app "/var/www/app" </VirtualHost>
  3. This is the directory structure I have: /var/www/demo1 /var/www/app The document root for demo1.example.com goes to /var/www/demo1, (Virtual host), and I also have an Alias in demo1 (/app), to goto /var/www/app. In my app folder, I have the following .htaccess file: RewriteEngine on RewriteCond $1 !^(index\.php|images|user_guide|assets|robots\.txt) RewriteRule ^(.*)$ index.php/$1 [L] In essence /app/test, should redirect to /app/index.php/test. This is what I get tho: 404 Not Found: /var/www/app/index.php/test It does exist, but I think it's trying to tell the browser to go there, and it should be going to /app/index.php/test.
  4. I need it to chain, the problem is the order of how it rewrites stuff. For example: demo1.example.com/home/index First rewrite (In root) should say, hey, you need to goto /demo1/home/index Second rewrite (In /demo1) should say, hey, you need to goto /dev/home/index Third rewrite(In /dev) should say, hey, you need to goto /dev/index.php?/home/index Problem is this, if the folder home exists, with a .htaccess file in it, the order then becomes: First rewrite (In /home): /home/index.php?/home/index Second rewrite (In root): /demo1/home/index.php?/home/index Third rewrite (In /demo1): /dev/home/index.php?/home/index It should go like the first one, and rewrite it to the demo1 folder, before trying to look in the home folder to begin with. That's the only rule I need to have go before the others, and putting it in the server config did not do anything. Please help.
  5. Is this something that can't be done? I'm guessing by the lack of responses, it seems like the set order is .htaccess files first, then system wide stuff, which doesn't seem right.
  6. OK, I have a situation, where I want to use mod_rewrite in three places to finally end up at the url I want. Sample URL: demo1.example.com/home/index In my Document Root I have: RewriteEngine on RewriteCond %{HTTP_HOST} ^(?:www\.)?[^./]+\.[^./]+\.[^./]+$ RewriteCond "%{HTTP_HOST}%{REQUEST_URI}" !^(?:www\.)?([^./]+)\.[^./]+\.[^./]+/?\1/ RewriteRule ^(.*) %{HTTP_HOST}/$1 [C,DPI] RewriteRule ^(?:www\.)?([^./]+)\.[^./]+\.[^./]+/(.*)$ /$1/$2 In my demo1 folder I have: RewriteEngine on RewriteRule ^(.*)$ /dev/$1 In my dev folder I have (Code Igniter's rewrite): RewriteEngine on RewriteCond $1 !^(index\.php|images|user_guide|assets|robots\.txt) RewriteRule ^(.*)$ index.php/$1 [L] So the end result is that it demo1.example.com/home/index should goto /dev/index.php/home/index. This semi works, but here is where the problem comes in. If the folder "home" exists, and there is a .htaccess file in there, it will process it before the parent (Which says go into the demo1 folder), and it ends up giving a 404. Is there a way I can fix this? I've tried adding the initial Document Root into the httpd.conf file, as well as in the <Directory></Directory> tags, and I ended up getting no rewrite, and same issue respectively when I did that. How can I fix this?
  7. I'm looking through, and it seems very promising. The question I have, is if the clients internet is down, and they are unable to connect to the "server", is it possible to have it cache the data and upload it in blocks?
  8. I have a client and a server solution setup at the moment. We are currently creating an API that will be run on the clients end that will allow their clients to connect to them. On our end, we want to log the number of attempts are API is being used so that we may charge the clients appropriately. My question is this. How is the most efficient way of doing this? Do I call mysql_connect from the client and just shoot the insert log statements across the web. Should I create a php script on our end that looks for post/get input and takes the data and inserts it? What if the client can't connect to our server; should I cache the data and send it off all at once? Should I create a job that every hour shoots up x records API requests happened? Relatively confused at what angle I should be taking when approaching this. I want this to be scalable to a point where we can have thousands of requests an hour, and not horribly slow down apache/mysql running at either end (Specially if the server is talking with several clients).
  9. I tried using tables too! That didn't work either. When I made: <tr><td>iO Links</td><td width="100%">Bar stuff</td>, it put iO on one line, and Links one line down. I am still baffled.
  10. That will result in: ###Text###Bar################End Pixel But it has no Start Left Pixel to fade into the bar. I need ###Text##Start Pixel#Bar##############End Pixel
  11. Here is my predicament: I have some text, followed by a 1px line with a left and right border to make it "fade-out" so to say. All I need is the line to fill up whatever space is left in the line. I can't do: <div style="float: left; width: 100px">iO Links</div><div style="float: left; width: 400px" class="bar"></div> Because I don't know if the bar is always going to be 400px (Because "iO Links" might be some other text like "iO HTML Help", which wouldn't fit in 100px). Whenever I do 100% for the bar, it will automatically drop to the next line. So I am not exactly sure what to do. If you have any questions, feel free, as I can clarify.
  12. Let me see if I can make it easier: SELECT SUM(SUM(hlstats_Frags_Kills.headshot)) * 100, 2) AS hpercent FROM ( Some big query ) hlstats_Frags_Kills, hlstats_Players WHERE hlstats_Frags_Kills.playerId = hlstats_Players.playerId GROUP BY hlstats_Frags_Kills.playerId, hlstats_Frags_Kills.headshot I need to grab the SUM of the entire query to use to divide correctly. I just don't know how to do that (without grouping everything into one row). I don't know if it's possible
  13. This is exactly why...I am having trouble.
  14. This is my query: SELECT hlstats_Players.lastName AS name, hlstats_Players.flag AS flag, hlstats_Players.country AS country, COUNT(hlstats_Frags_Kills.kills) AS kills, COUNT(hlstats_Frags_Kills.deaths) AS deaths, hlstats_Frags_Kills.playerId as victimId, IFNULL(COUNT(hlstats_Frags_Kills.kills)/IF(COUNT(hlstats_Frags_Kills.deaths) =0,1,COUNT(hlstats_Frags_Kills.deaths)), 0.00) AS kpd, SUM(hlstats_Frags_Kills.headshot=1) AS headshots, IFNULL(SUM(hlstats_Frags_Kills.headshot=1) / COUNT(hlstats_Frags_Kills.kills), '-') AS hpk, ROUND(CONCAT(SUM(hlstats_Frags_Kills.headshot=1)) / SUM(SUM(hlstats_Frags_Kills.headshot)) * 100, 2) AS hpercent FROM ( (SELECT f.killerId as playerId, NULL as kills, f.victimId as deaths, NULL as headshot FROM hlstats_Events_Frags f, hlstats_Servers s WHERE s.serverId=f.serverId AND s.game='tf2' AND f.victimId = 679) UNION ALL (SELECT f.victimId as playerId, f.killerId as kills, NULL as deaths, f.headshot FROM hlstats_Events_Frags f, hlstats_Servers s WHERE s.serverId=f.serverId AND s.game='tf2' AND f.killerId = 679 GROUP BY f.id) ) hlstats_Frags_Kills, hlstats_Players WHERE hlstats_Frags_Kills.playerId = hlstats_Players.playerId GROUP BY hlstats_Frags_Kills.playerId, hlstats_Frags_Kills.headshot HAVING COUNT(hlstats_Frags_Kills.kills) >= 5 Problem line: ROUND(CONCAT(SUM(hlstats_Frags_Kills.headshot=1)) / SUM(SUM(hlstats_Frags_Kills.headshot)) * 100, 2) AS hpercent Problem is...I need to get the SUM(SUM(hlstats_Frags_Kills.headshot)), which I can't seem to do. I get group by errors. Is there a way to do this in one query (without doing two long UNION table from statements)?
  15. It's not solved, because I need to check to see if it's greater then or equal to, not equal to. We are dealing with small numbers here, I don't see why it would be messing up this badly. 0.80 + 49.15 is 49.95, I don't see how that can be any other thing. Both var_dumps are telling me it's both a float at 49.95, there is no reason this shouldn't be working.
  16. Do you even look at my code before you post? They are both floats...and I am checking to see if they are equal...why are you bringing in '===' to this?
  17. <?php $_POST['mc_gross'] = '0.80'; class paypal_IPN { function process() { $total = 49.95; $my_total = ($_POST['mc_gross'] + ($this->account_total($user_id))); var_dump($my_total == $total); var_dump($my_total); var_dump($total); } function account_total($user_id) { return 49.15; } } //end of class $index = new PayPal_IPN(); $index->process(); ?>
  18. Take a look at this, I am completely and utterly stumped. I have about 5 years of experience, and I really believe I have come across a bug. Inside of an object: fwrite($logFd, $this->my_var_dump((floatVal('49.95') == floatVal('49.95')))); $my_total = ($_POST['mc_gross'] + ($this->account_total($user_id))); $test = $this->my_var_dump($my_total == $total); $test2 = $this->my_var_dump($my_total); $test3 = $this->my_var_dump($total); fwrite($logFd, $test . ',' . $test2 . ',' . $test3); $this->my_var_dump($var) simply just dumps the var, to a variable instead of to the browser. Refer to var_dump on the php website. This is what I get in the file: bool(true) bool(false) ,float(49.95) ,float(49.95) I am seriously like WTF. $this->account_total simply pulls from a database: function account_total($user_id) { // BE SURE TO GET A FRESH ROW! $this->user->user_info is session based, and may not be up to date! $row = $this->db->getRow("SELECT `account_type`, `static_balance`, `dynamic_balance` FROM `users` WHERE `id` = " . $user_id); if ( empty($row) ) return '0.00'; if ( $row['account_type'] > 1 ) return number_format($row['static_balance'] + $row['dynamic_balance'], 2); else return '0.00'; } I just want to add them up and do a bit of checking, but idk whats wrong.
×
×
  • 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.