vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Show [code] in new window (https://vborg.vbsupport.ru/showthread.php?t=51359)

finkdawg5 04-08-2003 11:35 PM

Show [code] in new window
 
The problem that I'm having on my boards is that people post their html code asking for help with it, but sometimes we get people posting whole html pages, or long strings of code that either throw off my tables or make the thread incredibly ad needlessly long. Here's what one of my users suggested:
PHP Code:

<?
    $pageText = "This is text, put it in a file";
    $dir = "test/";
    $postId = "1236";
    $fileName = $dir.$postId.".phps";

    if (!file_exists($filename))
    { 
        touch($fileName);
         chmod($fileName,0666); 
         $fp = fopen($fileName, "w");
        if(!$fp)
        {
            exit;
        }
        else
        {
            fwrite($fp, $pageText);
            echo("<a href=\"".$fileName."\">Attached File</a>");
        }
    }
    else
    {
        exit;
    }
?>

I'm a newbie hacker, so I'm sure there are either problems with this code or security issues, can someone take a look for me? Thanks very much!

filburt1 04-08-2003 11:40 PM

You probably can't treat the attachment as a file. Instead you'll have to get it from the attachment table (arguably easier, anyway).

Logician 04-09-2003 06:34 AM

I moved the thread because: it's algorithm is wrong according to what you are trying to achieve and there is no way the hack will work in the way you released it.

Please get help in this forum and when hack is ready, feel free to email me for a move back to Hack releases section. :)

Thanks!


All times are GMT. The time now is 02:44 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01009 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete