Jump to content

fusioneko

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fusioneko's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. <?php require_once("config.php"); if($_GET['page']=="Checkserv"){ $up = fsockopen($servip, $servPort, $errno, $errstr, 1);// or die("Server Connection:<Font color=red><B>FAILED</B></Font>"); if($up){ echo "<BR>Server <Font color=green>Online</Font>"; $online = 1; } else { echo "<BR>Server <Font color=red>Offline</Font>"; $online = 0; } if($_POST['startup']){ if(!$online){ $descriptorspec = array( 0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("file", "error.txt", "a") ); $pipes = null; $cwd = $servpath; $env = null; $ooption = array("Context"); //exec($servpath."khyller-server.exe") or die("<BR>Server Startup MSG - <Font color=red>Cannot find Server</font>"); $process = proc_open("khyller-server.exe", $descriptorspec,$pipes,$cwd,$env, $ooption); } } if(!$online){ echo "<form action=Admin.php?page=Checkserv method=post><BR>"; echo "<input type=submit name=startup value=StartServer></form>"; } else { // } } ?> So far I got an understanding how to use proc_open, but I wanna keep it open, any idea to make it so php doesn't hang?
  2. im tryint o u use proc_open() and or exec() to run an exe file.
  3. <?php f($_POST['startup']){ if(!$online){ //$A1 = array(); //exec($servpath."khyller-server.exe") or die("<BR>Server Startup MSG - <Font color=red>Cannot find Server</font>"); //proc_open("call C:\Server\blanked\release\khyller-server.exe", $A1,$A2,$A3); } } ?> I'm first trying to get them to work at all just do something first. but with no success I even sued or die and all I get is die D: Is it impossible or am I just dumb? I know I did this one, But I don't know how. Edit to add php color.. my eyes were hurting in blackness.
  4. Apparently I can't find my modify button. (EDIT) <?php include("encconfig.php"); if($_POST['CONVERSION']){ if($_POST['SUBENC']){ $search = $transchartfindx; $replace = $transchartreplacex; $CONVFILEVALUE = str_replace($search,$replace,$_POST['CONVERSION']); } else if($_POST['SUBDEC']){ $replace = $transchartfindx; $search = $transchartreplacex; $CONVFILEVALUE = str_replace($search,$replace,$_POST['CONVERSION']); } } echo "<Form action="."kinaversion.php"." method=post>"; echo "INPUT:<BR><textarea name=CONVERSION></textarea><BR><BR><BR>OUTPUT:<BR><textarea name=OUTPUT>$CONVFILEVALUE</textarea>"; echo "<BR><input type=submit name=SUBENC value=Encode>"; echo "<input type=submit name=SUBDEC value=Decode>"; echo "</form>"; ?> ENCCONFIG.php: <?php $transchartfinda = array("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","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"); $transchartfindb = array("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"); $transchartreplacea = array("y","z","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","A","B","C","D","E","F","G","H"."I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X"); $transchartreplaceb = array("Y","Z","A","B","C","D","E","F","G","H"."I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X"); $transchartfindx = array( "a" => array ("a"), "b" => array ("b"), "c" => array ("c"), "d" => array ("d"), "e" => array ("e"), "f" => array ("f"), "g" => array ("g"), "h" => array ("h"), "i" => array ("i"), "j" => array ("j"), "k" => array ("k"), "l" => array ("l"), "m" => array ("m"), "n" => array ("n"), "o" => array ("o"), "p" => array ("p"), "q" => array ("q"), "r" => array ("r"), "s" => array ("s"), "t" => array ("t"), "u" => array ("u"), "v" => array ("v"), "w" => array ("w"), "x" => array ("x"), "y" => array ("y"), "z" => array ("z"), ); $transchartreplacex = array( "y" => array ("y"), "z" => array ("z"), "a" => array ("a"), "b" => array ("b"), "c" => array ("c"), "d" => array ("d"), "e" => array ("e"), "f" => array ("f"), "g" => array ("g"), "h" => array ("h"), "i" => array ("i"), "j" => array ("j"), "k" => array ("k"), "l" => array ("l"), "m" => array ("m"), "n" => array ("n"), "o" => array ("o"), "p" => array ("p"), "q" => array ("q"), "r" => array ("r"), "s" => array ("s"), "t" => array ("t"), "u" => array ("u"), "v" => array ("v"), "w" => array ("w"), "x" => array ("x"), ); //print_r ($transchartfindx); ?> The current Array I'm using seems to only make it english.
  5. str_replace() worked so far byt it's not working as effectively as I want.
  6. I'm back again to annoy you people with a question. main.php <?php include("encconfig.php"); if($_POST['CONVERSION']){ if($_POST['SUBENC']){ $search = $transchartfinda; $search2 = $transchartfindb; $replace = $transchartreplacea; $replace2 = $transchartreplaceb; $CONVFILEVALUE = preg_replace($search,$replace,$_POST['CONVERSION']); $CONVFILEVALUE = preg_replace($search2,$replace2,$CONVFILEVALUE); } else if($_POST['SUBDEC']){ echo "Decoding.."; } } echo "<Form action="."kinaversion.php"." method=post>"; echo "<textarea name=CONVERSION></textarea><textarea name=OUTPUT>$CONVFILEVALUE</textarea>"; echo "<BR><input type=submit name=SUBENC value=Encode>"; echo "<input type=submit name=SUBDEC value=Decode>"; echo "</form>"; ?> encconfig.php: <?php $transchartfinda = array("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"); $transchartfindb = array("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"); $transchartreplacea = array("y","z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x"); $transchartreplaceb = array("Y","Z","A","B","C","D","E","F","G","H"."I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X"); ?> It just doesn't want to work, I've tried everything D: I'm not the best when it comes to pregreplace, and I just relised it's case sensative. I'm wondering if I should make my own search and replace function using strstr and such. My problem is that preg_replace fails to produce per letter. more like.. Warning: preg_replace() [function.preg-replace]: Delimiter must not be alphanumeric or backslash in C:\wamp\www\kina\kinaversion.php on line 9 Warning: preg_replace() [function.preg-replace]: Delimiter must not be alphanumeric or backslash in C:\wamp\www\kina\kinaversion.php on line 10 Result: Nothing just errors out and fails what I want it to do. Expected Result: I wanted it to change each letter.. to a different letter, now looking at what preg_replace requires makes me want to write another function to do this instead.
  7. Yeah I understand now, and heres a Scary part Im in 11th grade and I finnaly got this. Reasons why is becuase im placed on some independent educational plan. Otherwise, I did want to add the values up, I feel the need to learn really. Yeah your explanation seems all clear, It appears, I'm hhaving trouble understanding like terms, But yeah. But what boggles me more is WTF would it be needed for, I understand how some of this works. Most of it seems clear, But I'm not to sure if I think It's clear or I just believe it's clear, and im lying to myself. Anyway. anyway to make a calculator with this?
  8. I feel like learning how to make a caculator, the need to learn how to seems fun, but I don't yet understand how to deal with math on this level, It seems very intresting and fun. Basic algebra or not. You can say im 'Speacial', and I figure I'd learn how ot actually do the math even better if I make a caculator script for it. then
  9. 1. 4k - 11k + 8k - 9k 2. 19j + 16j 3. 10r - 18r + 3r2 - 5r2 4. 13t + 16v + 2t 5. 3e - 6e 6. 7h - 12h2 + 18h2 7. 5s - 17s2 - 4s - 9s 8. 1g + 12g - 15g + 3g + 4g 9. 19m - 11m2 - 5m + 7m2 10. 8z + 16z - 19z 11. 2b + 11a + 13w – 6b – 3w 12. 12y + 8x + 13y + 4x when y= 2, x= 5 13. 9n + 17b when n= 2, b= 7 14. 16f - 11u – 10f - 8u – 3u 15. 2t2 + 3t2 - 4t + 12t Im trying to think of a method to actually.. deal with this. I don't even understand the work my school is sending me. Even I read it I have no idea what the letters mean. (WTF why do I need to learn crap like this, why not a 1 + 1 example pl0x) anywya, Is their anyway to write a caculator out for this stuff?
  10. This is very intresting, I'm actually working on some things, but there is some idea's. Yeah I agree, Make it impossible to cheat, but detecting cheating is good to. It's simply like that "You shouldn't be trying in the first place." Simply no cheating is a rule, if you add one.
  11. [code=php:0] <?php echo "Hello world!"; ?> [/code] EDIT: somewhere in this file, <?php //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// // ____ ____ ____ ____ ____ // (_ _)( _ \(_ _)( _ \( _ \ // _)(_ ) __/ )( ) _ < ) _ < // (____)(__) (__) (____/(____/ // LITE Version 0.5.0 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// // IPTBB is free software. // http://iptbb.org/LICENSE.txt //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// //Include the mysql files, and functions include('config.php'); include('functions.php'); $tid=$_GET['id']; //Get the settings $setting = array(); $sql = mysql_query(" SELECT * FROM `iptbb_settings` "); while ( $row = mysql_fetch_array( $sql ) ){ $setting["{$row['name']}"] = $row['value']; } //Include the template maker require_once('tpl.class.php'); $tpl = new template; $fileurl = 'templates/'; $template = $setting['template'] . '/'; //Set some links $links = '<a href="index.php">Index</a> · <a href="memberlist.php">Member List</a>'; //Check if they are logged in or not. if( isset($_COOKIE['username']) AND isset($_COOKIE['password']) ){ //Select the user from the database $user=$_COOKIE['username']; $pass=$_COOKIE['password']; $login_query = mysql_query( "SELECT * FROM `iptbb_users` WHERE `username` = '$user' AND `password` = '$pass' " ); $login_rows = mysql_num_rows($login_query); if($login_rows > 0){ //If they are logged in $login_row = mysql_fetch_array( $login_query ); $now = time(); $insertuser = useronline($user, $now); if( $login_row['level'] == '2' ){ //If they are an admin $links .= ' · <a href="admincp.php">Admin CP</a>'; } $links .= ' · <a href="usercp.php?act=home">User CP</a> · <a href="logout.php">Logout</a>'; } else { //If they are not in our user list $links .= ' · <a href="register.php">Register</a> '; } } else { //If they have no cookies set $links .= ' · <a href="register.php">Register</a> '; } //Get the topic deatils $topic_query = mysql_query( "SELECT * FROM `iptbb_topics` WHERE `tid` = '$tid' " ); $topic_row = mysql_fetch_array( $topic_query ); //Create the webpage $tpl->assign(array( 'title' => $setting['title'] . ' - Viewing Topic: ' . $topic_row['title'], 'template' => $setting['template'], 'description' => $setting['description'], 'keywords' => $setting['keywords'], 'author' => $setting['author'], )); $tpl->display(''.$fileurl.$template.'header.tpl'); //Display the login box if( ($login_rows <= 0) OR ( !isset($_COOKIE['username']) OR !isset($_COOKIE['password']) ) ){ $tpl->display(''.$fileurl.$template.'login_form.tpl'); } //Display the menu $tpl->assign(array( 'menu' => $links, )); $tpl->display(''.$fileurl.$template.'menu.tpl'); //Display the announcement box if( ($setting['news_show'] == '1') AND ($setting['global_news'] == '1') ){ $tpl->assign(array( 'announcement' => $setting['news'], )); $tpl->display(''.$fileurl.$template.'announcement.tpl'); } //Display forum $fid = $topic_row['fid']; $starter = $topic_row['starter']; //Set the views $views = $topic_row['views']; ++$views; mysql_query("UPDATE `iptbb_topics` SET `views` = '$views' WHERE `tid` = '$tid' "); //Get the forum details $forum_query = mysql_query( "SELECT * FROM `iptbb_forums` WHERE `fid` = '$fid' " ); $forum_row = mysql_fetch_array( $forum_query ); $cid = $forum_row['cid']; //Get the category details $category_query = mysql_query( "SELECT * FROM `iptbb_categories` WHERE `cid` = '$cid' " ); $category_row = mysql_fetch_array( $category_query ); //Get the user details $user_query = mysql_query( "SELECT * FROM `iptbb_users` WHERE `id` = '$starter' " ); $user_num = mysql_num_rows( $user_query ); $user_row = mysql_fetch_array( $user_query ); if( $user_num > 0 ){ //If the user exists if( $user_row['avatar'] == '' ){ //If the avatar does not exist $avatar = ''.$fileurl.$template.'images/default_avatar.png'; } else { //If the avatar exists $avatar = $user_row['avatar']; } $posts = $user_row['posts']; $name = '<a href="profile.php?id=' . $user_row['id'] . '">' . $user_row['username'] . '</a>'; $user = $user_row['username']; if( $user_row['sig'] == '' ){ //If there is no signature $signature = ''; } else { //If there is a signature $signature = '<hr size="1" width="25%" align="left" />' . nl2br($user_row['sig']); } //Get the level if( ($user_row['level'] == 1) OR ($user_row['level'] == 0) ){ $level = 'Member'; } elseif( $user_row['level'] == 2 ){ $level = 'Administrator'; } } else { //If the user does not exist $avatar = ''.$fileurl.$template.'images/default_avatar.png'; $posts = 'N/A'; $name = $starter; $signature = ' '; $user = $topic_row['starter']; } //Check what level the viewing user is if( $login_row['level'] >= 0 ){ $reply = '<a href="createreply.php?tid='.$topic_row['tid'].'&pid=0">Reply</a>'; if( ($login_row['id'] == $user_row['id']) OR ($login_row['level'] >= 2) ){ $edit = '<a href="edit.php?tid='.$topic_row['tid'].'&pid=0">Edit Topic</a> ·'; if( $login_row['level'] >= 2 ){ $delete = '<a href="delete.php?tid='.$topic_row['tid'].'&pid=0">Delete Topic</a> ·'; } else { $delete = ''; } } else { $edit = ''; $delete = ''; } } else { $reply = ''; $edit = ''; $delete = ''; } if( $topic_row['edituser'] == '0' ){ $mod = ''; } else { $user_query = mysql_query( "SELECT * FROM `iptbb_users` WHERE `id` = '$topic_row[edituser]' " ); $user_row = mysql_fetch_array( $user_query ); $mod = 'Last edited on ' . time_date( $topic_row['editdate'] ) . ' by ' . $user_row['username'] . '.'; } //Display the start of the topic $tpl->assign(array( 'bName' => $setting['name'], 'dLink' => 'viewdir.php?id=' . $cid, 'dName' => $category_row['name'], 'fLink' => 'viewforum.php?id=' . $fid, 'fName' => $forum_row['name'], 'tName' => stripslashes($topic_row['title']), 'tContent' => bbcode(nl2br(stripslashes($topic_row['body']))), 'username' => $name, 'image' => $avatar, 'posts' => $posts, 'signature' => bbcode(nl2br(stripslashes($signature))), 'level' => $level, 'date' => time_date( $topic_row['date'] ), 'reply' => $reply, 'edit' => $edit, 'delete' => $delete, 'mod' => $mod )); $tpl->display(''.$fileurl.$template.'topic_head.tpl'); $post_query = mysql_query( "SELECT * FROM `iptbb_posts` WHERE tid='$tid' ORDER BY `pid` ASC " ); while( $post_row = mysql_fetch_array( $post_query ) ){ //Get the user details $user_query = mysql_query( "SELECT * FROM `iptbb_users` WHERE `id` = '$post_row[user]' " ); $user_num = mysql_num_rows( $user_query ); $user_row = mysql_fetch_array( $user_query ); if( $user_num > 0 ){ //If the user exists if( $user_row['avatar'] == '' ){ //If the avatar does not exist $avatar = ''.$fileurl.$template.'images/default_avatar.png'; } else { //If the avatar exists $avatar = $user_row['avatar']; } $posts = $user_row['posts']; $name = '<a href="profile.php?id=' . $user_row['id'] . '">' . $user_row['username'] . '</a>'; if( $user_row['sig'] == '' ){ //If there is no signature $signature = ''; } else { //If there is a signature $signature = '<hr size="1" width="25%" align="left" />' . nl2br($user_row['sig']); } //Get the level if( $user_row['level'] == 1 OR $user_row['level'] == 0) { $level = 'Member'; } elseif( $user_row['level'] == 2 ){ $level = 'Administrator'; } //Check what level the viewing user is if( $login_row['level'] >= 0 ){ $reply = '<a href="createreply.php?tid='.$topic_row['tid'].'&pid='.$post_row['pid'].'">Reply</a>'; if( ($login_row['id'] == $user_row['id']) OR ($login_row['level'] >= 2) ){ $edit = '<a href="edit.php?tid='.$topic_row['tid'].'&pid='.$post_row['pid'].'">Edit</a> ·'; if( $login_row['level'] >= 2 ){ $delete = '<a href="delete.php?tid='.$topic_row['tid'].'&pid='.$post_row['pid'].'">Delete</a> ·'; } else { $delete = ''; } } else { $edit = ''; $delete = ''; } } else { $reply = ''; $edit = ''; $delete = ''; } if( $post_row['edituser'] == '0' ){ $mod = ''; } else { $user_query = mysql_query( "SELECT * FROM `iptbb_users` WHERE `id` = '$post_row[edituser]' " ); $user_row = mysql_fetch_array( $user_query ); $mod = 'Last edited on ' . time_date( $post_row['editdate'] ) . ' by ' . $user_row['username'] . '.'; } //Display the normal template $tpl->assign(array( 'tName' => stripslashes($post_row['title']), 'tContent' => bbcode(nl2br(stripslashes($post_row['body']))), 'username' => $name, 'image' => $avatar, 'posts' => $posts, 'signature' => bbcode(nl2br(stripslashes($signature))), 'level' => $level, 'date' => time_date( $post_row['date'] ), 'reply' => $reply, 'edit' => $edit, 'delete' => $delete, 'mod' => $mod, )); $tpl->display(''.$fileurl.$template.'topic_mid.tpl'); } else { //If the user does not exist $name = $post_row['user']; //Display the normal template $tpl->assign(array( 'tName' => stripslashes($post_row['title']), 'tContent' => bbcode(nl2br(stripslashes($topic_row['body']))), 'username' => $name, 'date' => time_date( $post_row['date'] ), 'tid' => $topic_row['tid'], 'id' => $post_row['pid'], )); $tpl->display(''.$fileurl.$template.'topic_mid2.tpl'); } } //Display the finishing of the table $tpl->display(''.$fileurl.$template.'bot_table.tpl'); //Displaying Statistics if( ($setting['statistics'] == 1) AND ($setting['viewtopic_stats'] == 1) ){ include_once( 'statistics.php' ); } //Display the footer $tpl->assign(array( 'copyright' => $setting['copyright'] . '<br /> Powered by <a href="http://iptbb.org/">IPTBB</a> :: Version ' . $setting['version'], )); $tpl->display(''.$fileurl.$template.'footer.tpl'); ?>
  12. Your example doesn't work me when I try to intergrate. function bbcode($var) { $search = array( '/\[s\](.*?)\[\/s\]/is', '/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[img\](.*?)\[\/img\]/is', '/\[url\](.*?)\[\/url\]/is', '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[php\](.*?)\[\/php\]/ies' ); $replace = array( '<s>$1</s>', '<strong>$1</strong>', '<em>$1</em>', '<u>$1</u>', '<img src="$1" />', '<a href="$1">$1</a>', '<a href="$1">$2</a>', 'highlightPHP(\'$1\')' ); //$var = preg_replace($search, $replace, $var); //$var = preg_replace ($search, $replace, $var); //$var = preg_replace ("/javascript:/i","http://javascript*******",$var); $htmlx = preg_replace($search, $replace, $var); //echo nl2br($htmlx); return $htmlx; } function highlightPHP($code) { $html = '<table style="border-style: dashed; background-color: #FFF; border-width: thin;" align="center"> <tr><td align="left">' . highlight_string($code, true) . '</tr></td></table>'; return $html; } D: tell me what I did wrong here. it just add's < /BR> tag's.
  13. sorry let me POST the original source and ill explain, I'm sorry I forgot xD. $search = array( '/\[s\](.*?)\[\/s\]/is', '/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[img\](.*?)\[\/img\]/is', '/\[url\](.*?)\[\/url\]/is', '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[php\](.*?)\[\/php\]/is' ); $replace = array( '<s>$1</s>', '<strong>$1</strong>', '<em>$1</em>', '<u>$1</u>', '<img src="$1" />', '<a href="$1">$1</a>', '<a href="$1">$2</a>', '<center><table style="border-style: dashed; background-color: #FFF; border-width: thin;" align="left"><tr><td> <?php highlight_string(\' ?>$1<?php \'); ?></tr></td></table></center>' ); Well He's tryting to get the highlight_string(); to work inside of an array and its not working, At all. and well I know it wouldn't I took and checked other popular forums that use tag. and checked them out, They make a function specially for the [code=php:0] BBcode.
  14. function bbcode($var) { $search = array( '/\[s\](.*?)\[\/s\]/is', '/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[img\](.*?)\[\/img\]/is', '/\[url\](.*?)\[\/url\]/is', '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[php\](.*?)\[\/php\]/is' ); $replace = array( '<s>$1</s>', '<strong>$1</strong>', '<em>$1</em>', '<u>$1</u>', '<img src="$1" />', '<a href="$1">$1</a>', '<a href="$1">$2</a>', '' ); if(stristr($var, '[code=php:0]') == true){ $search2 = array( '/\[php\](.*?)\[\/php\]/is' ); $replace2 = array( '$1' ); $var = preg_replace ($search2, $replace2, $var); //$var = preg_replace ("/javascript:/i","http://javascript*******",$var); return $var; } $var = preg_replace ($search, $replace, $var); $var = preg_replace ("/javascript:/i","http://javascript*******",$var); return $var; } Well i'm trying to help oujt my friend but I know the answer but I don't have time to do it, I understand that the way he wrote his function is beyond me and would require me to rewrite it, But I don't feel like rewriting it, So could you guys help me out and find a solution?
  15. I am looking for how to make one of these, but my searches on google and other search engines turn to failure. I have yet to produce the results I need to produce... Im trying to make a bot that is capable of logging into a site, storing cookies and going between two pages, to keep me logged in. while im not actually on the page. This is not going to be used for... 'Cheating' purposes of any like. I merely want to fake my logged in time on a site whicth is actually my school page.
×
×
  • 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.