Jump to content

Picatta

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Everything posted by Picatta

  1. I'm trying to make a two columned design on a new template I'm working on, but I cant get it to work on all browsers. http://st0rage.org/~alex/ It seems to work on firefox, but not on IE. Whats wrong with it?
  2. If IIS is able to run php scripts (I think it's a module, or just by using cgi) then you probably just call it in the browser like http://localhost/install.php I'm not shure about running it in the command line, though.  It might be like php c:\path\to\script\install.php or you might need to find the actual location of the php interpreter and call the script with it instead of just php.
  3. So, I'm trying to make a new proxy in php.  However, a problem I've run into is that it can't handle biary data.  I'm thinking it is with the way I'm filtering the headers, but I'm not shure...  (heres an example: http://multithreading.ath.cx:24/myproxy/proxy.php?page=http://www.mixfevers.com) Whenver I try to proxify an image, I get [quote]The image “http://localhost:24/myproxy/proxy.php?page=http://mixfevers.com/main/includes/images/block2.gif” cannot be displayed, because it contains errors.[/quote] I'm not shure what to do... [code] <?php   if (!function_exists(str_ireplace)) {     function str_ireplace($repit,$repl,$src) {       return str_replace(strtolower($repit), strtolower($repl), strtolower($src));     }   }   function encode($url) {     $old = array('://', 'page=', '?', '=', 'q');     $new = array('<[pro]>', '<[pgespchr]>', '<[qmark]>', '<[eqmark]>', '<[qchr]>');     $url = str_ireplace($old, $new, $url);     return $url;   }   function decode($url) {     $old = array('://', 'page=', '?', '=', 'q');     $new = array('<[pro]>', '<[pgespchr]>', '<[qmark]>', '<[eqmark]>', '<[qchr]>');     $url = str_ireplace($new, $old, $url);     return $url;   }   if (!isset($_GET['page'])) {     if (!isset($_GET['browse'])) {       print "         <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">           <html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\">             <head>               <!--                 Web proxy by Coprolal1an/Picatta/Alex Ray/minihacker316/Cracked.Anarchist               //-->               <title>                 A simple web mirror script               </title>             </head>             <body>               <form action='?browse' method='GET'>                 <div id='form'>                   URL:  <input type='text' name='q' /><br /><br />                   <input type='submit' value='browse' />                   <input type='hidden' name='browse' />                 </div>               </form>             </body>           </html>       ";     } else {       //Print frame page       $page = $_GET['q']; //Get the requested page       print "         <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">           <html xmlns=\"http://www.w3.org/1999/xhtml\">             <head>               <title>                 A simple web proxy               </title>             </head>             <frameset rows='5%,*' scrolling='auto' border='0'>               <frame src='?page&header' />               <frame src='?page=" . encodeurl($page) . "' />               <noframes>                 <body>                   myProxy web proxy by Coprolal1an requires a frame-enabled browser such as Firefox.                 </body>               </noframes>             </frameset>           </html>       ";     }   } elseif ((isset($_GET['page'])) AND (!isset($_GET['header']))) {     //Print requested page     $page = decode($_GET['page']); //Get the page the user requested     $page = explode('://', $page);     $prefix = $page[0];     $page = $page[1];     $page = explode('/', $page, 2);     $host = explode('.', $page[0]);     if (strpos($host[0], 'www') !== FALSE) {       unset($host[0]);     }     $host = implode('.', $host);     $path = '/' . $page[1];     if ($prefix == 'https') {       $port = 443;       $pre = 'ssl://www.';     } else {       $port = 80;       $pre = 'www.';     }     $fp = fsockopen($pre . $host, $port, $errno, $errstr, 30);     if (!$fp) {       echo "$errstr ($errno)<br />\n";     } else {       $out = "GET $path HTTP/1.1\r\n";       $out .= "Host: $pre$host\r\n";       $out .= "Connection: Close\r\n\r\n";       fwrite($fp, $out);       while (!feof($fp)) {           $buffer .= fgets($fp, 128);       }       fclose($fp);       $buffer = explode('<', $buffer);       $header = $buffer[0];       $header = preg_split("/\n/", $header);       $lines = count($header);       for ($int=0; $int<$lines; $int++) {         $line = $header[$int];         if (!empty($line) AND             (strpos($line,'Transfer-Encoding') === FALSE) AND             (strpos($line,'Location:') === FALSE) AND             (strpos($line,'location:') === FALSE))         {           header($line);           //print $line;         }       }       $buffer[0] = "\n";       $buffer = implode('<', $buffer);       $buffer = explode('0', $buffer);       $end = count($buffer)-1;       unset($buffer[$end]);       $buffer = implode('0', $buffer);       $buffer = preg_replace("/(http|https):\/\/(.*?)('|\"| )/", ("?page=$1://$2$3"), $buffer);       print $buffer;     }   } else {     print "Proxified page below<br />";   } ?> [/code] It uses frame because I figured that would be easiest. NOTE; The encode and decode functions will eventually be for parsing urls.
  4. I was re-doing my website, but ran into a problem.  The top and bottomof my pages are brought up in includes, so I can't change one script wthout the rest getting messed up.  The problem is that while rowspan=4 i fine on most of my pages, some have more than 4 rows, and so do not work properly.  An example is http://picatta.homeip.net/googlemediasearch.php.  On the menu to the right, it is too short.  Is there a way of having it automatically resize to the number of table rows? NOTE: I set rowspan to a large number, and it seems to work.  However, is there a better way of doing it?
  5. I already know I can use mail() to send mail, but that requires use of an smtp server, which is what I'm aiming at using php for.
  6. *bump* Would it be similar to using telnet to send mail?
  7. You can try making the 'available' button redirect to another php script, with some get data that contaisn the url.  Like pooppie.com      TAKEN pooppie.net        AVAILABLE << buy.php?domain=pooppie.net pooppie.org        AVAILABLE << buy.php?domain=pooppie.org pooppie.info      AVAILABLE << buy.php?domain=pooppie.info And then have buy.php extract the get key domain. EDIT: Looking at the sourcecode, doesn't it already do that? [code=php:0]        echo "<tr><td>$domain</td><td><p class='available'><a href='/orderdomain.php?id=$domain'>AVAILABLE</a></p></td></tr>"; [/code]
  8. I was wondering about how I would go about sending  simple, one word message via email to someone, using bare sockets, with the fsocket() series.  I'm confused. 
  9. I want to include the file like a .js file, you know, like <script language=text/javascript src=script.php?type=php></script>. So I don't need the script tags.
  10. Well, I decided to make a script in php which would pase a text file and then depending on the get data attached to ?type= would print out the appropriate proxy form and a drop down menu which would change the action of the script. This script gets called like a normal .js file, except like src="script.php?type=cgi". The text file is in the format URL |-@-| TYPE Where TYPE is either cgi or php. Anyway, all was going well, and I got CGI working but now php won't work. I can't figure out what's wrong. (I am pretty sure I screwed up the javascript) [code]<?php $type = $_GET['type']; if ($type == 'cgi') { print " document.write('<FORM name=\"Proxy\" method=post><p align=center><select style=\"color: #ffffff; background-color: #000000\" id=\"ProxyChange\">'); "; } if ($type == 'php') { print " document.write('<div id=\"container\"><div id=\"menu\"><a href=\"$website\">URL Form</a> | ') document.write('    <a href=\"" . $website . "?action=cookies\">Manage Cookies</a> |') document.write('  </div>  <div class=\"title\">PHProxy</div>  <noscript><div class=\"error\"><big>You have Javascript disabled. Please enable it to use the proxy</big></div></noscript>') document.write('  <form name=\"poxy_url_form\" method=\"get\" action=\"/anticencorship/phpProxy/index.php\">') document.write('  <select style=\"color: #ffffff; background-color: #000000\" id=\"PProxyChange\"> "; } $file = 'proxies.txt'; $file = file_get_contents($file); $file = preg_split('/\n/',$file); $limit = count($file); for ($int=0; $int<$limit; $int++) { $website = $file[$int]; $line = $file[$int]; $line = explode('|-@-|',$line); $website = $line[0]; $name = explode('://',$website); $name = $name[1]; $name = preg_split('/\.[cnobuCNOBU]/',$name); $name = $name[0]; if ((strpos($website,'https://')) !== FALSE) {$secure = 'Secure';} else {$secure = 'Insecure';} if (strpos($line[1],$type) !== FALSE) print "document.write('<option value=\"$website\">$name ($secure)</option>'); "; } if ($type == 'cgi') { print " document.write('</select></p><br /><br /><p align=center><FONT COLOR=\"#ffffff\"><INPUT size=80 name=URL style=\"color: #ffffff; background-color: #000000\"><b><INPUT type=submit onClick=\"Proxy.action=document.Proxy.ProxyChange.options[document.Proxy.ProxyChange.selectedIndex].value\"          value=\"\" style=\"color: #ffffff; background-color: #000000\"> <BR><INPUT type=checkbox name=rc value=\"ON\"> Destroy Cookies (except some proxy cookies) <BR><INPUT type=checkbox name=rs value=\"ON\"> Remove Scripts (For anonymity) <BR><INPUT type=checkbox name=fa value=\"ON\"> Filter ads <BR><INPUT type=checkbox name=br value=\"ON\"> Spoof Referrer <BR><INPUT type=checkbox name=if value=\"ON\"> Show small Address form </p></b></FONT></FORM>');"; } if ($type == 'php') { print " document.write('<input type=hidden name=formsub value=true>  <input type=\"hidden\" name=\"q\" value=\"\" id=\"url_input\" />  <input type=\"hidden\" name=\"hl\" value=\"\" />') document.write('  </form>  <form name=\"poxy_settings_form\" method=\"get\" action=\"\" onsubmit=\"return submit_form();\">  <input type=hidden name=formsub value=true>') document.write('  <table style=\"width: 100%\">  <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>') document.write('  <tr><td class=\"option\">Include Form</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" checked=\"checked\" /> Includes a mini URL-form on every HTML page</td></tr><tr><td class=\"option\">Remove Scripts</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" checked=\"checked\" /> Remove client-side scripting (i.e. Javascript)</td></tr><tr><td class=\"option\">Accept Cookies</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" checked=\"checked\" /> Accept HTTP cookies</td></tr><tr><td class=\"option\">Show Images</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" checked=\"checked\" /> Show images</td></tr><tr><td class=\"option\">Show Referer</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" checked=\"checked\" /> Show referring website in HTTP headers</td></tr><tr><td class=\"option\">Rotate13</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" /> Use rotate13 encoding on the URL</td></tr><tr><td class=\"option\">Base64</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" checked=\"checked\" /> Use base64 encoding on the URL</td></tr><tr><td class=\"option\">Strip Meta</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" /> Strip meta HTML tags</td></tr><tr><td class=\"option\">Strip Title</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" /> Strip Website title</td></tr><tr><td class=\"option\">Session Cookies</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" checked=\"checked\" /> Store cookies for this session only</td></tr>  <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>') document.write('  </table>  <div style=\"text-align: center\"><input type=\"submit\" name=\"browse\" value=\"Browse\" onclick=\"return submit_form(); poxy_url_form.action=document.poxy_url_form.PProxyChange.options[document.poxy_url_form.PProxyChange.selectedIndex].value\" /></div>') document.write('  <div style=\"text-align: center\">PHProxy 0.4 &copy; 2005 <a href=\"http://www.whitefyre.com/\">whiteFyre</a></div>  </form>  </div>') "; } ?> [/code]
  11. How much longer will it be before I can submit tutorials or codes? I've got one for custom BBcode and one for generating a flat-file guestbook with a function, but cannot psot them.
  12. Short answer: You can't. Long Answer: You can just use the period on connect the echo and print commands, like this: echo "<td><img src=\"rivcms/news/images/image_{$row['upload_id']}06.jpg\"" . imageResize($mysock[0], $mysock[1], 75) echo "/>\n";
  13. I started learning php not too long ago, and recently decided to start a project which would let me display the sourcecode of a file and display it with line numbers and syntax highlighting. Everything was going smooth and I had gotten line numbers to work, but I can't figure out syntax highlighting. The sourcecode so far is: [code] <?php if (empty($_GET['method'])) { print " <html> <head> </head> <body> <form ENCTYPE=\"multipart/form-data\" action=?method=display method=POST> Source: <br /> <input type=file name=source><br /><br /> <input type=submit name=submit value=Display> </form> </body> </html> "; } elseif ($_GET['method'] == "display") { print " <html> <head> </head> <body> <table border=0 cellpadding=0 cellspacing=0 width=100%> <tr> <td align=center></td> <td align=center><INPUT type=button value=BACK onClick=history.back()></td> </tr> <tr> <td bgcolor=#000099 align=center><font color=#FFFFFF> # </font></td> <td bgcolor=#000099 align=center><font color=#FFFFFF> Line </font></td> </tr> "; $spacer = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; $fname = file($_FILES['source']['tmp_name']); $int = 2; foreach($fname as $line => $fline) {    $fline = htmlspecialchars($fline);    print "    <tr>    <td bgcolor=#000099 align=center><font color=#FFFFFF> [$line] </font></td>    <td "; if ($int % 2 != 0) {$bgcolor = "CCCCCC";} else {$bgcolor = "BBBBBB";}; print "bgcolor=$bgcolor><code> $spacer$fline</code></td>    </tr>    ";    $int++; } print " <tr> <td bgcolor=#000099 height=20></td> <td bgcolor=#000099 height=20></td> </tr> </table> </body> </html> "; } ?> [/code] I tried using highlight_string to highlight it, and then explode() it at the <br /> part, but since it was split into table cells it didn't work. A point in the right direction would be nice.
×
×
  • 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.