Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. It's the MySQL DATE field format. You shouldn't be trying to change it. You can change the format of a date for presentation with the aforementioned DATE_FORMAT() function
  2. Well, a unix timestamp is the number of seconds since the unix epoch - 1st January 1970. Since this is an integer, you can compare dates easily. The php function time() returns a unix timestamp, and you can convert other dates either with mktime() or strtotime(). You can convert MySQL dates with the UNIX_TIMESTAMP() function.
  3. Still slightly lost - cant you just set the action to "yourpage.php?number=<?php echo $number; ?>" ?
  4. You could explode by the the slash: $date = "09/15/2008"; list($amonth,$aday,$ayear) = explode('/',$date); If you're selecting from MySQL, you could also use the function DATE_FORMAT. See here for more on that. It's a new one for me that you can compare dates by having them in that order; i would have suggested converting to a unix timestamp.
  5. Well, you're writing with this line: fwrite ($fp, $text); However, $text is undefined. Therefore, nothing is getting written to the file. I can't help you further without seeing more of your code. I suspect that either you need to pass $text to the function or that $text is supposed to be $name or $title.
  6. To be fair, it doesn't really sound like it. What have you done so far? Do you have any knowledge of PHP?
  7. Try posting over in the freelance board if you want something done for you. This place is for getting help with something you're trying to do yourself.
  8. Global variables, odd logic, weird HTML comments etc. Dont get me wrong, if this is something you've written yourself as you're learning, then don't worry about that. My point was that it would not be good code to be learning from.
  9. How on earth does mod_rewrite have anything to do with what page you are on?
  10. If that's the code from the book, i suggest you buy a different one. It's terrible. As for the problem, $guess is undefined. You need to take it out of the $_POST superglobal first: $guess = $_POST['guess'];
  11. Any information like that is contained within the $_SERVER superglobal. Try taking a look at it: echo '<pre>'.print_r($_SERVER,1).'</pre>';
  12. Including or requiring files has nothing to do with variable scope. When you include/require it is as if the code in the included/require file was always present in the file that is doing the including/requiring.
  13. I would suggest you start with some basic AJAX tutorials. If you google, you'll find plenty.
  14. I'm not sure I entirely follow your question, but yes, it is possible to have information passed with both GET and POST in the same request. For example, it's entirely reasonable to have the action of a form with the POST method contain variables. That is, file.php?id=4 is a valid action, regardless of the method.
  15. How about showing us what you tried then?
  16. You just need to retrieve the variable from the GET array. For example, if you're URL is: http://www.example.com/page.php?id=1&foo=bar then you can do this: $id = $_GET['id']; echo $id;//echos 1 $foo = $_GET['foo']; echo $foo;//echos bar Of course, you'll need to sanitize the information you get from the URL, as it's provided by the user.
  17. What do you mean by 'it fails on is_uploaded_file2()' ? Do you get any error messages? What actually happens? On a sidenote, this isn't a valid way of checking if the form's been submitted: if(isset($_POST)) That will always return true, since the superglobal arrays are always defined, regardless of if there's anything in them or not. Try using: if(count($_POST) > 0) Oh, and it'd really help if you indented your code properly.
  18. I've only scanned the above posts, but sounds like you need the IN clause. For example: $array = array('tom','dick','harry'); $sql = "SELECT * FROM yourtable WHERE name IN '".join("','",$array)."' ORDER by...";
  19. Though, if the group happens to be the team behind IE, it might be acceptable...
  20. Store the characters in an array rather than a separate variable. Otherwise you have to keep track of how many variables you've created and it gets clumsy. $str = '5j39n2'; $c = array(); for($x=0;$x<strlen($str);$x++){ $c[] = $str[$x]; } echo '<pre>'.print_r($c,1).'</pre>'; Edit: Or, if you're using PHP 5, there's a function to do it for you: $str = '5j39n2'; $c = str_split($str); echo '<pre>'.print_r($c,1).'</pre>';
  21. Are you not using a database to store the posts?
  22. You should be calling the functions when you output the data. Generally, you should store data in it's original format. Consider what happens when people wish to edit their posts - if you make the replacements before you put the data in the database, you'll have to reverse those replacements before the user could edit their posts. As for which to call, it looks like you should call the bbcode_format() function first, followed by the bbcode_quote() function.
  23. What do you mean? You want the number of elements in the array? Use count()
×
×
  • 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.