Jump to content

nuxy

Members
  • Posts

    97
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

nuxy's Achievements

Member

Member (2/5)

0

Reputation

  1. I have a problem with the function set_exception_handler. I can't seem to get it to work with it calling a function within a class. set_exception_handler($en->handle_error); When I try it that way, it reads the "error_handler" as a variable. Notice: Undefined property: engine::$handle_error in index.php on line 19 set_exception_handler($en->handle_error()); When I try it that way, it reads as a function, but doesn't pass any variables to the function. Warning: Missing argument 1 for engine::handle_error(), called in index.php on line 19 and defined in classes\engine.php on line 279 Warning: Missing argument 2 for engine::handle_error(), called in index.php on line 19 and defined in classes\engine.php on line 279 Warning: Missing argument 3 for engine::handle_error(), called in index.php on line 19 and defined in classes\engine.php on line 279 Warning: Missing argument 4 for engine::handle_error(), called in index.php on line 19 and defined in classes\engine.php on line 279 I have tried with just making a function in the "index.php" script, but it doesn't display anything then. function handle_error($a, $b, $c, $d) { global $en; $en->handle_error($a, $b, $c, $d); return; } set_exception_handler('handle_error'); Does anyone have an idea how I could fix this problem?
  2. I got my script working, it is actaully very precise now. Thanks everyone..
  3. That is my problem, i'm already checking the hashes against a database. But anyways, I've been working on it, founda partial solution. function auto() { global $mysql; $chars = '1234567890abcdefghijklmnopqrstuvwxyz'; echo 'Loading Config: '; $datafeed = file_get_contents('stats.ini'); $datafile['new'] = split("\n", $datafeed); foreach($datafile['new'] as $varline) { $vars = split(' = ', $varline); $var[$vars[0]] = $vars[1]; } $pre[0] = $var['next[0]']; $pre[1] = $var['next[1]']; $pre[2] = $var['next[2]']; $pre[3] = $var['next[3]']; $pre[4] = $var['next[4]']; $pre[5] = $var['next[5]']; $pre[6] = $var['next[6]']; echo 'Loaded<br><pre>'; print_r($pre); echo '</pre><br><br>'; for($next[0]=$pre[0];$next[0]<=(strlen($chars)-1);$next[0]++) { for($next[1]=$pre[1];$next[1]<=(strlen($chars)-1);$next[1]++) { for($next[2]=$pre[2];$next[2]<=(strlen($chars)-1);$next[2]++) { for($next[3]=$pre[3];$next[3]<=(strlen($chars)-1);$next[3]++) { for($next[4]=$pre[4];$next[4]<=(strlen($chars)-1);$next[4]++) { for($next[5]=$pre[5];$next[5]<=(strlen($chars)-1);$next[5]++) { $fp = fopen('stats.ini', 'w'); $datafeed = file_get_contents('stats.ini'); $datafile['new'] = split("\n", $datafeed); foreach($datafile['new'] as $varline) { $vars = split(' = ', $varline); $var[$vars[0]] = $vars[1]; } $var['next[0]'] = (empty($var['next[0]'])) ? 0 : $var['next[0]']; $var['next[1]'] = (empty($var['next[1]'])) ? 0 : $var['next[1]']; $var['next[2]'] = (empty($var['next[2]'])) ? 0 : $var['next[2]']; $var['next[3]'] = (empty($var['next[3]'])) ? 0 : $var['next[3]']; $var['next[4]'] = (empty($var['next[4]'])) ? 0 : $var['next[4]']; $var['next[5]'] = (empty($var['next[5]'])) ? 0 : $var['next[5]']; $var['next[6]'] = (empty($var['next[6]'])) ? 0 : $var['next[6]']; foreach($var as $key => $vl) fputs($fp, $key . " = " . $vl . "\n"); fclose($fp); for($next[6]=$pre[6];$next[6]<=(strlen($chars)-1);$next[6]++) { $string = ''; if ($next[0]) $string .= $chars[$next[0]]; if ($next[1]) $string .= $chars[$next[1]]; if ($next[2]) $string .= $chars[$next[2]]; if ($next[3]) $string .= $chars[$next[3]]; if ($next[4]) $string .= $chars[$next[4]]; if ($next[5]) $string .= $chars[$next[5]]; if ($next[6]) $string .= $chars[$next[6]]; // not relevant to the topic } } } } } } } } Still debugging, so I'm still open to ideas..
  4. Well, I've made a script that makes random words(letter sequences), but my here is my problem. It's not really a problem, just a feature I want to enhance. The script will make millions/billions of letter sequences, but that takes a long time. What I want to do is to be able to stop the script, and then continue it at a later point, from that original point I stopped it. Say it came to the letter sequence "as1s" and then I stop it, the next time it should go on from "as1s" and make "as1t" and so forth. Here is my current script, a bit messy, but should be doable. function auto() { global $mysql; echo 'Beginning to add hashes..<br><form method="post" action="?auto"> <input type="submit" value="Show No Output" name="blah"></form><br><br>'; $chars = '1234567890abcdefghijklmnopqrstuvwxyz'; for($next[0]=0;$next[0]<=(strlen($chars)-1);$next[0]++) { for($next[1]=0;$next[1]<=(strlen($chars)-1);$next[1]++) { for($next[2]=0;$next[2]<=(strlen($chars)-1);$next[2]++) { for($next[3]=0;$next[3]<=(strlen($chars)-1);$next[3]++) { for($next[4]=0;$next[4]<=(strlen($chars)-1);$next[4]++) { for($next[5]=0;$next[5]<=(strlen($chars)-1);$next[5]++) { for($next[6]=0;$next[6]<=(strlen($chars)-1);$next[6]++) { $string = ''; if ($next[0]) $string .= $chars[$next[0]]; if ($next[1]) $string .= $chars[$next[1]]; if ($next[2]) $string .= $chars[$next[2]]; if ($next[3]) $string .= $chars[$next[3]]; if ($next[4]) $string .= $chars[$next[4]]; if ($next[5]) $string .= $chars[$next[5]]; if ($next[6]) $string .= $chars[$next[6]]; // otehr processing stuff not rellative here.. } } } } } } } } Also, if anyone knows how to optimize, well, not really optimize, but another way to do this aswell, I would appreciate it. Anyone have an idea how I can make this feature? Thank you in advance...
  5. Hello there, I'm currently creating a page, that is using mainly CSS2. I'll explain what I want to do, The desigh has two pictures at either sides of it, left and right. The main table, that is in the middle is has the width of 70 percent, and then the other two sides has 15 percent each. My current layout uses a table, as this example. table -> tr -> td <> td <- td <> td -> td <> td <- tr <- table I'm usingthe background property to lay an image, that is bassically transparent with an shaddow effect for the main table. So far everything has gone well, but now, the background images seems to be under the actual image. This really kind of cufuzes me. There is also the matter of the one background image(left) does not want to align prroperly(0% 100%/top right). here is an image of it. Here is the code, it is in php, for certain purposes. <?php function header_a1() { ?> <style type="text/css"> body { background-color: #FFFFFF; color: #333333; margin: 0px 0px 0px 0px; } td.main_bdy { background-color: #e6e6e6; vertical-align: top; text-align: left; padding: 10px; font-family: tahoma; font-size: 11px; font-color: #333; } table { border-spacing: 0px; } td { padding: 0px; } td.sld_l { background-image: url('images/sld_l.png'); bacground-position: 0% 100%; background-repeat: repeat-y; width: 15%; text-align: right; vertical-align: top; } td.sld_r { background-image: url('images/sld_r.png'); bacground-position: 0% 0%; background-repeat: repeat-y; width: 15%; text-align: left; vertical-align: top; } </style> <table style="width: 100%;height: 100%"> <tr> <td class="sld_l"> <img src=""> </td> <td style="width: 70%" class="main_bdy"> <?php return 0; } function ending_a1() { echo '</td> <td class="sld_r"> <img src=""> </td> </tr> </table>'; return 0; } What can I do to correct this? Thanks.
  6. The element "this" is predefined. It refers to the current element.
  7. The disapearing act: <script> function hide(id) { obj = document.getElementById(id); obj.style.display = "none"; } </script> <a onclick="javascript:hide('content')">-</a> <div id="content"><input type="text"></div> If you actually want do do somethign with the text that the user inputs, eg. send to a php to get a result, then it is ajax. But I think I missed your point completeley.
  8. Does the file "database.sql" exist in the directory? IF not, make test file with that name, or change the name of the current file.
  9. This is HTML, but use the onChange Event. <table border =0 bgcolor=orange width=100%> <tr> <td> <select name="language" onChange="document.location = this.value + '.php'"> <option value="english">English</option> <option value="chinese">Chinese</option> </select> </td> </tr> </table>
  10. The mysql_query() functin returns false if the query is not executed, or there occured an error. Use an if statement. <?php if (false == ($var = @mysql_query("COMMIT"))) { // error.. echo 'There was an error: ' . mysql_error() . '.'; } else { //success echo 'Success: ' . $var . '.'; }
  11. Lazy way: Add ob_start(). You are most probably including this script somewhere, you need to remove "all" data echo/prinited becausea header is sent.
  12. Try removing the quotes.. <?php $connection = mysql_connect('localhost','MYUSERNAME','MYPASSWORD'); if (!empty($connection)) { mysql_query("CREATE DATABASE `database`"); mysql_query("USE `database`"); $file = file_get_contents('database.sql'); $array = split(';', $file); foreach($array as $line) { if (!empty(mysql_query($line)) echo 'Executed: ' . $line . '<br>'; else echo '<b>Failed: ' . $line . '</b><br>'; } } else echo 'Could not connect to database'; ?>
  13. Try to see if it isn't disabled. <?php echo 'Function is ' . ((function_exists('exec')) ? 'enabled' : 'disabled') . '.'; ?>
×
×
  • 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.