Jump to content

Kryptix

Members
  • Posts

    283
  • Joined

  • Last visited

    Never

Everything posted by Kryptix

  1. Traffic 1 ø per hour Received 287 MiB 16 MiB Sent 1,058 MiB 58 MiB Total 1,345 MiB 74 MiB Connections ø per hour % max. concurrent connections 38 --- --- Failed attempts 7 0.00 k 0.02% Aborted 11 0.00 k 0.03% Total 36 k 2,005.65 100.00%
  2. This is happening very often, what could be causing it? I'm running XAMPP on Windows.
  3. Just enabled logging for SQL: Is it supposed to be doing that? After the server is up for a week or so the database fails to respond and the game closes down. Ideally it's needs a constant connection but I'm no expert. Anyone got any insight?
  4. I'm using just a simple mass e-mail command that loops through 35,000 e-mails but half of them fail or it completely times out. I've tried doing chunks but even 5,000 sometimes times out. How on earth do people mass e-mail 500,000 e-mails in one go flawlessly? I've heard you can add e-mails to the BCC field and have hundreds per one e-mail, meaning 35,000 e-mails would only really be 3,500. Is this true? If so, how many can you have per one e-mail and could someone give me an example? Is there any other tips or tricks?
  5. Solved: SELECT `a`.`username` AS 'sender', `b`.`username` AS `receiver` FROM `messages` JOIN `users` a ON `messages`.`sender` = `a`.`id` JOIN `users` b ON `messages`.`receiver` = `b`.`id`
  6. I think the best way is for you to give us 10-20 EXAMPLE inputs and the data you want to extract from them.
  7. Seems fine to me mate... You're only using one query anyway so there's not much the MySQL Help section can do, but the PHP seems fine also.
  8. Without seeing the code we don't know...
  9. Not really sure how to do this. Say for example you have a table with columns `sender` and `receiver` which are their ID from the users table. I need to do something like... SELECT `username` AS 'sender' FROM `messages` JOIN `users` ON `messages`.`sender` = `users`.`id` But how would I also obtain the receiver within the same query?
  10. Accidentally bumped this. I meant to edit the previous post saying what's been done, heh.
  11. I'm writing some highscores for a game and want to be able to highlight a user. SELECT * FROM `table` ORDER BY `rank` ASC LIMIT 0, 40 I want to basically start the listing from a specific user, so say for example I'm searching for user "Kryptix" I want to show 20 users above that highlighted user and 19 users below it. So what I'm asking is, within one query is it possible to LIMIT the query by getting the `rank` column of that user? Maybe something like this: SELECT * FROM `table` ORDER BY `rank` ASC LIMIT (SELECT `rank` FROM `table` WHERE `user` = 'Kryptix') - 20, 40
  12. Well, the following code works but the problem is, the text on the original site updates constantly using Ajax, so when the page is first loaded most of the text isn't there and the text that is there hasn't been updated to the correct information yet... I'm not sure how to grab text from another website that updates with Ajax to be honest. <?php $html = explode("\n", file_get_contents("http://www.n2yo.com/?s=24905")); $lines = array("Latitude:", "Longitude:"); foreach ($html as $data) { foreach ($lines as $string) { if (preg_match("\"" . $string . "\"", $data)) echo str_replace( " <td><font size=2>", "", str_replace( "</td><td><font size=2><B>", "", str_replace( "</B></td>", "", $data ) ) ) . "<br />"; } } ?> If you can find another source I can possibly help.
  13. It should be like: <?php if ($var == 1) { echo "Var equals 1"; } else if ($var == 2) { echo "Var equals 2"; } else { echo "Var doesn't equal 1 or 2"; } ?> So in short, it's "else if" and not "elseIF" Also, I'm not sure what you're doing with "else Media" <?php if (@$row_rsworksorders1['intratype'] == 1) { ?> Signworld <?php } else if (@$row_rsworksorders1['intratype'] == 2) { ?> Embroidaworld <?php } else { //Do something else } ?>
  14. Also using just the below will post back to the same page as well, but I believe you need action for it to be valid XHTML. <form method="post">
  15. You could use a function like file_get_contents() to put all the HTML into a string, such as: <?php $html = file_get_contents("http://www.phpfreaks.com"); ?> You can then split every line into an array by using explode() and loop through them looking for specific text: <?php $html = explode("\n", file_get_contents("http://www.phpfreaks.com")); foreach ($html as $data) { if (preg_match("/TEXT HERE/", $data)) echo $data; } ?> The pattern you use depends on the website you're grabbing data from. If you post the website you need to get text from and the exact text you need to grab I'll have a look.
  16. You could do the above in smaller code to: echo "<form method=\"post\" name=\"form\" action=\" . (($redirect) ? $redirect : $_SERVER['PHP_SELF']) . "\">";
  17. But why not send an e-mail per e-mail address? Is that bad?
  18. Why BCC? Can you really have unlimited BCC's and send it like that?
  19. Here's mine... Hopefully you can take the bits you need: <?php include "recaptcha.php"; if (isset($_POST['submit'])) { $username = trim($_POST['username']); $password = trim($_POST['password1']); $password2 = trim($_POST['password2']); $email = trim($_POST['email']); $captcha = recaptcha_check_answer ($privatekey, $_SERVER['REMOTE_ADDR'], $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field']); if ($password == NULL || $password2 == NULL || $email == NULL || $username == NULL) $error = "Please ensure that every field is complete."; else if (!$captcha->is_valid) $error = "The Captcha you entered was invalid. If you cannot read the text please click the refresh button. If you feel there's a problem with the Captcha system please <a href=\"mailto:support@rscemulation.net\">e-mail us</a> on: <a href=\"mailto:support@rscemulation.net\">support@rscemulation.net</a>"; else if (!preg_match("/^[a-zA-Z0-9 ]+$/", $username)) $error = "Your username can only contain numbers, letters and spaces."; else if (!preg_match("/^[a-zA-Z0-9 ]+$/", $password)) $error = "Your password can only contain numbers, letters and spaces."; else if ($password != $password2) $error = "Your passwords did not match. Please ensure they're the same."; else if (strlen($username) > 25 || strlen($username) < 2) $error = "Your username must be between 2 and 25 characters in length."; else if (strlen($password) > 16 || strlen($password) < 4) $error = "Your password must be between 4 and 16 characters in length."; else if (strlen($email) > 70 || strlen($email) < 10) $error = "Your e-mail must be between 10 and 70 characters in length."; else if (!preg_match("/^\b[A-Z0-9._-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}$\b/i", $email)) $error = "Your e-mail seems to be invalid."; else { ?>
  20. I need PHP to send a packet to a listening Java application. Could someone please give me an example on how to do this? I need to a function like: mutePlayer(USER_ID, DURATION, REASON) I've Google'd without much luck. Thanks.
  21. I validate e-mails but you can still generate errors, such as using a e-mail with the same domain and stuff. I'd sooner just hide the error in case I miss something and it displays an error. How would I do that?
  22. I'm making it so when a user signs up it e-mails them the details, but some users will enter a fake e-mail or something to cause an error, so how would I go about hiding all error messages from mail()? Also, is it wise to hide every error from everyone on a live site? I haven't really looked into it before.
×
×
  • 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.