Jump to content
xisto Community

8ennett

Members
  • Content Count

    435
  • Joined

  • Last visited

Posts posted by 8ennett


  1. This all seems very suspect if you ask me. Why on earth would you want to retrieve files from a locked out laptop and yet leave it in the exact condition it is now?If you had acquired this laptop and it is now yours I could understand you wanting to gain access and reset the password etc. but this is far too dodgy.I would have asked you to provide more details on why you wanted to access these files before helping you however it would seem FirefoxRocks and tansqrx have already provided you with a means to access this laptop.


  2. Using images found anywhere on the web is illegal without permission from the copyright owner, regardless of a watermark or not.Unless you created the image yourself then you are breaking the law using someone elses images (unless it is clearly stated you may reproduce them without consequence or you have permission to reproduce them).Obviously there is a high chance the copyright owner will never stumble across your site and see their image, however if they did then you would be liable and may very well find yourself in the middle of a law suit.Better to be safe than sorry, only use freely distributable images and images you have created yourself.


  3. Has any one got a FREE webhost with all these features? because i need one thanks :)

    err frazz, Xisto is a free webhost with all those features and more.

    And as for this mccodes thing, I know someone who was stupid enough to buy it after I told him not to, the coding is a complete mess (yes I'm talking about v2). I could have written it in a day and it offers very limited unique functionality when compared to other online rpg's. They say it's a great starting point for beginners, yet you would have to be a minimum of intermediate before you can start properly using the engine.

    I'm going to be writing a full tutorial on creating an advanced text-based online rpg soon and will be posting it in the tutorials section. It will show serious developers how create their own rpg, will definately blow mccodes out of the water, and best of all it will be free.

  4. Nice. This look good to me. But can you host your files to anything other than rapidshare, mediafire ? You can host them on 4shared, mihd, windows live skydrive. Because mediafire is based on slots for downloading and for many countries these slots are always busy irrespective of the traffic to the files. Even if you see less traffic to your downloads i can't download those files because of slots. Slots allotted for asian countries are too low, so if you can host it for 4shared or mihd, skydrive then it'll help a lot to look at your code. Thanks for the tutorial as well.

    Ok Ive uploaded the file to the following location: http://forums.xisto.com/no_longer_exists/

    Also the updated file contains the amendment mentioned above.

  5. If you don't know how to connect to mysql through php then I suggest you go through a tutorial on how to write php and its many different functions. You can't just jump in to making a text-based rpg without learning the different programming languages you're going to be using.Writing your own rpg is a big project and requires coding skills and up-to-date security techniques to protect your users.I'm going to be writing an article in the tutorials section on writing a basic rpg game. Keep an eye out for it.


  6. Also, could I change the line: return '<img src="./'.$randir[$getrandir].''.$imgarray[$rand].'" width="600" align="top">';
    so that if I click it, it also opens randomizer.php?

    For example, could I <a href a php returned image as well?

    I attached the randomizer.php file to this post.


    Oh and 8ennet, I started the php tutorial and am reading it daily.


    Yes you can change the line:

    return '<img src="./'.$randir[$getrandir].''.$imgarray[$rand].'" width="600" align="top">';

    to:

    return '<a href="http://forums.xisto.com/no_longer_exists/; target="_blank" border="0"><img src="./'.$randir[$getrandir].''.$imgarray[$rand].'" width="600" align="top"></a>';

    This will open randomizer in a new tab (or window) however if you want it to load on the current page remove target="_blank". Also we set the border to 0 so that default blue square isn't around the edge of your image (the kind that turns purple once you have visited that link).

    Also great to hear you are reading that tutorial, how's it going?

  7. MySQL Database Inventory Question

    I Want To Create A PHP Text Based Web Game

     

    hey guys, I've been coding a web-based text-rpg lately using javascript/jquery/php/MySQL andI have a question on how to best do something.

     

    I guess the question mostly has to do with mysql database setup. I have a table in my database called Players and in this the fields are userName, password, health, energy, strength, money...And so on..

     

    Anyway, now I need every player to have an "Inventory", I can't have "Inventory" be a field in players, as each Inventory field will need to have multiple values (all weapons/items/stuff) that each player owns. My question is what would be the best way to do this database-wise? Will I need to create an Inventory_PlayerID table for every single player that registers? It seems like there should be an easier way to do it. Any insight will be appreciated.


    I had a hard time deciding on my inventory system, but I found the following to be the best way.

     

    Decide on the size you want a users inventory to be and create a new table called inventory with the rows ID, USER, ITEM. In your php select all their inventory SELECT * FROM INVENTORY WHERE user=USERID, to get the amount of inventory slots used use mysql_num_rows(QUERY) so:

     

    $invsize = 10;if (mysql_num_rows(mysql_query("SELECT * FROM INVENTORY WHERE user=USERID")) < $invsize){echo 'You still have inventory space';}else {echo 'Your inventory is full!';}

    Hope that helps you!

  8. can you attach as a forum reply your existing randomizer.php so i can check it out? there are still a few bugs with it.about the question mark "?"

    on your html source code i saw this lines..

    <FORM METHOD="LINK" ACTION="">  <INPUT TYPE="submit" VALUE="New Picture">  </FORM>

    the empty action part causes the extra '?' to be padded. there should be something between 'ACTION=""' in your case you can just put randomizer.php on that part. an <a href='randomizer.php'> will also work as replacement for the FORM tags.

    Agreed, change the action to randomizer.php.

    Also the reason why the image isn't showing up is because of that extra slash at the beginning. If you change the slash to ./ then it should work fine (globally understood by all browsers).

    For example <img src="./'.$randir[$getrandir].''.$imgarray[$rand].'"

    Also, just a bit of useful advice. Remember that when running your server on a linux machine then it is essential to have all file names and extensions name with proper casing. When I was building a site, in the php file i referred to an image called "image1.png" however the real name of the file was "image1.PNG" but because I didn't write the extension in uppercase then linux couldn't find the file.

    So basically what was once <img src="image1.png" /> wouldn't work but <img src="image1.PNG" /> would work because the real image was named like that.

    Not really relevant to this topic but something your MUST remember.

  9. You probably should learn how to use databases with php as it is probably one of the most powerful and flexible ways to create any kind of website that stores user data.

    Try going through the tutorial here

    When I first decided to learn php it was this tutorial I used, I managed to go through the entire thing within 24 hours and by the time I had finished it I knew everything I needed to know about using PHP and MySQL together. It taught me all the basics of securing my site and its contents, how to use custom functions and classes, if statements and loops, arrays and sql data. Everything you need to make life so much easier for yourself.

    It would be easiest for you to do it this way and learn how to do it, that way you won't have to approve every single image uploaded using information sent to your email (it will get very old very fast, trust me). Instead the whole system will be automated (including adding credit to images on your site etc.) and all you will have to do is click a single button everytime an image is uploaded to approve it.


  10. It's looking good, as long as it works lolSo next what are you going to do with the rest of the data the user has submitted? It uploads the image file ok, but the user fills out the rest of the form yet you don't store any of that data. You give them the option to credit them, don't credit them, and for some reason credit them on the forum which you don't seem to have yet.Are you going to be putting this information in to a database? Or even just storing it in a text file?


  11. I've been looking all over for an app (preferably a firefox add-on) which shows in real time the current bandwidth consumption of a site.Basically I'm wanting to measure the amount of data being transmitted from the site while I have an AJAX script running and i'm having trouble locating anything like that. It's just so I can predict overall bandwidth consumption for X amount of users at any given time and adjust the refresh rate to compensate (currently refreshing 10 rows of MySQL data every 1,000 microseconds during testing).There are tonnes of add-ons for firefox that measure your current bandwidth speed and so on but that's not what i'm looking for so please don't post anything like that. Just an add-on that shows current consumption, not speed.Thanks guys, night all.


  12. Hmm, Caron it would appear you are taking code snippets from all over the web and are wanting us to piece them together for you as with the previous uploader and random image viewing scripts I helped you out with today.It's not that i'm not willing to help, i'm more than happy to help, however the best way to learn is through practical examples. Looking above it isn't going to be very hard to combine the two scripts, just have a look through them. It does seem like a rather simple process, I will give you a quick idea, place the contents of the upload.php in to your mailform.php and not the other way around (placing the contents of upload.php in the same else statement as the mail() function). Place your upload form in to your mail form, removing the image_source element from the original mail form first.If you haven't been able to accomplish this by the morning then I'll help you out with it, but practice will be the best thing for you i'm sure.


  13. I put those damn [0] in again, sorry here is the modified code for the getRandomImage();

    return '<img src="'.$randir[$getrandir].''.$imgarray[$rand].'" width="'.resizeImage($randir[$getrandir].''.$imgarray[$rand], 'width', 100, 100).'" height="'.resizeImage($randir[$getrandir].''.$imgarray[$rand], 'height', 100, 100).'">';

    Or you can use vhortex's method above, however I have found on some touchscreen phones that can cause errors.

  14. Yes not a problem, simply use this function:

    function resizeImage($originalImage,$return,$toWidth,$toHeight){// Get the original geometry and calculate scaleslist($width, $height) = getimagesize($originalImage);$xscale=$width/$toWidth;$yscale=$height/$toHeight;// Recalculate new size with default ratioif ($yscale>$xscale){$new_width = round($width * (1/$yscale));$new_height = round($height * (1/$yscale));}else {$new_width = round($width * (1/$xscale));$new_height = round($height * (1/$xscale));}if ($return == 'height'){return $new_height;}else {return $new_width;}}

    You use it like this, if you want your image to be a max height of 100 and a max width of 100 then you would type this in to your html:

    <img src="yourimage.jpg" width="<?php echo resizeImage('yourimage.jpg', 'width', 100, 100); ?>" height="<?php echo resizeImage('yourimage.jpg', 'height', 100, 100); ?>" border="0"/>

    So if you wanted to add this function in to your randomize.php file then add the image resize function and then change the <img> tag at the bottom of the random image function to the following:

    return '<img src="'.$randir[$getrandir[0]].''.$imgarray[$rand].'" width="'.resizeImage($randir[$getrandir[0]].''.$imgarray[$rand], 'width', 100, 100).'" height="'.resizeImage($randir[$getrandir[0]].''.$imgarray[$rand], 'height', 100, 100).'">';


  15. My mistake sorry, on the line where is says:$dir=opendir($randir[$getrandir[0]]);Change that to:$dir=opendir($randir[$getrandir]);And also change the next line:return '<img src="'.$randir[$getrandir[0]].''.$imgarray[$rand].'" width="170" height="137">';to:return '<img src="'.$randir[$getrandir].''.$imgarray[$rand].'" width="170" height="137">';I forgot to remove the [0] from both lines


  16. Ok, had a look through all the code, very simple to do. The images in your http://forums.xisto.com/no_longer_exists/ (random001.jpg to random167.jpg) need to be put in a new folder and we will call this folder http://forums.xisto.com/no_longer_exists/ Now here is the MOST important part. If you are INCLUDING randomizer.php in a different php document in the base directory, then change your images directories to the following: $randir[0] = 'picturearchive/archive/'; $randir[1] = 'picturearchive/useruploads/'; However, if the user will be going to http://forums.xisto.com/no_longer_exists/randomizer.php directly then change the directories to: $randir[0] = 'archive/'; $randir[1] = 'useruploads/'; That's it, it should all work now without any problems.


  17. Right, ignore all that above, sorry I'm not long out of bed and haven't had any coffee yet.The problem is the directories you have set it to. It needs to be a relative path not an absolute path. Also like I said you can't have any other files apart from images in the same directory as the images, but I will re-write the code as needed if there is no other way.Now move your randomizer.php to the base directory and change the directory lines to the following:$randir[0] = './picturearchive/';$randir[1] = './picturearchive/useruploads/';Instead of working on little *BLEEP*-bits I've got a better idea, if you want to add the contents of the picturearchive directory: randomizer.php 16-Aug-2010 07:13 722 rotate.php 16-Aug-2010 07:07 5.5K upload.php 16-Aug-2010 07:03 3.2K to a rar archive and PM me the link then I'll go through and restructure the entire directory and PHP code so it will work and is efficient.Just working on one problem at a time as they come up can take forever and leave you with some very messy code!


  18. Right I know what the problem is, i'm guessing that the folder that contains all the images also contains other files as well such as php documents?If that's the case it may be prudent to slightly restructure your site and keep the images in a seperate folder to any other files, however if that's not possible then just let me know and I'll rewrite the function again to ONLY pick up images (the reason I said try restructuring first is because modififying the code for images only is going to be annoying lol but i'll do it if need be)*EDIT*Hold on, scrap all that, I can see the problem, the directory entered isn't valid. Show me what you have replaced the images/randomdirectoryX/ with and I'll see wuts up. setting the php file as the source would mean using the gd2 library and putting the image in the header, it's a completely different set of code, I'd stick with just echoing the function for now.


  19. Something rather annoying about this post being stretched out like this, but never mind lol

    Ok I'm going to write a function below for you so you can select a random image from a random folder each time the function is called.
    What I have done is basically taken the coding example from here (so the credit really goes to that person) and just added a bit of extra functionality
    too incorporate multiple folders.

    function getRandomImage(){// Change directories to your image directories, you can also add more if you wish eg. $randir[2] = 'images/randomdirectory3/'; just remember to add the trailing slash$randir[0] = 'images/randomdirectory1/';$randir[1] = 'images/randomdirectory2/';$getrandir = array_rand($randir, 1);$dir=opendir($randir[$getrandir[0]]);$i=0;while($imgfile = readdir($dir)){if (($imgfile != ".") && ($imgfile != "..")){$imgarray[$i] = $imgfile;$i++;}}closedir($dir);$rand=rand(0,count($imgarray)-1);if($rand >= 0){return '<img src="'.$randir[$getrandir[0]].''.$imgarray[$rand].'" width="170" height="137">';}}

    So now all you have to do is change the following lines:

    $randir[0] = 'images/randomdirectory1/';
    $randir[1] = 'images/randomdirectory2/';

    to the directorys you want to pull a random image from and like I stated in the comments, you can add more directories if you wish.
    So now you have changed your directories all you need to do is echo the function and it will display your image.

    echo getRandomImage();

    I haven't tested the modified code but looking over it there shouldn't be a problem, let me know if it works.

  20. If you want to setup phpmyadmin on your own server then you will have to write your own config file containing the username and password. There is an install script that comes with phpmyadmin that can help you with this however I've never used it.

     

    You can use this config to simply define the username and password then phpmyadmin assumes the default host is localhost, however you can define many different config settings in this config file to change that.

     

    If you are wanting to setup a local copy of phpmyadmin however are wanting it to connect to your database on a hosted account somewhere on the web etc. then you will have to be careful as this can be both a massive security threat and also impossible in some cases as certain web hosts do not allow external connections to mysql and all access must be done locally.

     

    A good working example of how to create your config file can be found here http://forums.xisto.com/no_longer_exists/

    To get started, you'll need to create a file named config.inc.php directly within your phpMyAdmin directory. (There may be a config.sample.inc.php file in there already and, if you wish, you can create a copy of it and name it config.inc.php to use it as a template.)

     

    Note: phpMyAdmin first loads libraries/config.default.php and then overrides those values with anything found in config.inc.php. If the default value is okay for a particular setting, there is no need to include it in config.inc.php. You'll need a few directives in your config.inc.php file though to get going and a simple configuration may look like this:

     

     

    <?php

    $i=0;

    $i++;

    $cfg['PmaAbsoluteUri'] = 'http://forums.xisto.com/no_longer_exists/&%2339;;

    $cfg['Servers'][$i]['host'] = 'MySQL.example.com';

    $cfg['Servers'][$i]['auth_type'] = 'cookie';

    $cfg['blowfish_secret'] = 'Joey did 125 jumping jacks Tuesday morning!';

    $cfg['Servers'][$i]['user'] = '';

    $cfg['Servers'][$i]['password'] = '';

    ?>

     

    Your settings need to be entered in between the ' ' marks after the equal signs. A description of the settings follows, as well as the specific changes you need to make to the above sample configuration to have it work on your FutureQuest hosting package:

     

    $cfg['PmaAbsoluteUri'] = 'http://forums.xisto.com/no_longer_exists/&%2339;; -- replace example.com with your domain name and pma with the name of the directory that contains your phpMyAdmin files

     

    $cfg['Servers'][$i]['host'] = 'MySQL.example.com'; -- replace example.com with your domain name

     

    $cfg['Servers'][$i]['auth_type'] = ''; -- dictates the authentication method used when connecting to your phpMyAdmin installation - see below

     

    The options for authentication are:

    cookie (recommended method)

    http

    config

    signon

    cookie and http authentication methods - These methods are considered more secure than the config method, as your username and password are not stored on the server in your configuration file.

     

    The 'http' option uses the Apache http authentication method. The 'cookie' method uses cookies and has the advantage that you can "Log Out" at the end of your session, deleting the cookie. The above sample config.inc.php file is based on the cookie authention mode.

     

    config method - This method requires storing your MySQL username and password in the file on the server. Therefore, if you choose to use the config option, you will need to be sure to password protect the directory that your phpMyAdmin files reside in as otherwise anyone who would find the directory to your phpMyadmin installation would then be able to access your databases. This is EXTREMELY important. Do not skip the password protection step if you choose the config method. For information on how to password protect directories, visit the Password Protection Tutorial.

     

     

    $cfg['blowfish_secret'] = ''; -- used with the cookie method only. If you specified cookie in the auth_type above, type in a random phrase up to 46 characters long for this setting. This passphrase is just used internally to encrypt the password - you will not be prompted for it later.

     

    $cfg['Servers'][$i]['user'] = ''; -- MySQL username if you are using config method - otherwise leave blank

     

    $cfg['Servers'][$i]['password'] = ''; -- MySQL password only if you are using config method - otherwise leave blank

     

    Make sure you don't have any blank lines at the end of the file and save it as config.inc.php.

     

    Now, open your web browser and visit

    http://forums.xisto.com/no_longer_exists/

    (replace example.com with your domain name and pma with whatever directory your phpMyAdmin is in). You should see a welcome page and, after logging in with your MySQL username and password if you used the cookie method above, you will be able to start working with your databases!

     

    Important Note: For security reasons, phpMyAdmin now recommends that all installations protect access to the ./libraries and ./setup/lib subfolders in your phpMyAdmin directory. The easiest way to do this is probably just to password protect your entire phpMyAdmin directory. For information on how to password protect directories, visit the Password Protection Tutorial. !!! Remember !!! If you used the config authentication method, you will want to immediately password protect your phpAdmin directory to secure it and prevent general access.

     

    FutureQuest strongly recommends password protecting ALL phpMyAdmin installations, even if using the cookie or http authentication options, as extra protection against unauthorized access.


  21. Just a quick tutorial to explain how you can create a hidden website, this means you can have a website hidden within another website or a website that nobody can even view without knowing the secret.

     

    Now this method can be used to add additional security say to your administration panel for your site, basically even if someone were able to brute force the admin password they would still need to know this trick to access the admin panel.

     

    We are going to be playing around with your browsers user agent information. This is basically information available to a server telling it what web browser you are using and it's version number etc. A basic firefox user agent would be like so:

     

    Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1.11) Gecko/20100701 Firefox/3.5.11 (.NET CLR 3.5.30729)

     

    Now for this tutorial we will be using the latest version of firefox, and you will also need to download an add-on called User Agent Switcher which you can download here

     

    Once you have downloaded and installed this add-on, in firefox go to Tools -> Default User Agent -> Edit User Agents

     

    Next click on the "New" button then on "New User Agent..." and you will get a screen like this:

     

    Posted Image

     

    Now we want to set the description to something like "Secret Website", and for this tutorial change the User Agent field to "opensesame".

     

    Excellent, we have now created our new means of accessing our secret website.

     

    Now we are going to write a php file with our code in it. This is very simple to do. The following code will either display our secret website, or if our user agent isn't set right it will redirect the user to google.com instead.

     

    <?phpif ($_SERVER['HTTP_USER_AGENT'] == 'opensesame'){echo 'Well done, you have found the cookies!';}else {header('Location: http://google.com;

    That's it, now upload your php file and first try to access it using your default user agent. You will find you can't, instead it just loads google. Now if you click on Tools -> Default User Agent -> Secret Website then this will change your user agent over to the new "opensesame" value. If you try opening the web page again then you will see the echoed message.

     

    If you don't have a server to try this out on, I have uploaded a copy of the php file to http://forums.xisto.com/no_longer_exists/ so you can still give it a go.

     

    If you want to hide a completely different website inside another website that is simple to do as well. In every page of your site have the above php code, except have your hidden site where the echo currently resides and have the public site in the else statement. Nobody will know it is there unless you tell them it is. You can also change the phrase "opensesame" to anything you want.

     

    I had this idea for hiding web pages when I was messing around with css files, using php to determine the browser so I could provide a more compatible browsing experience (we all know the pains of css and html when it comes to firefox and internet explorer). I had been using the user agent switcher add-on as part of my testing and it suddenly hit me that it could be used as an additional layer of security for your website. Not very practical for average users, I mean who wants to sign up to a website where you have to mess around with all that stuff just to access it, but excellent for hiding your admin panels and creating entirely hidden web pages from the public eye (for secret societies and highly sensitive data).

     

    Don't forget when not accessing your secret website to change your user agent back to the default otherwise it may interfere with other websites.

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.