Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. The first option uses more memory where at the second one uses more CPU cycles, both depends on the file size, So remember to manage your files size by creating new log daily, weekly, monthly (whatever) or a fifo system
  2. Yes, use the onchange & onclick attribute i also added defaults <form id="form1" name="form1" method="post" action=""> <input name="Dollars" type="text" id="Dollars" value="" onchange="addup();"/><br /> <select name="dropdown" id="dropdown" onchange="addup();"> <option value="10" selected="selected">Item1 (10)</option> <option value="250">Item2 (250)</option> <option value="500">Item3 (500)</option> </select><br /> Delivery <br /> <input type="radio" name="radio" id="week" value="10" checked="checked" onclick="addup();"/> this week <br /> <input type="radio" name="radio" id="next" value="20" onclick="addup();"/> next day<br /> <input type="radio" name="radio" id="today" value="30" onclick="addup();"/> today <br /> Total <input type="text" name="total" id="total" /> <br /> </form> EDIT: i'm going to move this to the javascript section
  3. Okay.. well I'm out, His a Troll, I am not going to feed,
  4. Okay if these variables are set on page during the page load then you could do this <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form id="form1" name="form1" method="post" action=""> <input name="Dollars" type="text" id="Dollars" value="100" /><br /> <select name="dropdown" id="dropdown"> <option value="10">Item1 (10)</option> <option value="250">Item2 (250)</option> <option value="500">Item3 (500)</option> </select><br /> Delivery <br /> <input type="radio" name="radio" id="week" value="10" /> this week <br /> <input type="radio" name="radio" id="next" value="20"/> next day<br /> <input type="radio" name="radio" id="today" value="30"/> today<br /> <input name="" value="addup" type="button" onclick="addup();" /> <br /> Total <input type="text" name="total" id="total" /> <br /> </form> <script language="javascript"> function addup(){ var D = parseFloat(document.getElementById('Dollars').value); var dd = parseFloat(document.getElementById('dropdown').options[document.getElementById('dropdown').selectedIndex].value); var R; if(document.getElementById('week').checked) R = document.getElementById('week').value; if(document.getElementById('next').checked) R = document.getElementById('next').value; if(document.getElementById('today').checked) R = document.getElementById('today').value; R = parseFloat(R); document.getElementById('total').value = (D * dd + R); } </script> </body> </html>
  5. Owww goodie A personal attack! You sure your 15.. and not 12.. then again 15 is still pretty immature, yeah I have No life, none what so ever.. its not as if I can go out after 8pm, or drive or go clubbing or drink or you know have fun, have my own place, or choose where I go on holiday. NONE of that stuff.. Oh wait.. that's you! the fact is simple.. you don't even have a life yet, you think you know it all, just like every 15 year old does, but you are so wrong, With that out of the way (and I won't respond to another one), I'll take the high ground, Look at KingPhilip code and attempt to adapt it, to fit your needs, if you get stuck.. post what you have so far and we will try to help!
  6. I'm not sure what part needs to use ajax, as it seam it can all be done via javascript (without any ajax calls). EDIT: can you be a little more detailed Oh and welcome
  7. And that's not PHP code ? I agree with CV on this one.. if you understand the code you and adapt it to suite, PS: i think everyone in this thread is thinking WOW but at your replies
  8. date("H:i, F d, Y", $lasttime) So you can change F to M, but you need the d for the DAYS
  9. Maybe giving us an example may help! where are you getting the text from ?
  10. maybe exec("command > nul");
  11. i think you mean this <?php $sql="SELECT rating, COUNT(rating) as total FROM rating WHERE (item_name='$shoename') GROUP BY rating"; $result=mysql_query($sql); $number = array("no","one","two","three","four","five"); $total = array_fill(0, 6, 0); if (mysql_num_rows($result) > 0) { while ($row= mysql_fetch_assoc($result)) { $total[$row['rating']]= $row['total']; } } foreach($number as $K =>$num) { echo '<h3>'.($K).' Star Active</h3> <ul class="rating '.$num.'star"> <li class="one"><a href="#" title="1 Star">1</a></li> <li class="two"><a href="#" title="2 Stars">2</a></li> <li class="three"><a href="#" title="3 Stars">3</a></li> <li class="four"><a href="#" title="4 Stars">4</a></li> <li class="five"><a href="#" title="5 Stars">5</a></li> <li class="total">['.$total[$K].']</li> </ul>'; } ?> (its 3:30am) i'm going to bed EDIT option2 (I think) <?php $sql="SELECT rating, COUNT(rating) as total FROM rating WHERE (item_name='$shoename') GROUP BY rating"; $result=mysql_query($sql); $number = array("one","two","three","four","five"); $total = array_fill(1, 5, 0); if (mysql_num_rows($result) > 0) { while ($row= mysql_fetch_assoc($result)) { $total[$row['rating']]= $row['total']; } } foreach($number as $K =>$num) { echo '<h3>'.($K+1).' Star Active</h3> <ul class="rating '.$num.'star"> <li class="one"><a href="#" title="1 Star">1</a></li> <li class="two"><a href="#" title="2 Stars">2</a></li> <li class="three"><a href="#" title="3 Stars">3</a></li> <li class="four"><a href="#" title="4 Stars">4</a></li> <li class="five"><a href="#" title="5 Stars">5</a></li> <li class="total">['.$total[$K+1].']</li> </ul>'; } ?>
  12. Yep that's a correct fix.. shocked i missed it lol EDIT: your welcome, if this is solved can to click topic solved (bottom left)
  13. If you don't mind using IE then OneCare is free and does a clean up (including registry cleaner).. http://onecare.live.com/site/en-US/center/whatsnew.htm cleanup only for a Paid for Application I use Registry Mechanic (pcTools), its worked well,
  14. The only thing in that code that would cause a fatal error is mysql_real_escape_string, so I'm going to suggest this, try this (for testing), if it still fails then its probably a fault in another section, if it works then make sure you have an open connection to the database before using mysql_real_escape_string <?php if($EnemyChakra < $ChakraUsedE) { $Enemy_Move= $WeaponE; $EnemyDamage1= $Weapon_Enemy_Rows['Jutsu_Power']; $EnemyDamage1= ($EnemyDamage1); $WeaponBE = $Battle_Rows['Enemy_Weapon_Boost']; $Weaponpower= $Battle_Rows['Enemy_Weapon_Power']; $Weaponpower = $Weaponpower + $WeaponBE; $Weaponpower= ($Weaponpower); $EnemyPower= $Battle_Rows['Enemy_Power']; $EnemyPower= ($EnemyPower); $EnemyDamage2= round(($Weaponpower * 10) + $EnemyDamage1 + $EnemyPower); $EnemyDamage3= round($EnemyDamage2 / 5); $HP= $Battle_Rows2['HP']; $HP= ($HP); $Defense= $Weapon_Enemy_Rows['Defense']; $Defense= ($Defense); $EnemyChakra= $Battle_Rows['Enemy_Chakra']; $EnemyChakra= ($EnemyChakra); $ChakraUsedE= $Weapon_Enemy_Rows['Chakra_Used']; $ChakraUsedE= ($ChakraUsedE); $PastEnemyChakra= $EnemyChakra; $EnemyDamage3= round($EnemyDamage3 / 1.25); }?>
  15. try this (these are untested, I'm kinda lazy) <?php $sql="SELECT rating, COUNT(rating) as total FROM rating WHERE (item_name='$shoename') GROUP BY rating"; $result=mysql_query($sql); $number = array("no","one","two","three","four","five"); $total = array_fill(0, 6, 0); if (mysql_num_rows($result) > 0) { while ($row= mysql_fetch_assoc($result)) { $total[$star]= $row['total']; } foreach($number as $K =>$num) { echo '<h3>'.($K).' Star Active</h3> <ul class="rating '.$num.'star"> <li class="one"><a href="#" title="1 Star">1</a></li> <li class="two"><a href="#" title="2 Stars">2</a></li> <li class="three"><a href="#" title="3 Stars">3</a></li> <li class="four"><a href="#" title="4 Stars">4</a></li> <li class="five"><a href="#" title="5 Stars">5</a></li> <li class="total">['.$total[$K].']</li> </ul>'; } } ?>
  16. Here is some thing you may find useful in this example we'll use HTTP to control our VLC process and VLM instances
  17. Can we stop posting in this thread and use the other one, hi guys I am getting this undefined variable error as its getting messy
  18. I'm not sure what output your expecting but something like this would probably make more sense <?php $sql="SELECT rating, COUNT(rating) as total FROM rating WHERE (item_name='$shoename') GROUP BY rating"; $result=mysql_query($sql); $number = array("one","two","three","four","five"); if (mysql_num_rows($result) > 0) { while ($row= mysql_fetch_assoc($result)) { $star= $row['rating']; $total= $row['total']; echo '<h3>'.$star.' Star Active</h3> <ul class="rating '.$number[$star].'star"> <li class="one"><a href="#" title="1 Star">1</a></li> <li class="two"><a href="#" title="2 Stars">2</a></li> <li class="three"><a href="#" title="3 Stars">3</a></li> <li class="four"><a href="#" title="4 Stars">4</a></li> <li class="five"><a href="#" title="5 Stars">5</a></li> <li class="total">['.$total.']</li> </ul>'; } } ?>
  19. I have posted in your other thread with the exact same question but this is my last post.. we have rules for a reason.. !
  20. $num_1_star['rating'] will only be set IF the rateing is 1, any other times it won't be set! I don't see the point of even have a switch statement, why not just use the $star variable ? @vineld: Nice catch, if I had noticed I would of posted the same and ignored the question posted, breaking the rules will normally and should get you less help!
  21. You could use CONCAT but I hardly see the point of merging the data into one field just to break it up after!
  22. Let me explain a few things 1. MySQL Fetch, read up on mysql_fetch_assoc(), as your not using it 2. Arrays $var = array("test1"); echo count($var); //Returns 1 echo $var[0]; // returns test1 $x = count($var); echo $var[$x]; // returns "" + undefined index echo $var[$x-1]; // return test1 That should help solve the problem, if it doesn't then try a quick re-write (yet i have no idea what your doing with the rating variable $query ="SELECT rating , COUNT(*) AS rating_counts FROM rating WHERE item_name = '$platename' GROUP BY rating"; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); if (mysql_num_rows($result) > 0) { $ratings = array_fill(1,5,0); while ($row = mysql_fetch_assoc($result)) { $ratings[$row['rating']]++;
  23. $lines = file('myfile.log'); $lastline = $lines[count($lines)-1]; or $lastline = readlastline('myfile.log'); function readlastline($file) { $fp = @fopen($file, "r"); $pos = -1; $t = " "; while ($t != "\n") { fseek($fp, $pos, SEEK_END); $t = fgetc($fp); $pos = $pos - 1; } $t = fgets($fp); fclose($fp); return $t; }
  24. Works fine in IE8, Maybe a popup blocker ?
  25. What part don't you understand ? The first IP is the likely clients IP, but that's not always true, for example distorting proxy will give you fake info and a highly anonymity will only give you the proxy IP without setting HTTP_X_FORWARDED_FOR or HTTP_VIA
×
×
  • 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.