Jump to content

oni-kun

Members
  • Posts

    1,984
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by oni-kun

  1. Normally only echo would allow that construct. This would come up as an 'unexpected instanceof, AND, OR.. ' error instead.
  2. You're attempting to place a for loop into a variable, this obviously would run into errors. Assign the variable previously, and add the result into your $message variable after.
  3. Yes, try changing it to utf8_unicode_ci and see what happens.
  4. Is your table charset set as utf-8? You may want to use utf8_encode on the string before it is placed into the database.
  5. It's generally a good idea to read up on the manual, as they provide samples and useful user contributed comments which are relevant to many problems. Here is a very simple example: function myFunction ($display, $bold=false) { if ($bold == true) { echo "<b>" . $display . "</b>"; } else { echo $display; } } myFunction ('This is a string! '); myFunction ('This is a bold string' , true);
  6. What is the need for this, and are you sure you cannot use a database or a single file to log all entries? You can check of the file exists with glob but you will need to iterate through EVERY possible file, which I don't see a point in even attempting to write unless you have a better explaination on what you're trying to accomplish.
  7. A signed integer, 2147483647 will be the W2K38 bug. Lets leave the problem for our children to deal with.
  8. "extract($row);" It is not recommended to use this function, you're working on something way to complex for what you need to do.. I suppose we all go there at times, Anywho, happy birthday!
  9. He's serializing it. Why do you want to shove an array in the database that is unformatted? You'd break the array up or assign a pointer to each one,.
  10. It purely is based on: Your code Your server As you only have access to your server, and we don't to your code, It's very hard to answer why something 'sometimes' fails.
  11. oni-kun

    Guestbook

    EXACTLY. I have tried looking for tutorial and man no luck, I'm guessing it has to search mysql and some other stuff, if you can point me to a tutorial to achieve something similar that'd be great There's this a magic site called Magic Tutorial Land Where It Is All Written For You. Hell, even this site has a good tutorial written up: http://www.phpfreaks.com/tutorial/basic-pagination EDIT: Thorpe beat me to it by 3 seconds.
  12. Why not test something simple out? //Define array to serialize $var[0] = 'hello'; $var[1] = 2; $var[2] = PHP_EOL; $vars = serialize($var); //a:3:{i:0;s:5:"hello";i:1;i:2;i:2;s:2:" ";} echo "<pre>"; //Formatting for print_r; $newarray = unserialize($vars); echo print_r($newarray); //show what the unserialized result is. Which returns: Array ( [0] => hello [1] => 2 [2] => ) It'd be useful to read up on serialize before implementing it. You should always read methods and their possible security problems.
  13. Turn error reporting to strict at the top of your page, and it will list the deprecation error: ini_set("display_errors", "1"); error_reporting(E_STRICT); You can as well with error reporting write the errors to log.
  14. If you turn error reporting on, I'm sure the blank pages will be filled with errors. <?php ini_set ("display_errors", "1"); error_reporting(E_ALL); ?> Make sure the <?php tags aren't nested, if you place that on the top of the php file you edited, we should have a better idea of what is going on!
  15. I posted a simple, commented and proper practise of programming that is taught by the manual, you posted a compressed, shortcutted code that returns a PHP warning. How is that helpful to the OP? Clearly not from a good source.
  16. You've not posted any PHP code, so this is hardly a PHP question. Which file have you updated/modified? It would help to know this, as from what I can see that code is fine (and even if it weren't, it'd still show in source which it doesn't.) Documentation is there for a reason if you need to modify something.
  17. Your mres() is really just an alias the way you put it, albeit it does look better to type a few hundred times than the former. A good example if they need to run multiple checks such as simple validation.
  18. I'd have to say your explanation of code is hardly worth noting, as you're taking my code and compressing it into something E_STRICT would throw an warning on. Shorter = better?
  19. Almost all servers require the PHP code to be: [*]Within <?php ?> tags [*]Within a .php exension, NOT .html Also, It'd be much easier if you show us your current code you're working on in case you're making some obvious errors (this is a fairly straightforward project you're doing, so it's most likely an error there), just place them within tags.
  20. And there's your problem. You cannot output anything before a header() is called. As sending a header after the content is already pushed is invalid. This should work provided nothing else is being included before the <?php. <?php $ref=$_SERVER['HTTP_REFERER']; header('refresh:4;url='.$ref); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> </body> </html>
  21. You cannot expect data to change by modifying a function name. In this case, *_id is a function to return the primitive incremental ID, The username is data within a table, Nothing to do with a function.
  22. IE has a thing of not liking badly conformed CSS. And you cannot edit your posts after 20 minutes, as pressing 'submit' should be final.
  23. And just remember that HTTP referrers are not to be relied upon, as they are sent by the client and often left out, so it'd be wise to leave a ' if you are not redirected automatically, please press back on your browser' message.
  24. Why are you taking his wording so literal?
×
×
  • 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.