Jump to content

kkroo

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

kkroo's Achievements

Member

Member (2/5)

0

Reputation

  1. alright, i got that error done with. now there is another error, it gzips the data and saves it to a directory name backups. I open the file and it is 0 bytes. but in the script i echo filesize(filename) and it returns 811632. Why is this happening? NVM solved
  2. I can echo $backup after here $backup = "#\n"; $backup .= "# Automatic phpBB Backup Script\n"; $backup .= "#\n"; $backup .= "# Dump of tables for $dbname\n"; $backup .= "#\n# DATE : " . gmdate("d-m-Y H:i:s", $time) . " GMT\n"; $backup .= "#\n"; $backup .= "\n"; but not after here
  3. i have a automatic backup script for phpBB this dude who has my script is getting blank backups, i got access to the script on his server and saw that i can echo the data but not put it into variables, u know what might cause this? ive been working with it for like 3 hours, i am out of ideas and anything after defining the variable in the script it cut off and there are no syntax or fatal errors could this be with mod interference? the same exact code works on a fresh install of phpBB on the same server here is where the script screws up: // // Build the sql script file... // $backup = "#\n"; $backup .= "# Automatic phpBB Backup Script\n"; $backup .= "#\n"; $backup .= "# Dump of tables for $dbname\n"; $backup .= "#\n# DATE : " . gmdate("d-m-Y H:i:s", $time) . " GMT\n"; $backup .= "#\n"; $backup .= "\n"; for($i = 0; $i < count($tables); $i++) { $table_name = $tables[$i]; switch (SQL_LAYER) { case 'postgresql': $table_def_function = "get_table_def_postgresql"; $table_content_function = "get_table_content_postgresql"; break; case 'mysql': case 'mysql4': $table_def_function = "get_table_def_mysql"; $table_content_function = "get_table_content_mysql"; break; } if ( !empty($table_name) ) { if($backup_type != 'data') { $backup .= "#\n# TABLE: " . $table_name . "\n#\n"; $backup .= $table_def_function($table_name, "\n") . "\n"; } if($backup_type != 'structure') { $backup .= $table_content_function($table_name, "output_table_content"); } } } if i change the part were it defines $backup it to
  4. kkroo

    bin2hex

    I think i found out the problem, the script sets a content length, and when it is encoded, it triples the length of the page so it will cut off the page at the set content length. so what i have to do is modify the set_content_length function.
  5. kkroo

    bin2hex

    I tested a page without the encoding and it loads fine, tried the same exact page with the encoding, and it was incomplete so i think it is from the encoding
  6. kkroo

    bin2hex

    These pages are pages that work without the encodingk, it is just wen i encode the page, it doesn't print the end of the page meaning this part: "));</script> but it does print the content.
  7. kkroo

    bin2hex

    like php, javascript requires strings to be in quotes so that didnt work, I added quotes, and it still didnt work. try accessing it now.
  8. kkroo

    bin2hex

    I have a proxy and i want to encode the page so that it cant be read by bots, so i am ecoding it using bin2hex, and decoding in javascript using unescape. ex: <script type="text/javascript"> document.write(unescape('datainhex')); </script> Well the problem that i am having is that some pages work perfectly fine and others just dont finish, this is what happens: <script type="text/javascript"> document.write(unescape('datainhex so it is missing the ')); </script> Live example: a working page: [a href=\"http://kkroo.dyndns.org:81/poxy\" target=\"_blank\"]http://kkroo.dyndns.org:81/poxy[/a] [a href=\"http://localhost:81/poxy/index.php?q=bG9jYWxob3N0OjgxL3JvdW5kY3ViZW1haWw-&hl=1111101001\" target=\"_blank\"]http://localhost:81/poxy/index.php?q=bG9jY...-&hl=1111101001[/a] a page that will not work: [a href=\"http://kkroo.dyndns.org:81/poxy/index.php?q=bG9jYWxob3N0OjgxL2ZvcnVt&hl=1111101001\" target=\"_blank\"]http://kkroo.dyndns.org:81/poxy/index.php?...t&hl=1111101001[/a] I am using PHProxy, and here is the modified code of the index page: [code]<?php @set_time_limit(0); @error_reporting(0); $data = ''; function escape ($str)     {        $encoded = bin2hex("$str");        $encoded = chunk_split($encoded, 2, '%');        $encoded = '%' . substr($encoded, 0, strlen($encoded) - 1);           $content = '<script type="text/javascript">'."\n"."document.write(unescape('%s'));"."\n".'</script>';       return sprintf($content, $encoded); } require 'PHProxy.class.php'; $config = array (     'url_var_name'             => 'q',     'flags_var_name'           => 'hl',     'get_form_name'            => '__script_get_form',     'proxy_url_form_name'      => 'poxy_url_form',     'proxy_settings_form_name' => 'poxy_settings_form',     'max_file_size'            => -1 ); $flags = 'prev'; if (isset($_GET[$config['flags_var_name']])) {     $flags = $_GET[$config['flags_var_name']]; } $PHProxy = & new PHProxy($config, $flags); if (isset($_GET[$PHProxy->config['get_form_name']])) {     $url = decode_url($_GET[$PHProxy->config['get_form_name']]);     $qstr = preg_match('#\\?#', $url) ? (strpos($url, '?') === strlen($url) ? '' : '&') : '?';     $arr = explode('&', $_SERVER['QUERY_STRING']);     if (preg_match('#^'.$PHProxy->config['get_form_name'].'#', $arr[0]))     {         array_shift($arr);     }     $url .= $qstr . implode('&', $arr);     $PHProxy->start_transfer(encode_url($url));     $data .= $PHProxy->return_response();     $str = $data; $encrypted = escape($str); echo $str;     exit; } if (isset($_GET[$PHProxy->config['url_var_name']]) ) {     $PHProxy->start_transfer($_GET[$PHProxy->config['url_var_name']]);     $data .= $PHProxy->return_response();     $responce = $PHProxy->return_response();     $str = $data; $encrypted = escape($str); echo $str;    exit; } if (isset($_GET['action'], $_GET['delete']) && $_GET['action'] == 'cookies' ) {     $PHProxy->delete_cookies($_GET['delete']);     header("Location: $PHProxy->script_url?action=cookies");    exit; } if (isset($_POST['username'], $_POST['password'], $_POST['server'], $_POST['realm'], $_POST['auth_url']) ) {     $PHProxy->request_method = 'GET';     $PHProxy->url_segments['host'] = decode_url($_POST['server']);     $PHProxy->set_authorization($_POST['username'], $_POST['password']);     $PHProxy->start_transfer($_POST['auth_url']);     $data .= $PHProxy->return_response();     $responce = $PHProxy->return_response();     $str = $data; $encrypted = escape($str); echo $str;    exit; } $data .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'; $data .= '<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">'; $data .= '<head>'; $data .= '  <title>PHProxy</title>'; $data .= '  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />'; $data .= '  <link rel="stylesheet" type="text/css" href="style.css" media="all" />'; $data .= '  <script src="javascript.js" type="text/javascript"></script>'; $data .= '</head>'; $data .= '<body>'; $data .= '<div id="container">'; $data .= '  <div id="menu">'; $data .= '    <a href="' . $_SERVER['PHP_SELF'] . '">URL Form</a> |'; $data .= '    <a href="?action=cookies">Manage Cookies</a>'; $data .= '  </div>'; $data .= '  <div class="title">PHProxy</div>'; $data .= '  <noscript><div class="error"><big>You have Javascript disabled. Please enable it to use the proxy</big></div></noscript>'; if (isset($_GET['error'])  ) {     $data .= '<div class="error"><b>Error:</b> ' . htmlspecialchars($_GET['error']) . '</div>';     if (isset($_GET['retry']))     {         $data .= '<div class="error"><a href="'. $PHProxy->proxify_url(decode_url($_GET['retry'])) .'">Retry</a></div>';     } } if (isset($_GET['action'])  ) {     if ($_GET['action'] == 'cookies')     {         $cookies = $PHProxy->get_cookies('COOKIE', false);         if (!empty($cookies))         {             $data .= '<table style="width: 100%">';             $data .= '<tr><td class="option" colspan="5"><a href="?action=cookies&delete=all">Clear All Cookies</a></td></tr>';             $data .= '<tr><td class="head">Name</td><td class="head">Domain</td><td class="head">Path</td><td class="head">Value</td><td class="head">Action</td></tr>';             for ($i = 0; $i < count($cookies); $i++)             {                 $j = $i&1 ? ' class="shade"' : '';                 $data .= "<tr><td$j>{$cookies[$i][0]}</td><td$j>{$cookies[$i][1]}</td><td$j>{$cookies[$i][2]}</td>"                    . "<td$j>" . wordwrap($cookies[$i][3], 15, ' ') ."</td><td$j><a href=". '"?action=cookies&delete='. md5(implode('', $cookies[$i])) . '">delete</a></td></tr>';             }             $data .= '</table>';         }         else         {             $data .= '<div class="error">No cookies available.</div>';         }     }     else if ($_GET['action'] == 'auth' && isset($_GET['server'], $_GET['realm'], $_GET['auth_url']))     {         $data .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">';         $data .= '<input type="hidden" name="server" value="'. $_GET['server'] .'" />';         $data .= '<input type="hidden" name="realm" value="'. $_GET['realm'] .'" />';         $data .= '<input type="hidden" name="auth_url" value="'. $_GET['auth_url'] .'" />';         $data .= '<table style="width: 100%">';         $data .= '<tr><td colspan="2" class="option">Enter user name and password for <b>' . decode_url($_GET['realm']) . '</b> at <i>' . decode_url($_GET['server']) . '</i></td></tr>';         $data .= '<tr><td width="30%" class="option">User name</td><td class="option"><input type="text" name="username" value="" /></td></tr>';         $data .= '<tr><td width="30%" class="option">Password</td><td class="option"><input type="password" name="password" value="" /></td></tr>';         $data .= '<tr><td colspan="2" style="text-align: center"><input type="submit" value="OK" /></td></tr>';         $data .= '</table>';         $data .= '</form>';     } } else { $data .= '  <form name="' .  $PHProxy->config['proxy_url_form_name'] .'" method="get" action="' . $_SERVER['PHP_SELF'] .'">'; $data .= '  <input type="hidden" name="' . $PHProxy->config['url_var_name'] .'" value="" id="url_input" />'; $data .= '  <input type="hidden" name="' . $PHProxy->config['flags_var_name'] . '" value="" />'; $data .= '  </form>'; $data .= '  <form name="' . $PHProxy->config['proxy_settings_form_name'] . '" method="get" action="" onsubmit="return submit_form();">'; $data .= '  <table style="width: 100%">'; $data .= '  <tr><td class="option" style="width: 20%">URL</td><td class="option" style="width: 80%">&nbsp;<input type="text" name="url" size="70" value="" /></td></tr>'; $data .=    $PHProxy->options_list(true, true); $data .= '  <tr><td class="option" style="width: 20%">New Window</td><td class="option" style="width: 80%"><input type="checkbox" name="new_window" />Open URL in a new window </td></tr>'; $data .= '  </table>'; $data .= '  <div style="text-align: center"><input type="submit" name="browse" value="Browse" onclick="return submit_form();" /></div>'; $data .= '  </form>'; } $data .= '</div></body></html>'; $encrypted = escape($data); echo $encrypted; ?> [/code]
  9. kkroo

    SQL errors

    so just add `` around all occurances of $table in queries? BTW, is it manditory to have the ; at the end of a query?
  10. I created an automatic backup script, and occasionally, i will get some errors like: FAILED IN get_table_def (show keys) on line372 in/home/***/public_html/forum/includes/auto_backup.php SHOW KEYS FROM Failed in get_table_def (show fields) on line337 in/home/***/public_html/gcc/forum/includes/auto_backup.php SHOW FIELDS FROM Failed in get_table_content (select *) on line535 in/home/**/public_html/gcc/forum/includes/auto_backup.php SELECT * FROM i added a filter to see if the var is empty, and it passes, so i think it may be a syntax error this is the way the query looks like: SELECT * FROM table_name SHOW KEYS FROM table_name does it maybe have to be like this: SELECT * FROM `table_name` SHOW KEYS FROM `table_name` here is the script: [a href=\"http://phpbb-login.sourceforge.net/forum/dload.php?action=file&file_id=13\" target=\"_blank\"]http://phpbb-login.sourceforge.net/forum/d...file&file_id=13[/a] Any help will be highly appreciated
  11. Hello, does anybody know a script that will zip or gzip a directory via php? if anybody knows one please tell me where i can find it Thanks
  12. that is exatly what i did a minute ago, thanks a lot
  13. ya that is true but i would like it to work on most sites
×
×
  • 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.