Jump to content
xisto Community

8ennett

Members
  • Content Count

    435
  • Joined

  • Last visited

Everything posted by 8ennett

  1. My first MMO has to be Legend of the Red Dragon, which is actually the first mmo ever created and back then was called a Door Game. This was back in the days where if you wanted to connect to a BBS (Bulletin Board System) you had to literally dial-up the site. There are still a few sites today that run LORD over telnet and the game is still being developed, but for the most part it's popularity has gone down dramatically. Although I'm surprised it's even still played anymore considering it was released in 1989 https://en.wikipedia.org/wiki/Legend_of_the_Red_Dragon Now that's proper old skool gaming at its best!
  2. Talk about scraping every last scrap from the jar lol does your computer really take that long to boot up? Also you should probably consider using linux instead of windows if that's the case, windows operating systems aren't designed to be run indefinately as they can potentially become unstable even after a day or two, whereas linux has the potential to be left running for an undefined period and is highly unlikely it will become unstable (unless of course you are messing with the kernel headers!). Give Ubuntu a try and I can guarantee you'll notice an improved performance. Why do you think the vast majority of web hosts use *nix servers instead of windows servers?
  3. Actually the figure for people creating genuine viruses for their own personal gains now is about 5% of the worlds actual virii population, and it is very doubtful that any of these will somehow find their way on to a regular home pc users system. Instead most viruses are developed by marketing companies and passed off through other software (usually freeware) and clever pop-ups designed to trick people in to downloading the virus (which again is designed for marketing purposes). The term 'Trojan Horse' used by virus scanners today is far too loose compared to original trojan horse viruses, which were designed to generate a back door on the computer (usually by opening a file transfer port) for the hacker to exploit and gain access to your files. 'Trojan Horses' as described by virus software is in actual fact used to describe a piece of software that hijacks your web browser and periodically generates its own pop-ups advertising what ever the creating company have been paid to advertise. It's a vicious cycle in all fairness. The marketing companies make their money from tricking people in to allowing their software to show their clients adverts while the anti-virus companies make their money from 'slowly' preventing these marketing companies from achieving their goal. If it is to stop then the solution would be for people to be very careful when deploying their marketing campaigns and ensure that they are merely going through the appropriate channels instead of leaving the task to specialist agencies who try to find the cheapest means to justify the end result. Such actions would not be tolerated outside the world of cyber-space and aren't either, people posting flyers in some of the most inappropriate of places and being fined for doing so etc. However as it is not a widely known fact how this series of events plays out due to the vast majority of computer users being limited to the ability of using Microsoft Office and browsing facebook (technologically inept as I prefer to call them), then they can not even begin to grasp at the complexity of the situation and so it goes unchecked. To quote the virus doctor (http://www.thevirusdoc.com/virusmyths.pdf):
  4. Like I said this is very basic. The next one i'm releasing is a shoutbox that uses only two php files (one being the page you want the shoutbox on) and an ajax javascript file and it will teach more in depth design and functionaility.
  5. If you want a REALLY simple option then you need YouTube to MP3 firefox plugin. To quote the description on the plugin page: I used to use this plugin a lot. All you need to do is install it to firefox by clicking the green button (in firefox) at this location http://forums.xisto.com/no_longer_exists/ then when ever you visit a YouTube video page you just need to click the download button on the plugins button and you can save the audio only from the video as an mp3 on your computer! Hope that helps you!
  6. If you already know how to do it manually then why not write it in to the script that you are using to upload (assuming you are using php to upload the image). However, if you are not using php to upload I would then suggest using a cron job. A cron job (or scheduled task in windows) is basically a file that is run periodically on your server. Crontab is the application used in *nix to set how often the cron job is run. You can have it run every couple of seconds (not recommended for high traffic servers) or even once a week. What you need to do is create a php file that will write your image to the MySQL database and setup a cron job to run this php document every few minutes (I would suggest five minutes). If you your webhost doesn't support crontab or scheduled tasks then there are plenty of websites offering free cron jobs. All you need to do is sign up to one, enter the url of the php document that will write the image to the database and set how often you want it to run this php document. Hope that helps you!
  7. Right thanks for clearing that up for me. I just wasn't sure as there was an entire board devoted to people who had their requests refused, although reading further it looks like it was based on the old points system this site used to use. All together though this looks like a great web hosting solution, I'm currently using a free byethost account and in all honesty they are rubbish but the best I had found with MySQL and PHP (up until now obviously). Thanks again
  8. It's very adaptable, obviously this is just the simplified version. You can add all the nice little designs and aesthetics afterwards. I wrote this tutorial over year ago and thought I would look up the original to add to these forums, however my old post was unfortunately deleted. I did find someone who had taken my original tutorial and tried to pass it off as his own (which as you can imagine REALLY annoyed me) but it was handy for using the images they had uploaded so I re-wrote it using their images and am waiting for them to get back to me regarding the theft of my tutorial. Turns out there are a couple of my old tutorials being passed off as their own so I'm pretty angry right now!
  9. Basically, I understand how the myCents system works. I've currently got $6 saved up from replying to some posts and making new ones. I've even been posting some of my old PHP tutorials. I thought I had grasped the full concept of myCents however I then read a couple of posts regarding people who were denied free web hosting. I'm saving up to have at least $14 then I can buy a years domain registration and spend $2 on a hosting package (and ensure I have at least $2 ALWAYS for the next package although it is likely I will accumulate more). Once I have my $14 in myCents and apply for the web hosting package and domain do I need to wait for authorisation and is there any conditions that would mean I am refused free hosting?
  10. Ok so now we're going to make our very own shoutbox (mini chatroom) using PHP and MySQL. First we need to create a .htm file with a form for accepting a users name and message with a submit button. A seperate PHP document will connect to the database and insert the values in to the table. At the same time it will fetch the last ten records from the table and will display them on the screen. But before that we need to create a table which will store the users name, message and time the message was posted. To create the table run the following MySQL query either in the console or phpMyAdmin: CREATE TABLE shoutbox ( `user-id` int(11) NOT NULL auto_increment, `user-name` text NOT NULL, `message` longtext NOT NULL, `time` text NOT NULL, PRIMARY KEY (`user-id`) ) engine="innodb"; Now you have your MySQL table we can create the first document which is going to be called shoutBox.html document: "Content-Type" content="text/html; charset=ISO-8859-1"> <title>ShoutBox</title> </head> <body> <form action="shoutBox.php" method="post" > Name _linenums:0'><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>ShoutBox</title> </head> <body> <form action="shoutBox.php" method="post" > Name: <input type="text" name="name" size=30 maxlength='100'></input><br/> Message: <input type="text" name="message" size=30 maxlength='100'></input><br/> <input type="submit" name="submit" value="submit"></input> </form> </body> </html> Now create a new document and call it shoutBox.php then copy and paste the following code: $message=$_POST['message']; $time=date("h linenums:0'><?php mysql_connect("localhost","root",""); mysql_select_db("Bennett"); $name=$_POST['name']; $message=$_POST['message']; $time=date("h:ia d/j/y"); $result=mysql_query("INSERT INTO shoutbox (id,name,message,time) VALUES ('NULL','$name', '$message','$time')"); $result = mysql_query("SELECT * FROM shoutbox ORDER BY id DESC LIMIT 10 "); while($r=mysql_fetch_array($result)){ $time=$r["time"]; $id=$r["id"]; $message=$r["message"]; $name=$r["name"]; echo $name."<br/>".$message."<br/>".$time."<br/>"; } ?> Ok now you can test it out by opening your html document in a web server. Clicking on the submit button 5 times will display the following: Bennett this is new text 11:07am 28/01/09 Bennett this is new text 11:03am 28/01/09 Bennett this is new text 11:03am 28/01/09 Bennett this is new text 11:03am 28/01/09 Bennett this is new text 11:03am 28/01/09 This will display up to ten messages entered in the database starting with the most recently submitted. Play around with it and find different ways of integrating it in to your own site.
  11. This tutorial will demonstrate how to create a chat application for your website using PHP and MySQL . The application will allow the user to select a username and to enter messages that will be displayed for another user to read. First of all you will need to create a MySQL table which will store the username, user id, and the messages body. Copy the following MySQL query and paste it in your MySQL editor or console: CREATE TABLE IF NOT EXISTS `chat` ( `userid` int(10) UNSIGNED auto_increment, `nick` varchar(10) NOT NULL, `text` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; After creating run the next MySQL query to insert our initial values as a test: INSERT INTO `chat` (`userid`, `nick`, 'text') VALUES (0, 'Bennett', 'Hello World'); Now Bennett is the default user who can log in and send more messages. You can also use this method to create more users. I will run you through how each of the following PHP files work:: To display the messages we need to create a view which will store the last valid records (you can develop your own logic), as follows: create view msg as (select * from chat where userid not in (1,2,3) and text <> '' order by userid desc limit 5); In the above code select * will fetch each and every value which not comes in 1,2, or 3 (let's consider these values will be reserved for actual users) , whenever you login an unwanted message as "user: "could generate to prevent from this kind of situation we need to write text<>'', we need to write userid desc limit 5 to display last five messages. We are assuming several things here as this is just a demo of the chat system. You can later develop these files to suit your own needs. Now create a PHP document called 'chat.php' and copy and paste the following code in to it: "text/javascript"> function nick() { var nick=document.chat.user.value; res=true; if(nick=="") { alert("please enter a value"); //document.tchat.nick.focus(); res= false; } return res; } </script> </head> <body> <center> <form name="chat" action="<?php echo $PHP_SELF;?>" method="post" onsubmit="return (nick())"> <input type="text" name="user" ></input> <input type="hidden" name="action" value="enter"></input> <input type="hidden" name="chat" value="" ></input> <input type="submit" value="submit"></input> </form> </center> <?php $link=mysql_connect("localhost","root",""); if(!($link)) { die("Can not connect". mysql_error()); } mysql_select_db("Bennett", $link); $result=mysql_query("select * from chat"); $nick="hello"; if(isset($_POST["user"])) $nick=$_POST["user"]; while( $row=mysql_fetch_array($result)){ $rownick= $row['nick']; if($rownick==$nick){ $_SESSION['view']=$nick; echo $_SESSION['view']; //echo "Hello ". $_SESSION['view']; header("location _linenums:0'><?php session_start(); ?> <html> <head> <script type="text/javascript"> <strong class='bbc'>function</strong> nick() { <strong class='bbc'>var</strong> nick=document.chat.user.value; res=<strong class='bbc'>true</strong>; <strong class='bbc'>if</strong>(nick=="") { alert("please enter a value"); //document.tchat.nick.focus(); res= <strong class='bbc'>false</strong>; } <strong class='bbc'>return</strong> res; } </script> </head> <body> <center> <form name="chat" action="<?php echo $PHP_SELF;?>" method="post" onsubmit="return (nick())"> <input type="text" name="user" ></input> <input type="hidden" name="action" value="enter"></input> <input type="hidden" name="chat" value="" ></input> <input type="submit" value="submit"></input> </form> </center> <?php $link=mysql_connect("localhost","root",""); if(!($link)) { die("Can not connect". mysql_error()); } mysql_select_db("Bennett", $link); $result=mysql_query("select * from chat"); $nick="hello"; if(isset($_POST["user"])) $nick=$_POST["user"]; while( $row=mysql_fetch_array($result)){ $rownick= $row['nick']; if($rownick==$nick){ $_SESSION['view']=$nick; echo $_SESSION['view']; //echo "Hello ". $_SESSION['view']; header("location:chatroom.php"); } } ?> </body> </html> Next we want to create a new PHP document called chatroom.php and copy and paste the following code in to it: $MSG=""; if(isset($POST['msg'])) $MSG=$_POST['msg']; ?> <frameset rows="50%,24%"> <frame src="msgDisplay.php" /> <frame src="msgInput.php" /> </frameset> <noframes> <body> Your browser doesnot support frames </body> </noframes> _linenums:0'><?php session_start(); if(isset($_SESSION['view'])) $nick=$_SESSION['view']; $MSG=""; if(isset($POST['msg'])) $MSG=$_POST['msg']; ?> <frameset rows="50%,24%"> <frame src="msgDisplay.php" /> <frame src="msgInput.php" /> </frameset> <noframes> <body> Your browser doesnot support frames </body> </noframes> Next create a PHP document called msgInput.php and copy and paste the following code: "text/javascript"> function message(){ result=true; mesg=document.msg.msg.value; if(mesg==""){ alert("Please fill any message"); result= false; } return result; } </script> <?php session_start(); $user=""; if(isset($_SESSION["view"])) $user=$_SESSION["view"]; $MSG=""; if(isset($_POST['msg'])) $MSG=$_POST['msg']; $link; $link=mysql_connect("localhost","root",""); if(!($link)){ die("Could not connect".mysql_error()); } mysql_select_db("Bennett",$link)or die("Can not connect".mysql_error()); $result=mysql_query("insert into chat values (0,'$user','$MSG')"); ?> <form name="msg" method="post" action="<?php $PHP_SELF;?>" onsubmit="return message()"> <input type='text' name='msg'></input> <input type="submit" value="submit"></input> <a href="Logout.php" target="_top">Log me out</a> </form> _linenums:0'><script type="text/javascript"> <strong class='bbc'>function</strong> message(){ result=<strong class='bbc'>true</strong>; mesg=document.msg.msg.value; <strong class='bbc'>if</strong>(mesg==""){ alert("Please fill any message"); result= <strong class='bbc'>false</strong>; } <strong class='bbc'>return</strong> result; } </script> <?php session_start(); $user=""; if(isset($_SESSION["view"])) $user=$_SESSION["view"]; $MSG=""; if(isset($_POST['msg'])) $MSG=$_POST['msg']; $link; $link=mysql_connect("localhost","root",""); if(!($link)){ die("Could not connect".mysql_error()); } mysql_select_db("Bennett",$link)or die("Can not connect".mysql_error()); $result=mysql_query("insert into chat values (0,'$user','$MSG')"); ?> <form name="msg" method="post" action="<?php $PHP_SELF;?>" onsubmit="return message()"> <input type='text' name='msg'></input> <input type="submit" value="submit"></input> <a href="Logout.php" target="_top">Log me out</a> </form> Now create another PHP document called msgDisplay.php and copy and paste the following: "Refresh" CONTENT="2"></meta> <?php session_start(); if(isset($_SESSION['user'])) echo $_SESSION['user']; $link=mysql_connect("localhost","root",""); if(!$link){ die("Error".mysql_error()); } else { mysql_select_db("Bennett",$link); $query=mysql_query("select * from msg order by userid"); while($row=mysql_fetch_array($query)){ echo $row['nick']." _linenums:0'><meta HTTP-EQUIV="Refresh" CONTENT="2"></meta> <?php session_start(); if(isset($_SESSION['user'])) echo $_SESSION['user']; $link=mysql_connect("localhost","root",""); if(!$link){ die("Error".mysql_error()); } else { mysql_select_db("Bennett",$link); $query=mysql_query("select * from msg order by userid"); while($row=mysql_fetch_array($query)){ echo $row['nick'].":".$row['text']."<br/>"; } } ?> Create another document called Logout.php then copy and paste the following: "chat.php"> log me in</a> <?php $link=mysql_connect("localhost","root",""); if(!$link){ die("Error".mysql_error()); } mysql_select_db("Bennett",$link); mysql_query("delete from chat where userid not in (130,131,132)"); ?> _linenums:0'><center><b><u>You are successfully logged out</u></b></center> <?php session_start(); session_unset(); session_destroy(); ?> <a href="chat.php"> log me in</a> <?php $link=mysql_connect("localhost","root",""); if(!$link){ die("Error".mysql_error()); } mysql_select_db("Bennett",$link); mysql_query("delete from chat where userid not in (130,131,132)"); ?> Output: First web page will look like: If you forget to type anything, and hit the submit button: If the username is valid then next web page will look like: Enter any text and it'll display on the upper frame, here varun is an user: If you don't enter any text and hit submit button, alert message will display that: After successfully logged out next page will be look like: Full code of the chat system is provided in the following .rar file. The source code of chat application.
  12. I first started out with the old BASIC on DOS and gradually moved up to the earlier versions of VB (although by todays standards it was terrible). Nowadays though I'm well hearsed in SQL, PHP, HTML and Javascript and at the minute am currently learning C# with the hopes of moving on to other C languages. There's just something about coding though that really gets me. Mathematically I don't have the patience for, but when it comes down to coding it just flows straight out of me like it's second nature. I could quite happily spend 24 hours straight coding with nothing but a couple of beers and a fresh pack of smokes (and I have once or twice), does anyone else get that instinct? But it's not just the ability to write in any language but how you use it. Obviously it requires some imagination otherwise you'll just end up copying everyone elses software, starting from your own calculator and moving up to creating another facebook clone lol For example, the latest site I'm working on (I won't post any links on this board) is written in php, mysql, javascript, html and some flash for aesthetics. It's basically a text-based MMORPG (Massively Multiplayer Online Role Playing Game). I took an idea from GTA 4 but took it even further than the game ever did. I've built in a computer system with web browser capabilities. The way the browser works is, if you type in any .com site (you can type in the www. and even the http:// if you like however it's not necessary) then it will first search through my database of custom built sites for a match. If it fails to find any in-game site then it will then attempt to pull the site from the real internet. The advantages of this is I can build small sites that fully interact with the game without having register a load domains and possibly additional web hosting. Instead because it's all in-game then I can get away with hijacking any web address. I have created a site called notepad.com where a player can store notes on anything they want in-game, such as information that is rarely displayed (such as weapon carried or players stats) and save it. Now there is probably a real notepad.com but it is my site that will be displayed instead. However should the player type in google.com then it will display the real google.com site. This is what I mean by taking things further with the right amount of imagination. I've never seen anything like this on any other game (so far) and I even use an email site in-game for the messaging system. Anyone else here taken things a little further and pushed the boundaries? I'd love to hear about it.
  13. I've found that it's just as much the site design that attracts people as the content itself. What's the point in having all that content if it's difficult to navigate your way through it all. Your site is very well laid out, although the blue colour you have used for the border reminds me of windows 95 a bit, not an experience I would ever put myself through again lol Overall it's a well formatted site, easy to navigate and doesn't overload the user with information on the initial page. I think you should perhaps change the blue to a more calming green, say a shade such as #00CC66. Maybe even make the border as seperate images and have a gradient leading to white on all sides so it looks like the border is fading in to the page background. Also, the initial thing that got me when the site first loaded was the image of a tropical island. It did grow on me in the end but it was just the first time I didn't expect to see a tropical island image on a website about hypnotherapy. Good design overall, well done!
  14. Well now you're used to the xammp environment and how the different servers work, I would say it's time to get rid of it and start installing your own servers such as apache, php and mysql. xammp is really only designed for complete novices and isn't used by anyone who can call themselves a professional. Once you have succesfully setup and configured your own servers you too will be well on your way to becoming a pro!
  15. I never had a good experience with any free web hosts for a long time. Eventually the best I could find was byethost, they offered free php and mysql support and registering directly with the main host instead of one of their reseller accounts meant the pages were ad-free (except if you clicked an invalid link, then it would redirect to a different site). One of the major downfalls of byethost though I later found out was, if you are a free member you cannot put ANY flash objects embedded on a page, if you did then when ever you tried to call the page it would just redirect you to another site again. I'm building up myCENTS on here now so I can try out the basic hosting package, and hopefully it will be better than any other web hosts i've tried in the past!
  16. I use this script in most of my sites and find it to be a very reliable yet simple to implement at the same time. Ill run you through how the script works and also how to implement it. First this is a seperate php file from which ever one you want to add the image verification to. This should remain as is and not be modified with any additional code. randomImage.php // First start the session session_start(); // Next we test if the form has been submitted or not if (isset($_POST['Submit'])){ // Now we test to see if the users entered image code matches the real image if (md5($_POST['ranval']) == $_SESSION['ranval']){ // If the entered code matches go to success page header('Location: success.htm'); exit; } else { // If the entered code was incorrect go to wrong code page header('Location: wrong.htm'); exit; } } <*form id="form1" name="form1" method="post" action=""> Enter Image Code: <*input name="ranval" id="ranval" size="5" maxlength="5" type="text"> <*img src="randomImage.php" align="absmiddle" height="30" width="60"> <*input name="Submit" value="Submit" type="submit"> PLEASE REMEMBER TO REMOVE THE FOUR *'s FROM THE HTML TAGS, I HAD TO PUT THEM IN SO THEY WOULDN'T DISPLAY AS ACTUAL PAGE ELEMENTS! Now this is an example php file which the image will appear on. If you copy and paste the code in to a new php file you can call it what ever you like. The first part is commented so you know what each section does in the code, this will only run IF the form has been submitted. The rest is the html. There is a form with a box for entering the code and an image, however note the source of the image is our randomImage.php and not a jpg or whatever. When we call the randomImage.php file we are also writing the value of the images code to the session, however to ensure that nobody is monitoring the site traffic it is md5 encrypted before writing to the session. Now when we enter the code and submit it, the code we entered is md5 encrypted and then compared to md5 encrypted session variable, if it matches you are redirected to the success page, if not then you are redirected to the incorrect page. You can have any code run in the event of success or failure, such as a login page or so on, this is just a secure little add-on to prevent people from either brute forcing a password or bots from creating new accounts automatically. Enjoy!
  17. actually it was the .co.cc site that you have to pay for after a years free subscription
  18. If you're using a crossover cable then the signal will degrade rapidly over the line if it is close to any other networking equipment. The nature of the corssover cable makes it vulnerable to unwanted network chatter on the line. Same with CAT5 cables as well. If you aren't using a crossover or CAT5 and are just using a standard ethernet cable then maybe try updating the firmware? Possibly even just replacing the firmware. I would recommend using http://www.dd-wrt.com/site/index
  19. This is the whole reason I don't play games like World of Warcraft. Apparently you can become so addicted it takes over your whole life. I tried it once and it was fun, but a little too much fun if you ask me. It's the same with second life and guild wars, it's pointless living a fake life i think, why not just enjoy your real life instead of pretending to be someone you're not? Or maybe that's what attracts so many people!
  20. Yeah I went with .co.cc one for a while but it's got a limited time on it apparently. I had a years free registration then it asked me to pay after that. So not entirely free.
  21. I've been using FPS Creator for a few years, definately worth learning. You can make an fps game right away if you want without any learning what so ever, or you can start studying the scripting language, make your own models and media etc. and really make a high quality game, if I were you I would go for it and get this software!
  22. Right I understand what you are saying. First of all just use the basic PHP send mail function, no need for phpmailer, however if you still want to use it then you will need to include the OpenSSL extension in your php installation. The reason the basic php send mail function won't work is because you need an smtp server running in the background. Download the free one from here http://www.softstack.com/freesmtp.html. Simply open the software and there you go, you don't need to do anything else. Now you can use the php send mail function easily using port 25! Now if you REALLY want to use phpmailer after that then here's a tutorial I wrote about 2 years ago for another site that might help you out with learning how the software works and how it's configured, however if you're one of these people that want it quick and easy and don't want to bother learning then I suggest you ignore the tutorial. Creating and Using a Site Configuration File One of the things I like to do when I build a site is to create a configuration file that handles miscellaneous settings that I may need over and over again. So, I create a file called config.php in /home/mywebsite/public_html/config.php and I set it up with an array called $site with my keys and values the settings I use in the site. In this tutorial, I will cover how to define some settings we will use for the PHPMailer extender class. Here’s a view of my configuration file: config.php <?php // Configuration settings for My Site // Email Settings $site['from_name'] = 'My Name'; // from email name $site['from_email'] = 'email@mywebsite.com'; // from email address // Just in case we need to relay to a different server, // provide an option to use external mail server. $site['smtp_mode'] = 'disabled'; // enabled or disabled $site['smtp_host'] = null; $site['smtp_port'] = null; $site['smtp_username'] = null; ?>The previous example should be very self explanatory, so we’ll move on and cover those settings later on when we start to use them. The PHPMailer Extender Class First, I want to emphasize, you do not need to create an extender class, but to make life easier for us, I’m going to show you how to anyways. The extender class will basically call the PHPMailer() class and then setup the basic values for you such as the Email address you want to send from, mail server settings and etc. Each of these settings are inherited by the config.php by default, but you may also overwrite them when you call our extender class. For example, if you do not define the settings in the extender class, they will be set by default and this in turn, allows you to setup the basic values without actually going through the motions every time. That’s the beauty of it! Here’s a look at our extender class: MailClass.inc <?php require_once($_SERVER['DOCUMENT_ROOT'].'/lib/phpmailer/class.phpmailer.php'); class FreakMailer extends PHPMailer { var $priority = 3; var $to_name; var $to_email; var $From = null; var $FromName = null; var $Sender = null; function FreakMailer() { global $site; // Comes from config.php $site array if($site['smtp_mode'] == 'enabled') { $this->Host = $site['smtp_host']; $this->Port = $site['smtp_port']; if($site['smtp_username'] != '') { $this->SMTPAuth = true; $this->Username = $site['smtp_username']; $this->Password = $site['smtp_password']; } $this->Mailer = "smtp"; } if(!$this->From) { $this->From = $site['from_email']; } if(!$this->FromName) { $this-> FromName = $site['from_name']; } if(!$this->Sender) { $this->Sender = $site['from_email']; } $this->Priority = $this->priority; } } ?> The PHP Mail Class FreakMailer Class Code Breakdown The FreakMailer class previously displayed is pretty simple. You only need a very basic understanding of Object Oriented Programming to use it, so let’s break it down now. First, we are going to call the class.phpmailer.php file from within our phpmailer lib directory under the document root. This allows us to extend the PHPMailer class because it makes that object available. You could include this elsewhere, but this is a good place to do so. require_once($_SERVER['DOCUMENT_ROOT'].'/lib/phpmailer/class.phpmailer.php');Class Control Structure Next, we define the class control structure and give our new class a name while extending the PHPMailer class. class FreakMailer extends PHPMailer {Class VariablesMoving along, we now setup the internal variables. Most of these are set to null by default so that we can do some triggering later on to determine if you want to overwrite the default values from the config.php file.var $priority = 3; var $to_name; var $to_email; var $From = null; var $FromName = null; var $Sender = null; Let’s take a look at these values now: * $priority – This sets the mail priority by default. Values: 1 = High, 3 = Normal, 5 = Low * $to_name – This is the name of the person you are sending to * $to_email – The E-Mail address of the person you are sending to * $From – The E-Mail address you want to send from * $FromName – The Name of the sender. Now that we have those variables defined, we can discuss the FreakMailer() function FreakMailer() Function This is the function that basically sets up the default values for the PHPMailer to send E-Mail with. In other words, it’s the whole reason we are using this class. First, we call the $site array from our config.php so that it can be used within this function and class. There are a couple of ways we can do this, we could point to it from outside of the class, or we can just global it. Using the global call is the easiest method and it works, so let’s just do that! function FreakMailer() { global $site; // Comes from config.php $site arrayNext, we start the bulk of the operations here and start passing in values to the PHPMailer class. There’s not much to explain here, if the internal value ($this->setting) of the setting is not defined after you instantiate the class, it basically calls it from the config.php and we’ll use that instead. I mentioned earlier that you can override the values in the config.php and this is where those checks come into play. if($site['smtp_mode'] == 'enabled') { $this->Host = $site['smtp_host']; $this->Port = $site['smtp_port']; if($site['smtp_username']) { $this->SMTPAuth = true; $this->Username = $site['smtp_username']; $this->Password = $site['smtp_password']; } $this->Mailer = "smtp"; } if(!$this->From) { $this->From = $site['from_email']; } if(!$this->FromName) { $this->FromName = $site['from_name']; } if(!$this->Sender) { $this->Sender = $site['from_email']; } $this->Priority = $this->priority; } The most important thing you need to understand is that all of the functionality in the PHPMailer is still present and can be used even though we’ve extended the class. The only thing we’ve done here is created an extension (hence extends) that takes care of the repetitive stuff we don’t want to do every time we need to send an E-Mail Now that we have a good understanding of the extender class, let’s move along and start sending some E-Mail! Sending E-Mail with PHP Sending E-Mail with PHPMailer We’ve done our work and we’ve got everything ready to go to start sending E-Mail with PHPMailer. Let’s give it a go and see how everything works! Basic Test This test is very important to this tutorial because we will be referring to this basic test code throughout the tutorial when I show you how to use different features with PHPMailer. If this test does not work for you, read through the tutorial again and keep trying until it does work, othewise you will be lost later on! Our first code example is going to be a file looks like this: <?php // Grab our config settings require_once($_SERVER['DOCUMENT_ROOT'].'/config.php'); // Grab the FreakMailer class require_once($_SERVER['DOCUMENT_ROOT'].'/lib/MailClass.inc'); // instantiate the class $mailer = new FreakMailer(); // Set the subject $mailer->Subject = 'This is a test'; // Body $mailer->Body = 'This is a test of my mail system!'; // Add an address to send to. $mailer->AddAddress('foo@host.com', 'Eric Rosebrock'); if(!$mailer->Send()) { echo 'There was a problem sending this mail!'; } else { echo 'Mail sent!'; } $mailer->ClearAddresses(); $mailer->ClearAttachments(); ?> Let’s break down this file so that we have a good understanding of what it does. First, we are going to include our config.php file within the Document Root so that we have the $site settings available. // Grab our config settings require_once($_SERVER['DOCUMENT_ROOT'].'/config.php'); You could do this next step within the config.php file, but to make things easier, I chose not to. // Grab the FreakMailer class require_once($_SERVER['DOCUMENT_ROOT'].'/lib/MailClass.inc'); Next, we are going to call up our FreakMailer class and when we do this, we’ll also initialize the PHPMailer class as well by the extends definition in the FreakMailer class. // instantiate the class $mailer = new FreakMailer(); Ok, so now we have PHPMailer ready to go with all of our default settings, let’s go ahead and define a subject: // Set the subject $mailer->Subject = 'This is a test'; Now let’s define the body of the message: // Body $mailer->Body = 'This is a test of my mail system!'; NOTE: If you are using plain text E-Mail, which is the default, you need to convert new lines by using \n or \r\n and you should use double quotes in the strings such as $mailer->Body. Otherwise for single quotes you can start your string and type it out however you want it in your PHP script and press <ENTER> for each new line you wish to make and when you are done with your string, just end it with the semicolon like normal. Now, add an address to send to. The AddAddress accepts two inputs. The first is the E-mail address to send to and the second is the Name of the person you are sending to. // Add an address to send to. $mailer->AddAddress('foo@host.com', 'Eric Rosebrock'); Next, we send the message and look for an error: if(!$mailer->Send()) { echo 'There was a problem sending this mail!'; } else { echo 'Mail sent!'; } Obviously, if an error is detected, you will see There was a problem sending this mail!, otherwise you will see: Mail sent! Finally, we will clear the attatchment list and the Address list. This is primarily for sending Mailing lists, but I do it anyways as a (bad?) habit. $mailer->ClearAddresses(); $mailer->ClearAttachments(); ?> If you have just sent yourself an E-Mail with PHPMailer, then congratulations, you’re on your way to sending E-Mail with PHP the easy way! Common Problems Here’s a list of some common problems you may have with sending E-Mail through PHPMailer (these problems would probably be the same with the standard mail() function as well.). * No SMTP server Running on the local machine – You need some type of SMTP server running! * Improper setup of the PHP script – Please review through the tutorial again until it works. * The Apache Web Server is not allowed to relay through the SMTP server on the local machine (typical with some web hosts). * You did not define the recipient properly. Now this is only the beginning of the tutorial but you should get a better understanding of how phpmailer works and be able to carry on with some of the more advanced functions afterwards!
  23. This whole post was just ripped off another website! In fact it appears to be ripped from four seperate websites!
  24. If you want to make FPS (First Person Shooter) games then I suggest FPS Creator It's great for novices and amazing for advanced users. I use this quite a lot and have released several games myself. I've also released quite a few model packs on the forums which have proven to be very popular, the best probably being a complete pool hall set, including the segments used to make the building itself. There are tonnes of free models, loads of pre-made model packs you can buy from the company or you can just make everything yourself. To quote the about page on the main site: Over three years in development FPS Creator sets a new benchmark in the game creation market by providing an easy-to-use yet highly flexible editing environment. As its name implies this is a tool for creating action-packed FPS games with no programming or 3D modelling knowledge required. Using an intuitive and visual Windows interface you literally paint your game world into the scene. A vast range of 3D elements are included allowing you to paint hallways, corridors, gantries, walls, doors, access tunnels, ceilings, lifts, transporters, stairs and more. Segments intelligently attach themselves to each other - paint two corridor pieces side-by-side and they'll snap together seamlessly. Switch to 3D mode and you drop in on your scene for pixel perfect placement of 3D entities. Place a light-switch on the wall and it'll intelligently control the dynamic lighting in the room. Key Features * Create First Person Shooter games quickly and easily * Use intelligent building blocks to create game levels * No programming necessary * Open design allows for endless possibilities * Import your own media (sounds, 3D models, textures, shaders) * One click and FPS Creator builds you a final stand alone exe file * 3D Engine supporting Direct X9.0c * Virtually every single aspect of the game is controlled via script files you can edit * 90+ page manual, fully searchable and printer ready in PDF format Hundreds of 3D Objects included We appreciate that not everyone has the skill to create their own 3D content before starting to build a game - which is why FPS Creator comes with two theme packs: Sci-fi and World War 2. There are over 300 segment building blocks included, over 500 entity objects (such as desk lamps, health packs, crates), 62 different fully animated enemies, 36 weapons and 66 different AI scripts to control them all. The manual also includes guides on importing your own media to create prefabs, weapons, segments and entities. You don't have to use the 3D objects we have given you, adding your own is quick and easy. Changing the textures the models use is just as painless, so you could take one of the supplied barrel models and re-texture it to create any number of them all in your own style. More Features * Fully Windows based editing environment * Complete Physics System under your control * Internet and LAN Death Match style games supported * Classic FPS game experience * Create multi-level games (up to 50 levels) * Visual Waypoint editing, enemies can follow multiple waypoints * Built-in game optimisation profiler analyses frame rates, poly counts and more * Easy editing of game element's settings * Game elements include, weapons, ammo, enemies, picks ups, lifts, teleports, ladders, trigger points * Game menu editing facilities * Pick up weapons from dead enemies * Optional Pixel shader support * AI scripting language for total freedom to customise * Set texture quality and effect levels * Cube mapping effects * Automatic 3D Universe construction * PVS - Portal visibility system (for fast rendering of scenes) * Automatic Light Mapping (quick and full) * Small game files are easily swapped * Map segments "click together" - you can literally draw your levels * Dynamic and Static lights illuminate your game * Animated decals for fire, smoke, water, blood splats, etc * Keyboard short-cuts to most popular commands for fast development * Players can hold up to 9 different weapons at once * Guns include optional sniper zoom mode * Crouch, Run, Lean left / right, Jump and full mouse-look available I LOVE this software tonnes, and when I bought it there was a special offer on (not sure if its still on now though) where I paid $20 for the software (which they mailed to me) and I got the first 7 model packs for free too. You REALLY need to try this software out if you're wanting to get in to game design!
  25. 1. The Warriors 2. Hitman 2 3. Aces of the Deep 4. Master of Orion 2 5. Dungeon Keeper 2 6. Theme Park 7. Theme Hospital 8. Duke Nukem (ALL OF THEM!!!) 9. Goldeneye (N64) 10. Grand Theft Auto (ALL OF THEM!!!) 11. Medal of Honour: Heroes 2 (Wii Online, I dominated everyone) 12. Resident Evil (ALL OF THEM!!!) 13. Metal Gear Solid (yet again, ALL OF THEM!!!) 14. Worms (*sigh* ALL Of them...) 15. The Godfather 16. Dune (Both the originals) 17. Streets of Rage 18. Tekken (All) 19. Soul Calibur (2 & 3) 20. Halo (All) 21. Kane & Lynch 22. Splinter Cell (All) 23. Shining Force (Both) And so many more, i'm kinda an old skool gamer!
×
×
  • 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.