Jump to content

Twister1004

Members
  • Posts

    201
  • Joined

  • Last visited

Posts posted by Twister1004

  1. Hello everyone,

     

       It's Twister. I am here to ask anyone and everyone to test a my website here, http://twistablepie.servegame.com/cype . You are welcome to register as many accounts as you see fits your needs. There is a max limit, so beware of that.

     

    I am authorized to test any SQL injections or any security issues, for that matter. I am also a developer within this website.

     

    If anyone finds an error, please report it to me!

     

    Thank you.

     

    P.S Validation is within the scrolling header at the top.

     

    -Twister

  2. Hey everyone, this sucks, but I have no idea what this script is and what it does, (Go figure), I also have no idea what this function does. Could anyone help me? =)

     

     

    Error:

    Fatal error: Call to undefined function curl_init() in C:\Documents and Settings\Compaq_Owner\Desktop\Server Files\XAMPP\xampp\htdocs\StickamPHP\Services\Stickam\API\Base.php on line 73

     

     

    
    <?php
    /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
    
    /**
    * PHP5 interface for Stickam API
    *
    * PHP version 5 or newer
    *
    * @category  Services
    * @package   Services_Stickam
    * @author    Advanced Video Communications Inc.
    * @copyright 2008 Advanced Video Communications Inc.
    * @license   
    * @link      http://developer.stickam.com/
    */
    
    require_once '../Services/Stickam/Common.php';
    
    /**
    * Services_Stickam_API_Base
    *
    * Abstract class for all Stickam API Classes
    *
    * @category  Services
    * @package   Services_Stickam_API_Base
    * @link      http://developer.stickam.com/
    */
    abstract class Services_Stickam_API_Base
    {
    //{{{ request()
        /**
         * send a request to the API
         */
        protected function request($api, array $args = array(), $method = null)
        {
            $url = Services_Stickam_Common::$URL . $api;
    
            $args['key'] = Services_Stickam_Common::$API_KEY;
            $args['rid'] = round(microtime(true) * 1000);
            $args        = $this->sign($args);
    
            if ( $method == 'POST' ) {
                $result = $this->_http_post($url, $args);
            } else {
                $result = $this->_http_get($url, $args);
            }
    
            $this->debug($result . "\n");
    
            $xml = @simplexml_load_string($result);
            if ( ! $xml instanceof SimpleXmlElement ) {
                throw new Services_Stickam_Exception(
                    'Could not parse XML response', 0
                );
            }
    
            return $xml;
        }
    //}}}
    
    //{{{ _http_get()
        /**
         * HTTP GET request
         */
        private function _http_get($url, array $args = array())
        {
            $url .= '?';
            foreach ( $args as $k => $v ) {
                $url .= '&' . $k . '=' . urlencode($v);
            }
            $this->debug($url . "\n");
    
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL,            $url);
            curl_setopt($ch, CURLOPT_HEADER,         false);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, Services_Stickam_Common::$TIMEOUT);
            $result = curl_exec($ch);
    
            if ( curl_errno($ch) ) {
                throw new Services_Stickam_Exception(
                    curl_error($ch), curl_errno($ch)
                );
            }
    
            $info = curl_getinfo($ch);
            if ( $info['http_code'] != 200 ) {
                throw new Services_Stickam_Exception(
                    'Services not available.', $info['http_code']
                );
            }
            curl_close($ch);
    
            return $result;
        }
    //}}}
    
    //{{{ _http_post()
        /**
         * HTTP POST request
         */
        protected function _http_post($url, array $args = array())
        {
            $fields = '';
            foreach ( $args as $k => $v ) {
                $fields .= '&' . $k . '=' . urlencode($v);
            }
    
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL,            $url);
            curl_setopt($ch, CURLOPT_POST,           true);
            curl_setopt($ch, CURLOPT_POSTFIELDS,     $fields);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, Services_Stickam_Common::$TIMEOUT);
            $result = curl_exec($ch);
    
            if ( curl_errno($ch) ) {
                throw new Services_Stickam_Exception(
                    curl_error($ch), curl_errno($ch)
                );
            }
    
            $info = curl_getinfo($ch);
            if ( $info['http_code'] != 200 ) {
                throw new Services_Stickam_Exception(
                    'Services not available.', $info['http_code']
                );
            }
            curl_close($ch);
    
            return $result;
        }
    //}}}
    
    //{{{ sign()
        /**
         * Sign the request
         *
         * @link http://developer.stickam.com/index.php?title=Getting_Started#Validation
         */
        protected function sign(array $args)
        {
            if ( isset($args['sig']) ) {
                unset($args['sig']);
            }
    
            $sig = '';
            ksort($args);
            foreach ( $args as $k => $v ) {
                if ( $k == 'rid' ) continue;
                $sig .= $v;
            }
            $sig = $sig . Services_Stickam_Common::$SECRET_KEY . $args['rid'];
            $this->debug('sig: ' . $sig . "\n");
    
            $args['sig'] = md5($sig);
            return $args;
        }
    //}}}
    
    //{{{ debug()
        public function debug($s = '')
        {
            if ( Services_Stickam_Common::$DEBUG ) {
                echo $s;
            }
        }
    //}}}
    }
    ?>
    

     

    Thanks for everyone's help =D

  3. Hey everyone! Well my life just got a whole lot more complicated! D=.

     

    Ok, I basically have a huge question, which I know nothing about flash and I would like to ask everyone, if you know how to include the PHP stuff on the action script. Is it like normal in HTML where you go <?php ?> and stuff or do you have to include it from another file?

     

    If anyone could help me with this, it is greatly appreciated!

     

    P.S.

    My game design team (new team) is converting to flash, and I don't know anything about it. So this is why I'm asking.

  4. Omg, thank you! However, the password did not come out correctly. It came out as a whole different thing, however, it was encrypted, but it didn't work. It's not the same.

     

    Here, maybe this will help ya get a hint =)

     

    http://twistablepie.servegame.com/help

     

    That is the full script or the register page from someone else. I just want to be able to make a simple register out of it (without the OOP if you will =) )

     

    Could you maybe figure it out? I can't seem to find anything that would be helpful.

     

    The username used is test and the password that is used is test.

     

    The encryption came out as 3d0d99423e31fcc67a6745ec89d70d700344bc76 .

  5. Hello everyone! Thanks for reading =)
    
    Objective:
    Ok, I'm hosting a server for a game right now, and I'm trying to figure out how to get the passwords in encrypted. I've found out how they do it, but I can't figure out how to make it work.
    
    Problem:
    The SQL Is currently not working correctly, it acts like one value does not have a value. 
    
    Error type:
    Error in the encryption! You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2
    
    Encryption type:
    Sha1 and concat.
    
    whole code:
    [code=php:0]
    <?php
    mysql_connect('localhost', 'root', 'root'); mysql_select_db('test');
    if($_SERVER['REMOTE_ADDR'] != "76.7.105.94"){
    echo "You are not allowed to view this page!";
    }
    ?>
    <html><head></head>
    <body>
    <form method="POST" action="">
    <input type="text" name="username" />
    <input type="text" name="password" />
    <input type=submit name=submit />
    </form>
    <?php
    if(isset($_POST['submit'])){
    $username = $_POST['username'];
    $password = $_POST['password'];
    
    echo $username . "<p></p>";
    echo $password . "<br/>";
    $sql = mysql_query("INSERT INTO `passwords` (`name`, `password`) 
    VALUES (UPPER('".$username."'), SHA1(CONCAT(UPPER('".$username."') , ('".$password."')))") or die("Error in the encryption! " . mysql_error());
    }
    ?>
    </body>
    </html>
    

     

    Thank you for you help, tips, hints, guiding, etc.

    =)

  6.     * r: Displays the full date, time and timezone offset. It is equivalent to manually entering date("D, d M Y H:i:s O")

     

    Time:

     

        * a: am or pm depending on the time

        * A: AM or PM depending on the time

        * g: Hour without leading zeroes. Values are 1 through 12.

        * G: Hour in 24-hour format without leading zeroes. Values are 0 through 23.

        * h: Hour with leading zeroes. Values 01 through 12.

        * H: Hour in 24-hour format with leading zeroes. Values 00 through 23.

        * i: Minute with leading zeroes. Values 00 through 59.

        * s: Seconds with leading zeroes. Values 00 through 59.

     

    Day:

     

        * d: Day of the month with leading zeroes. Values are 01 through 31.

        * j: Day of the month without leading zeroes. Values 1 through 31

        * D: Day of the week abbreviations. Sun through Sat

        * l: Day of the week. Values Sunday through Saturday

        * w: Day of the week without leading zeroes. Values 0 through 6.

        * z: Day of the year without leading zeroes. Values 0 through 365.

     

    Month:

     

        * m: Month number with leading zeroes. Values 01 through 12

        * n: Month number without leading zeroes. Values 1 through 12

        * M: Abbreviation for the month. Values Jan through Dec

        * F: Normal month representation. Values January through December.

        * t: The number of days in the month. Values 28 through 31.

     

    Year:

     

        * L: 1 if it's a leap year and 0 if it isn't.

        * Y: A four digit year format

        * y: A two digit year format. Values 00 through 99.

     

     

    Credits to Tizag.com

  7. Hey everyone! I just got done reading about the Pagination tutorial here on PHP FREAKS! Yay go me! I actually wasn't distracted easily and finished it =D.

     

    Objective: I'm getting quite an error, view it here. It's giving me an error, I, myself, have no idea what I'm supposed to do.

     

    This is kinda like a copy of the tutorial so that way I can play around with it and start changing what I want and need to.

    <?php
    $conn = mysql_connect('localhost','root','root') or trigger_error("SQL", E_USER_ERROR);
    $db = mysql_select_db('test',$conn) or trigger_error("SQL", E_USER_ERROR);
    
    $sql = "SELECT COUNT(*) FROM `page`";
    $result = mysql_query($sql);
    $getrows = mysql_fetch_row($result);
    $numrows = $getrows;
    
    //To find the total pages we have,Take the number  of rows ($numrows) and divide that by the rows per page ($rowsonpage)
    //ceil will appearenly round up. (Check out what it does later!)
    
    //number of rows shown on page
    $rowsonpage = 10;
    //find out total pages
    $totalpages = ceil($numrows / $rowsonpage); //The error IS HERE, however I don't know what ceil is, so I have no idea how to solve it.
    
    //get the current page
    if(isset($_GET['pagenum']) && is_numeric($_GET['pagenum'])){
    //This variable will be announced as a NUMBER or int
    $currentpage = (int) $_GET['pagenum'];
    }
    else{
    //This will set the DEFAULT page number
    $currentpage = 1;
    }
    //If the current page is greater than the total amount of pages needed, Set it to LAST PAGE
    if($currentpage > $totalpages){
    $currentpage = $totalpages;
    }
    //If the page is less than the First page, Set it to the FIRST PAGE
    if($currentpage < 1){
    $currentpage = 1;
    }
    // The page offset of the list is based on the current page (Figure out later)
    $offset = ($currentpage - 1) * $rowsonpage;
    
    //Get the info from the database
    $sql = "SELECT `id`, `number` FROM `page` LIMIT $offset, $rowsonpage";
    $result = mysql_query($sql);
    
    //while the rows are being fetched
    while($list = mysql_fetch_assoc($result)){
    // print the data
    echo $list['id'] . " : " . $list['number'] . "<br/>";
    }
    
    //-------------------------------------BUILD PAGE LINKS! --------------------------------------------
    //if not on page 1 don't show the back links
    if($currentpage > 1){
    //Show << Link to go back to page 1
    echo "<a href ='{$_SERVER['PHP_SELF']}?currentpage=1'> << </a>";
    //Get previous page numbers
    $prevpage = $currentpage - 1;
    //Show  < Link to go back one page
    echo "<a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage'> < </a>";
    }
    // Make a range of number links (pages) to show rather than showing 500 links at once
    $range = 3;
    // Loop to show links to range of pages around the current one
    for($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++){
    // If it is a valid page number
    if(($x > 0) && ($x <= $totalpages)){
    	//If we are on the current page
    	if($x == $currentpage){
    		// "Highlight" the current page number but do NOT make  alink for it.
    		echo "[<br>$x</b>]";
    		//If not the current page then make it a link
    	}
    	else{
    		echo "<a href='{$_SERVER['PHP_SELF']}?currentpage=$x'>$x</a>";
    	}
    }
    }
    //If you are not on the last oage, show the next page and the last page
    if($currentpahe != $totalpages){
    //get the NEXT page
    $nextpage = $currentpage + 1;
    //echo the next page ( > )
    echo "<a href ='{$_SERVER['PHP_SELF']}?current=$nextpage'> > </a>";
    // echo the last page button
    echo "<a href ='{$_SERVER['PHP_SELF']}?currentpage=$totalpages'> >> </a>";
    }
    //------------------------END PAGE BUILDING LINKS---------------------------
    ?>
    

     

    I'm not doing plagiarism, this is so I may learn off it.

     

    The problem I'm having is listed in the code i provided and in the website provided as well.

     

    Any hints, tips, posts, etc. is appreciated. Thanks for your time!

×
×
  • 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.