Jump to content
MakeWebGames

Spudinski

Members
  • Posts

    1,731
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Spudinski

  1. Re: class mysql error in v2 Ok, when you connect to your website, but default it should put you in your directory, it should be shadow64456. In there there should be a folder called htdocs, where you should upload the class folder, if it doesn't want to create a directory, search in your FTP client for and option like "change permissions" or "chmod". Let me know if that works, also, which FTP client are you using?
  2. Re: class mysql error in v2 What are you using, an FTP client or cPanel? You should create a directory called class in the htdocs directory.
  3. Re: SQL Queries Oh, try it without the INDEX in the query, aslo check that the names are spelled correctly.
  4. Re: class mysql error in v2 Try setting the permissions of the htdocs directory, so that it is writable(w). If that doesn't work - then I suggest you ask/alert your hosting provider about this, they would know what to do better than anyone else.
  5. Re: SQL Queries Yes, that would do it.
  6. Re: SQL Queries Do you want to delete the bankcrystal2 column in the users table? If so, use this query: ALTER TABLE `users` FRP `bankcrystal2` Link: http://www.w3schools.com/sql/sql_drop.asp If not, please explain a bit more on what you want ot delete.
  7. Re: class mysql error in v2 There is nothing wrong with your code. Make sure you uploaded the class directory(with it's files) into the htdocs folder. The absolute(complete) path will be /www/10gbfreehost.com/s/h/a/shadow64456/htdocs/
  8. Re: class mysql error in v2 After going to your website - http://shadow64456.10gbfreehost.com - I cannot find the file class_db_mysql.php. Please re-upload the whole website, or just upload the class directory(with the file class_db_mysql.php). Edit You can use FTP to upload the files, or use your control panel, There should be an uplaod feature.
  9. Re: class mysql error in v2 Check what the permissions is on the file, make sure it is executable, as well as readable. To do this - in cpanel - click on the file, and look on the menu for permissions.
  10. Re: class mysql error in v2 Does the file class_db_mysql.php exist in the class folder? If not - just upload that(class) dir again.
  11. Since the ops thought this should be made, I'll talk about this topic. Email Validation is a common thing that is done on all/most signup pages, doesn't matter which website it may be. These types of scripts are not that hard to create, but most struggle to make it. Another thing with most email validation scripts is that it is inaccurate, you can enter something like [email protected] and it will return as a valid email address, here is a script just as that, feel free to check my theory(this is the fourth result from googling "Email validation PHP"). This is because of poor validation, normally something like the following is used in most validation scripts: ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $email) It is not only done in PHP, but also in Javascript, most people think that form validation with javascript is good, but they are just so wrong. I suggest reading this article if you already know how to develop in PHP, you can make your own then - http://www.ilovejackdaniels.com/php/ema ... alidation/ In this post, I will be giving examples of a few types of email validation script that can be used in PHP.   Example 1 This will look at the email address, split it up into a username, domain name and a suffix. <?php function validate_mail($address) { if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $address)) return false; else { $email_parts = explode('@', $address, 2); $domain_parts = explode('.', $email_parts[1]); for ($i = 0; $i < count($local_array); $i++) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { $returned = true; return false; } } if (empty($returned) && (ereg("^\[?[0-9\.]+\]?$", $email_parts[1]) || count($x = explode('.', $email_parts[1])) < 2)) { return false; } else { for ($i = 0; $i < count($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_parts[$i])) { $returned = true; return false; } } } if (empty($returned)) return true; } } ?>   Example 2 Doing a basic check if the email is valid, and then sending a email to the user, where they will find a link to activate their account. This is the long way around, and requires much more things to be done, like making an extra row in the user table(I'm going to skip the mysql parts).   <?php function valemail($address, $username, $password, $subject, $mail_message, $headers) { if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $address)) return false; else { if (empty($username) || empty($password)) return false; else { $mail = mail($address, $subject, $mail_message, $headers); if (!empty($mail)) return false; else return true; } } } ?> Using the function is very simple. You can use both of the examples together, to make an even more accurate validation, but it is optional. Here is a example for each of the two examples: Example 1 <?php if (!empty($_POST['address'])) { $headers = "From: [email][email protected][/email]ix <group youdomain>\r\nReply-to: [email][email protected][/email]ix\r\n"; $content = "Thank you for signing up at our website.\r\n In order for you to login to your account, you will first need to activate your account.\r\n\r\n Please verify that the following information is correct before you continue:\r\n Account: $username\r\n Password: $password\r\n \r\nIf all of the above information is correct, please continue by following the link below.\r\n $validate_link (<a href=\"$validate_link\">AOL</a>)\r\n\r\n If you did not create this account, please follow the link below.\r\n $suspend_link (<a href=\"$suspend_link\">AOL</a>)\r\n\r\n\r\n Regards,\r\n YourDomain"; $subject = 'Account Signup: ' . $username; $filename = $username . md5($address); $key = sha1($filename); $fp = fopen($dir . '/' . $key, 'w'); fputs($fp, base64_encode("INSERT INTO `users` (`id`, `name`, `email`, `password`) VALUES (NULL, '" . $username . "', '" . $address . "', '" . $password . "')")); fclose($fp); $result = valemail($_POST['address'], htmlspecialchars($_POST['name']), $_POST['password'], $subject, $content, $headers); if (empty($result)) echo 'We were unable to verify your email address.'; else echo 'We have sent an email to the address you specified, please review the message and follow the instructions.'; } else if (count($url = explode(':', $_SERVER['QUERY_STRING'])) == 2) { switch ($url[0]) { case 'act' : $result = valaccount($url[1]); if (strlen($key) != 32 || empty(file_exists($dir . '/' . $key))) { echo 'You have supplied an invalid activation key.'; } else { $fp = fopen($dir . '/' . $key, 'r'); $contents = ''; while(!feof($fp)) $contents .= fgets($fp, 1024); fclose($fp); unlink($dir . '/' . $key); $contents = base64_decode($contents); $split = explode('_.', $contents); if ($split[0] <= (time()-1800)) { echo 'Your activation has expired.'; } else { $query = mysql_query($split[1]); if (empty($query)) { echo 'Your account has been activated! You may no' . 'w proceed to the login page.'; } } } break; case 'spd' : unlink($dir . '/' . $key); break; default : echo 'Invalid request.'; break; } } else { echo ' <form method="post"> Name: <input name="name"> Password: <input name="password"> Email: <input name="address"> <input type="submit" value="validate"> </form></p>'; } ?>   If you have any questions, please reply to this thread. Edit: Updated functions.
  12. Re: Help!! bugs You just have to look around on the mccodes boards. Most of the time people post new bugs that they find in mccode there.
  13. Well, it's commonly asked upon the beginners, so I'll go a bit into this subject. Some people use javascript to do this, even if they have an PHP enabled web server, which is good, but it is not the only technique to do it. I will try to provide the best explanation over a few examples. Example 1 Making a select on an page, which lists all the flowers available at the shop. <?php // Just the normal select element echo '<select name="flowers" onchange="document.forms[0].post()">'; // The mysql query $sql_text = 'SELECT `id`, `name` FROM `flowers` ORDER BY `name` DESC'; // Execute the query $query = mysql_query($sql_text); // To solve a bug where you cannot select the first element echo '<option disabled="disabled">' . mysql_num_rows($sql_txt) . ' Flowers</option>'; // Loop trough the results while($flower = mysql_fetch_assoc($query)) { // Echo the results out into option elements echo '<option value="' . $flower['id'] . '">' . $flower['name'] . '</option>'; } // Close the select element echo '</select>'; ?>   Example 2 Displaying a list of item categories. <?php // Start the ul element echo '<ul>'; // The mysql query $sql_text = 'SELECT `cat_name` AS `name` FROM `categories` ORDER BY `cat_id`'; // Execute the mysql query $query = mysql_query($sql_text); // Loop trough the results while($cat = mysql_fetch_assoc($query)) // Echo out the category name echo '[*]' . $cat['name'] . ''; // Close the ul element echo '[/list]'; ?>   Example 3 Say you want to make something like a forum, and you need to display the categories and the boards within the categories. <?php // The query to retrieve the categories $cat_sql_text = 'SELECT `cat_name` AS `name`, `cat_id` AS `id` FROM `categories` ORDER BY `cat_id` DESC'; // Execute the mysql query $cat_query = mysql_query($cat_sql_text); // Loop trough the categories while($cat = mysql_fetch_assoc($cat_query)) {. // Make a table element, aswell as display the category name echo ' <table id="' . $cat['id'] . '"> <tr><th>[b]' . ucwords($cat['name']) . '[/b]</th></tr>'; // Get the boards from the category $board_sql_text = 'SELECT `board_name` AS `name`, `board_id` AS `id`, `board_description` AS `description`' . ' FROM `boards` WHERE `board_id` = \'' . $cat['id'] . '\''; // Execute the query $board_query = mysql_query($board_sql_text); // Loop trough the boards while ($board = mysql_fetch_assoc($board_query)) { // Display the board name, and description echo '<tr><td id="' . $board['id'] . '">' . '[b]' . $board['name'] . '[/b] ' . $board['description'] . '</td></tr>'; } // Close the table and paragraph elements echo '</table></p>'; } ?>   Hope this gives an idea of how to do this, if not - please reply to this thread with your question.
  14. Re: Change Your Mouse Problem with this is that it only works in Internet Explorer, which is recommended not to use. Opera, Firefox, etc. does not support this feature. On the other hand, most modern browsers does support built-in cursors. Check here which are the values: http://www.w3schools.com/CSS/pr_class_cursor.asp
  15. EDIT: I know it's not for lite, it's for ALL MCCodes versions. Don't patronize me. Ever wanted a way to get your players more active, whilst having them enjoying be there? Well this modification let's you do just that, a great Question and Answer games around! For the players: A countdown timer to get them really going. Advanced listing of the questions as well as answers after the questions. For the admins: Flexibility to add you own questions and answers. Viewing the current questions. Configure the amount of questions to be asked. Configure difficulty of the game. (4 Modes) Configure the amount of time allowed per question. But yea, as they say, I picture tells allot more than words, so here are some screen shots. Main Screen Busy Playing Admin Main Creating Questions Second Screen (For starting a game or viewing results) http://i290.photobucket.com/albums/ll264/_spudinski/screen_2.png Running out of time.. http://i290.photobucket.com/albums/ll264/_spudinski/screen_4.png Finished Game http://i290.photobucket.com/albums/ll264/_spudinski/screen_5.png Results Page http://i290.photobucket.com/albums/ll264/_spudinski/screen_6.png Viewing Questions http://i290.photobucket.com/albums/ll264/_spudinski/screen_8.png Viewing Raw Question and Answers Array http://i290.photobucket.com/albums/ll264/_spudinski/screen_10.png The script uses itself as the database for questions and answers. It uses no MySQL database whatsoever, so you will be able to play it on your own even. There is about ~30 questions with their answers already in there, they are beyond stupid, so feel free to change them. Installation Just copy the php code into a file called guesswho.php, and then just put a html link to it somewhere. See attachment The html link [url="http://www.mediafire.com/?6jpqvvxqxca7dyd"]Guess Who![/url]
  16. Re: [Free] MySQL Control Panel Added Table Show.   <span class="syntaxdefault">The message exceeds the maximum allowed length </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">20000 characters</span><span class="syntaxkeyword">). </span><span class="syntaxdefault"></span> See attachment.
  17. Re: House Break In [$15] I don't know about everyone else, but normally when problems are found in a certain script, I rely on the [b ]original[/b] creator of that script to repair the problems and send me an updated version. I surely would not spend 15 dollars(even though it's little), and buy something like this, it would just be useless. Anyone that thinks differently, please share your opinion.
  18. Re: Getting Template In Game!   body { background-color: #000000; background-image: url('images/background.jpg'); background-repeat: no-repeat; }
  19. Re: Getting Template In Game! Use tables, an then use CSS to style them. http://www.w3schools.com/html/default.asp
  20. Re: Getting Template In Game! This isn't PHP. http://www.w3schools.com/css/
  21. Re: [Free] MySQL Control Panel The new updated version looks pretty good.. It works for me, and it's secure. (:
  22. Re: Multi accounts, less proxys. Learn to stop it here Proxies normally has it's own cookie jar, thus making this useless. Anyone who really wants to, can bypass this very easily.
  23. Spudinski

    Optimize generation

    Re: Optimize generation Differnet hashing functions have different digest sizes. But I can see your point, no matter how long or short an hash is, it can be compared with another.
  24. Spudinski

    Optimize generation

    Re: Optimize generation Actually, the only ever successful attacks on AES was side-channel attacks. Without the key, any form of data encrypted with AES or Twofish (etc.) is nothing. If I have the wrong definition of collisions, pelase correct me. I'm not trying to implicate anyone here, and so I stand under correction.
  25. Spudinski

    Optimize generation

    Re: Optimize generation Nyna, Although I get your point here, I just want to say a few things. SHA1 isn't that new, neither MD5, they have been used evectivley for a couple of years now. But not so long ago, researchers found a flaw in the md5 algorithm, like two files could have the same md5 checksum. MD5 is just a very popular encryption, meaning that rainbow tables for it is very popular, but hte truth is that there are many SHA1 and SHA128 rainbow tables. Any further than that is used for files, or large quantities of data. With most of the applications I'm building now, I use very high encryption, the encryptions as the NSA, FBI, and even the military. They use encryptions such as Blowfish, Twofish and AES(Rijndael), it requires that you specify a key to encrypt and decrypt the data. That means that even if a malicious hacker gets hold of your encrypted passwords, they will not be able to do anything with it.
×
×
  • Create New...