
tsilenzio
Members-
Posts
134 -
Joined
-
Last visited
Never
Everything posted by tsilenzio
-
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! =]
-
Redirect.php Code ?, 4 forumz header ads.
tsilenzio replied to lostnucleus's topic in PHP Coding Help
heres what u want: <HTML> <head> <TITLE>DaDesiForum</TITLE> </head> <frameset rows="150,1*" border="0" frameborder="0" framespacing="0"> <frame align="center" src="redirect-ads.php" scrollbar="no"> <frame src="echo $_GET['url']"> </frameset> </HTML> and on the line: <frame align="center" src="redirect-ads.php" scrollbar="no"> Replace redirect-ads.php with the location of the page you want there =] Note: Some browsers dont support frames, but all the newer ones do =] -
incase for some odd reason it resides in the rest of my code ill show u my whole page almost.. this page makes links for a siebar for my site.. <?php function array_rsearch($needle, $haystack) { foreach ($haystack as $key => $data) { if(is_string($data) || is_numeric($data)) { if($needle == $data) { return true; } } elseif(is_array($data)) { if(array_rsearch($needle, $haystack) == true) { return true; } } } } // Need to finish this, first need to fix the 404 error.. function compare_lkeys(&$source, $array) { foreach ($array as $data => $key) { if($array) if($data == $source) { return; } elseif(strtolower($data) == strtolower($source)) { $source = $data; return; } } } function link_add($link, $title, $group) { global $links; if(!isset($links)) { $links = array($group => array($title => $link)); } elseif(array_rsearch($link, $links)) { return; } elseif((!array_key_exists($group, $links)) || (!array_key_exists($title, $links))) { //compare_lkeys($group, $title); $links = array_merge_recursive($links, array($group => array($title => $link))); } else { $links = array_merge_recursive($links, array($group => array($title => $link))); } } link_add("./home.php", "Home", "Areas"); link_add("./home.php", "City", "Areas"); link_add("./home.php", "Forum", "Areas"); link_add("./home.php", "Preferences", "Places"); link_add("./home.php", "Manual", "Places"); link_add("./home.php", "Time", "Places"); link_add("./home.php", "Logout", "Things"); link_add("./home.php", "Login", "Things"); link_add("./home.php", "Day", "Things"); ?> as of right now its still in prototype mode
-
Here i updated the code anyway just to prevent infintie loops or errors (although before it would have given an error not an infinite loop) //<?php // -- Enable Text Highlighting -- // function array_rsearch($needle, $haystack) { foreach ($haystack as $key => $data) { if(is_string($data) || is_numeric($data)) { if($needle == $data) { return true; } } elseif(is_array($data)) { if(array_rsearch($needle, $haystack) == true) { return true; } } } } And it also gives me a 404, page not found.. when it does this (same with firefox) it gives me the error almost immediately, (for other people out there who things its an infinite loop) the infinite loop will take about 4 seconds before it cuts it off..
-
Whenever I try to use this function on WampServer2 (Php5) and use firefox for the browser it says page connot be found, instead of an error =/ //<?php // -- Enable Highlighting -- // function array_rsearch($needle, $haystack) { foreach ($haystack as $key => $data) { if(is_string($data) || is_numeric($data)) { if($needle == $data) { return true; } } else { if(array_rsearch($needle, $haystack) == true) { return true; } } } } NOTE: If I remove a semicolon then the page will generate with an error saying theres a missing semi colon =/
-
Didnt mean to leave "echo 2;" that was just to see if it was some kinda output problem =/
-
I am using WAMPServer2 and whenever I try to use this function firefox (when pointed towards the page) says page connot be found? :s I was wondering if i coded somthing wrong :s //<?php // -- Enable Text Highlighting -- // function array_search_recursive($needle, $haystack) { foreach ($haystack as $data) { if(!is_array($data)) { if($needle == $data) { echo 2; return true; } } else { return array_search_recursive($needle, $haystack); } } }
-
I tried this it didnt work =[ HOWEVER I was trying to find out other things and was not even meaning to but when I added "overflow: auto;" to the div#content (The div that holds the main content) in css, it fixed the problem, i dont know why ???
-
Yay I finally got it to work! Okay incase anyone else down the road has the same problem I will post my fix for the problem <html> <head> <title>Untitled Document</title> <style type="text/css"> <!-- body { margin: 0px; padding: 0px; background-color: #666666; text-align: center; } div#container { width: expression(document.body.clientWidth < 740 ? "700px" : document.body.clientWidth - 40 ); /* Emulates min-width for Internet Explorer, Other browsers will skip this code */ min-width: 700px; /* Set a min-width for browsers other then Internet Explorer */ margin: 10px; /* Some browsers will omit the right margin */ text-align: center; } div#header { height: 100px; width: 700px; border-color: #000000; border-width: 1px; border-style: solid; margin: 10px auto 0px auto; } div#nav { height: 35px; width: 700px; margin: 0px auto 10px auto; border-color: #000000; border-style: solid; border-width: 1px 1px 1px 1px; } div#leftcol { width: 190px; height: 100px; float: left; border-color: #000000; border-style: solid; border-width: 1px; margin: 0px 10px 0px 0px; } div#content { float: none; width: auto; height: 100px; border-color: #000000; border-style: solid; border-width: 1px; margin: 0px auto 0px auto; } div#footer { height: 35px; width: 700px; margin: 10px auto 10px auto; border-color: #000000; border-style: solid; border-width: 1px; } --> </style> </head> <body> <div id="container"> <div id="header">Header</div> <div id="nav">Navagation</div> <div id="leftcol">Sidebar</div> <div id="content">Main</div> <div id="footer">Footer</div> </div> </body> </html> There is still one problem I cannot seem to fix at the moment =/ but i will keep trying. In Internet Explorer The Sidebar will put a margin between itself and the Main Content, but in firefox, it does not put the margin ???
-
Yea its the one I use but im trying to make one that will work on both, oh well ill just use tables, atleast I learned CSS =] closest thing I found was [http://css.maxdesign.com.au/floatutorial/tutorial0816.htm] but that max width wont work in IE, and 50% of the ppl use IE so i cant just ignore that many ppl =/
-
I see it dont work with internet exploer 6 ='[