
tsilenzio
Members-
Posts
134 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
tsilenzio's Achievements

Member (2/5)
0
Reputation
-
That would be correct, I will read up on the area!
-
I been trying to make some kind of function or code to go from: To: And what would this be called if it has a name? Thank you in advance!
-
Forgot to mention, Thank you so much!!!
-
Okay, besides that everything worked fine BUT lol I had to change it from: onkeypress to: onkeyup because it was one value behinde on anything keyed in
-
I was wondering why u used a vairable name "ret" on this line: return ret = code.substr(0, code.length - 1);
-
I am trying to setup two text boxes, one called Letters and one called Code If you type any word into the letters box, it should take out anything besides lower case letters, and numbers. And takes each character and converts it to ACSII, and seperates them by a period(.) And the Code text box is suppose to take it from that format and put it back into a string However when I try to get it to work it fails miserably and i've been trying to get it to work and am finding out I know alot less about javascript then I thought I did.. I still wont give up though! anyway here is my code function stringToCode(x) { var n = prepareString(document.getElementById(x).value); var code = ""; for(var i = 0; i < n.length; i++) { code += n.charCodeAt(i) + "."; } return code.substr(0, code.length - 2); } function codeToString(x) { var n = prepareString(document.getElementById(x).value); var letters = "", num = ""; for(var i = 0; i < n.length; i++) { if(n.charAt(i) == ".") { letters += n.fromCharCode(num) num = ""; } else { num += n.charAt(i) } } } function prepareString(n) { var validChars = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "."); n = n.toString(); n = n.toLowerCase(); for(var i = 0; i < n.length; i++) { var currChar = n.charAt(i); var delChar = false; for(var j = 0; j < validChars.length; j++) { if(currChar != validChars[j]) { delChar = true; } else { delChar = false; } } if(delChar) { n = n.replace(currChar, ""); } } alert(n); return n; }
-
I want GET so u can copy and paste the link and have the same settings as the person who gave the link lol
-
I have a form.. and after u press submit it submits values to the $_GET variable and the URL.. Well I was wondering if its possible to change the data AFTER the user clicks Submit.. but BEFORE the values actually get submited to the URL.. Basickly I want to strip coma's, and $'s from the textbox so in the URL it dosnt come up as %23 or what have u...
-
I have two textbox's that I want to strip free of anything but numbers before the form is submited. <form name="stockinvest" method="get" action="index.php"> <table cellpadding="0" cellspacing="5" border="0"> <tr> <td>Starting Investment:</td> <td><input type="text" name="investment" value="$1,000,000"></td> </tr> <tr> <td>Daily Withdrawal:</td> <td><input type="text" name="withdrawl" value="0"></td> </tr> <tr> <td>Days to invest:</td> <td><input type="text" name="days" value="31"></td> </tr> <tr> <td colspan="2" align="center"><button type="submit" onclick="validate();">Calculate</button></td> </tr> </table> </form> I tried to fool around a little bit with javascript but im not too smart.. really i dont even have a validate() function .. Im not even sure if it will run the javascript code before it submits the page to the next PHP page.. =/
-
Is it possible to keep track of somones PC by looking up their Mac Address? The goal for this is to eliminate any problems dialup might give from the IP changing
-
So i would have to do var_dump($value); ?
-
whenever I run this script the number never exceeds 253,000,000 If i change ethier one of these vairables $startInvest Or $days The script stops and displays results when $currInvest is greater then 253,000,000. How would i fix this so the script goes, I need the numbers to be as big as 1,000,000,000,000 about, bigger if possible <?php $percent[0] = 0.9; $percent[1] = 1.0; $percent[2] = 1.1; $percent[3] = 1.2; $percent[4] = 1.3; $minrange[0] = 1000000; $minrange[1] = 10000000; $minrange[2] = 50000000; $minrange[3] = 100000000; $minrange[4] = 250000000; $maxrange[0] = 9999999; $maxrange[1] = 49999999; $maxrange[2] = 99999999; $maxrange[3] = 249999999; $maxrange[4] = 0; $startInvest = 10000000; $weeklyDeposit = 500000; $currInvest = $startInvest; $days = 280; $startPercent = 0; $endPercent = 0; $lastIncrease = 0; // Loop thru all days for($i = 1; $i < $days + 1; $i++) { if($i == 1) { echo("<table cellspacing=\"5\">\n<tr align=\"right\">\n<td><b>Day</b></td>"); echo("\n<td align=\"center\"><b>Investment</b></td align=\"right\">\n<td><b>Percent</b></td>"); echo("\n<td align=\"center\"><b>Daily Interest</b></td>\n"); echo("\n<td align=\"center\"><b>Deposit Increase</b></td>\n</tr>"); } // Test each array element for($j = 0; $j < count($percent); $j++) { // See where the current investment fits into if(($currInvest >= $minrange[$j]) && ($currInvest <= $maxrange[$j])) { $lastIncrease = $currInvest; $currInvest *= (($percent[$j] / 100) + 1); $lastIncrease = $currInvest - $lastIncrease; echo("<tr><td align=\"right\">" . number_format($i) . "</td>\n"); echo("<td align=\"right\">$" . number_format($currInvest) . "</td>\n"); echo("<td align=\"right\">" . number_format($percent[$j], 1) . "%</td>"); echo("<td align=\"right\">$" . number_format($lastIncrease) . "</td>"); if(($i % 7 == 0) && ($weeklyDeposit > 100000)) { $currInvest += $weeklyDeposit; echo("<td align=\"right\">\$" . number_format($weeklyDeposit) . "</td></tr>"); } else { echo("<td align=\"right\">$0</td></tr>"); } } } if($i == $days) { echo("\n</tr>\n</table>"); } } ?>
-
bah dont no why i forgot that lol havnt coded PHP in a year =/ im a little rusty lol.. Thanks!
-
I have a script that is suppose to mutiply a number by a percent if it falls within a range of numbers. However I see i didnt get the results I wanted. Right now im not worried if it displays the expected output, I would however like to figure out why on my server when I uncomment line: 36 it shows that the arrays hold nothing :s <?php //$percent = array(); //$minrange = array(); //$maxrange = array(); $percent[0] = 0.9; $percent[1] = 1.0; $percent[2] = 1.1; $percent[3] = 1.2; $percent[4] = 1.3; $minrange[0] = 1000000; $minrange[1] = 10000000; $minrange[2] = 50000000; $minrange[3] = 100000000; $minrange[4] = 250000000; $maxrange[0] = 9999999; $maxrange[1] = 49999999; $maxrange[2] = 99999999; $maxrange[3] = 249999999; $maxrange[4] = 0; $startInvest = 10000000; $weeklyIncrease = 0; $currInvest = $startInvest; $days = 93; // Loop thru all days for($i = 0; $i < $days; $i++) { // Test each array element for($j = 0; $j < count($percent); $j++) { // For testing purposes -- NEXT LINE IS LINE 36 //echo($j . ": " . $percent[j] . " " . $minrange[j] . " " . $maxrange[j] . "<br />"); // See where the current investment fits into if(($currInvest > $minrange[j]) && ($currInvest < $maxrange[j])) { $currInvest *= (($percent[j] / 100) + 1); echo("Increased<br>"); /*if(($days % 7) && ($weeklyIncrease > 500000)) { $currInvest += $weeklyIncrease; }*/ } } } echo("\$" . number_format($currInvest)); ?> Output: $10,000,000 Expected Output: 25228286.93 Thanks in advance for your help!
-
LOL i jsut realised thay myself! lol but thank you ALOT! =]