Jump to content

oni-kun

Members
  • Posts

    1,984
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by oni-kun

  1. .. How about use CURL and set timeout to 5-10 seconds? If the result of the CURL function is a timeout, you can choose whatever you wish to display. Is this what you wanted?
  2. The same as ||. Nope. 3 || 4, OR. 3 && 3, AND. So I'd recommend switching the || to an AND unless you want zero-length e-mails to boot.
  3. Previous poster was right: <?php include “connection.php” Should be: <?php include "connection.php";
  4. Good catch. code tags are helpful no? But yeah, OP, this is a major reason why coding should only be done in notepad/and IDE. As well as copying code, There's a chance an entity such as a starting quote, which isn't recognized by PHP will happen.
  5. We'll need to know what you are running and your code that shows you the blank page (place in code tags). Once we know this we can help you better, but my guess is you're using short tags (i.e. '<?') instead of '<?php'
  6. yes please how can i do that? Easy and fun..:' <?php $rand = rand(1,3); //For random selection if ($rand == "1") { header( 'Location: http://www.site1.com/new_page.html' ) ; } elseif ($rand == "2") { header( 'Location: http://www.site2.com/new_page.html' ) ; } else { header( 'Location: http://www.site3.com/new_page.html' ) ; } ?> Simple enough, eh?
  7. NEver thought of something so simple, thanks for making me do the work myself!
  8. There's no hex2bin function so I wrote one myself, It's correct but in the conversion it appends 'b000000' when going back into hex. I saw this is normal, but how do I remove it IF it exists? A normal result would be "732b4a4d5528c948552828ca2ccecf4b2d2a06000b000000"
  9. What I'd recommend is adding them to the session through a simpler manner (such as what forumforme123 states) $_SESSION['commented_ids'] += "," . $_SESSION['last_idcommented']; Or something similar, then you can use explode in a loop, to find what ID's they commented on disallowing it. "123, 22, 411" would result, as a string of ID's they've commented on.
  10. You know he's saying that because he wants attention. It's sad, that he puts that much thought into stating he's leaving when he 'doesn't care' about the rules or volunteering staff. It's a free forum, go pay $1000+ for someone to do 'hard work' when you can learn it from here and go sob.
  11. Yes, you can very slowly do this by sending headers and connecting via SSL, outputting contents into a frame or similar. But you say refresh, you can maybe do this better in AJAX, you can handle cookies easier that way. Not sure what you exactly want to do with the connection, so I can't really say anymore.
  12. I did the full mod_rewrite for you there, if the first method doesn't work (second redirects any part of the domain to work better) so you have no need to write it yourself, but yeah, It should work. What they do, is it tells the server to send a 301 (redirection) code to the client telling them to go to the secondary domain. This is more serverside rather than just telling the client to go somewhere else, so it can't be a blank page like you saw before.
  13. I forgot. You can leave out the html page all together and just use this. Clear out your .htaccess file or append this line, but it'll be a more compatible method of redirection: Simple: redirect 301 / http://junco-cheep.seesaa.net/ Or.. Using mod_rewrite (try this instead of simple method.): RewriteCond %{HTTP_HOST} ^(www\.)?discoverymusic\.jp [NC] RewriteRule ^(.*)$ http://junco-cheep.seesaa.net/$1 [R=301,L] Do those work?
  14. That's telling the server to forcefully open index.html. I haven't a clue why you need to enter it after typing that. Try removing index.html and .htaccess and just create a new index.php with the redirection code, There's nothing you're doing that should warrant having to physically enter it, I'm not sure how your server is set up.
  15. Then try this as your .htaccess: DirectoryIndex index.html AddType application/x-httpd-php .inc .html The addtype simply allows parsing of PHP code in a .html document.. in case you did not know.
  16. .htm? Add a .htaccess entry to force the index.htm file as the default opened page. DirectoryIndex index.htm Also, Most browsers will fail to read the header if it's not capitalized and in RFC format. header('Location: http://junco-cheep.seesaa.net/'); Once you place the .htaccess in root of www.discoverymusic.jp it should work fine.
  17. What on earth are you trying to accomplish? I'm not sure what you're doing. You're echoing an image into an action tag? Action was meant to link to something that processes a form, or a JS action. If you're wanting to input data into the image, than action should = $_SERVER['PHP_SELF']; and there should be <input/> tags for each data entry.
  18. oni-kun

    Classes

    Are you able to instantiate and use sessions? That will fix your problem with the login form. What I'd recommend is sending them to a login page if say, $_SESSION['user_id'] is not set, And you don't need to write public functions to echo a form, it's a waste of server processing time than to just fit it in an IF statement. And yes, you can include/require any file of PHP or HTML to set up a more simple template system.
  19. Huh. Anyway, Telnet your mail server. Usually mail/smtp.yourdomain.com with port 25. If this is unreachable, than I doubt you can e-mail from it. This is the only way you can physically send an e-mail, without using a third party SMTP host.
  20. $Result will almost always not be (string)'1', and be (boolean)1. The previous code that mrMarcus stated should be more correct, although I'd use this to nullify the other possibilities: <?php IF ($Result1) { echo '<script language="JavaScript" type="text/javascript">alert("Record created into database")</script>'; } ELSE { echo '<script language="JavaScript" type="text/javascript">alert("'.mysql_error().'")</script>'; } ?>
  21. You can use trim or rtrim to strip out any NULL characters (Very most likely the characters you're running to) at the end or beginning of your string, such as if there's padding involved. \0 = null if you want to use str_replace. Depends where they are exactly, but as well you should convert the result to unicode with utf_encode so the stream won't mess up..
  22. You should have everything UTF-8. Try adding this to your meta tags, on the page you're trying to display the characters: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> Also, Make sure when you enter the characters in the first place, such as in a text editor etc.. It's UTF-8 and not another encoding, as this will cause incompatabilities. You can convert to UTF-8 using utf_encode or iconv I believe.. You may also need to set a header to tell it it's utf-8.. I just had to do that to allow them to be displayed, not much else really..
  23. I'm actually making an encryption as a project, I shift the string with a key and encode it in base64, apply salted blowfish and ECB Rijndael (with mcrypt() ). The result length is well over the length of the original string. Since my encryption is 'very strong' I'd like it to be shorter. Text is compressed normally like 1:25? And has a dictionary for inflation (or something) when you compress it using PKZIP or whatnot.. There has to be a way of displaying that end result, and letting me use it! Bin2Hex() shortens the stream, when it's compressed (no matter what 'level' I use of compression it's the same length), by about 20%.. Maybe that's just the way I have to do, not sure where to turn. Original: Free the prisoners Encrypted: --IEOt1L1RPsJiFWdTwxHv9iCztuZXpHH0dmoZf9Qqs3M=-- gzcompress/Bin2Hex: 732b4a4d5528c948552828ca2ccecf4b2d2a0600 I'm probably over my head!
  24. I'm writing my own encoding program basically, and even though it has some more things in it, basically the calculated/base64 encoded string is 50% larger than my original. This is alright, but i'd like the string to be smaller. I've used gzdeflate/gzcompress but it outputs bytes? so it can't be displayed by echoing it. Is there a possible way to compress the size of the text, and display it in a showable fasion? Maybe there's a way to show the actual bytes of the gzcompressed stream (bin2hex? somehow?) as long as it's shorter.. If you could help i'd be so incredibly greatful! <?php $compressed = gzdeflate('mtfPJtAkE0UVtWQMcP65HYIROavx5t4TD+o7YYZ8C8ICQ+y', 9); echo $compressed; //As bytes? some sort of string ? ?> Is pretty much what I use, I just don't know how to make it so it can copy, and not be as big as the base64 string..
×
×
  • 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.