Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. Before trying to use a variable, you need to make sure it exists and is set. if(isset($question)){ echo $question; }
  2. Ah, thanks Thorpe I guess I was wrong However, I don't want to download the manual, I want it to go directly to php.net. http://us3.php.net/manual/en/ref.errorfunc.php So I went ahead and did this: html_errors=1 docref_root=http://php.net/ But the errors look exactly the same. I also tried html_errors=1 docref_root="http://php.net/"
  3. Well if you post those errors and the lines of code they refer to, we can help.
  4. add this to the top of the page: ini_set('display_errors', 1); error_reporting(E_ALL);
  5. How would I go about changing the default error message for this type of error: Warning: Missing argument 2 for explode(), called in... All I want to do is make it print the url to the php.net documentation, so it will link to the function for me. Warning: Missing argument 2 for <a href="http://php.net/explode">explode()</a>, called in... I don't think this can be done with just regular error handling, so I figured I'd pop in here...Thanks
  6. Edit: woops. What was I thinking? Try this: echo '<form name="myForm" action="'.$_SERVER['PHP_SELF'].'" method="post">';
  7. http://us3.php.net/move_uploaded_file You rename it by passing the new file name.
  8. You never close your heredoc of EOTABLE Whoops, didn't preview
  9. You should use sessions here, not cookies.
  10. monk.e, I agree that user logins can be a bit tedious, but if you write all the code to train the dog, and then add in users and data persistance, you're just going to have to rewrite it.
  11. The forum messed up my post - if you actually read what I posted instead of just copying and pasting, you might have noticed that and figured that your code shouldn't say [/url] in it...
  12. Whenever you want to use quotes inside a string which is opened with those quotes, you must escape them. Invalid: print 'This isn't "that" bad!'; print "She said "Hi", didn't she?"; Valid: print 'This isn\'t "that" bad!'; print "She said \"Hi\", didn't she?"; You have to tell PHP that you mean the character " or ', and not the end of the string. For yours you should do: echo 'Welcome Guest, please <a href="register.php">register</a>'; Since there are no variables in it.
  13. Well when I started my game, it took me about 9 months. (six of which I really worked on it.) - but I had also been using PHP for awhile. It was pretty decent, ran for a year, I just recently shut it down to work on some other projects and a newer version. You might enter the competition going on right now for some practice.
  14. <?php function showWeek($startDay, $start=NULL){ if(!$start){ $start = time(); } while(date("w") != $startDay){ $start = $start-(60*60*24); } for($i=0; $i<7; $i++){ $date = mktime(0,0,0, date("m", $start), (date("d", $start)+$i), date("Y", $start)); print date("Y-m-d", $date).'<br />'; } } showWeek(1); ?> Should start on Monday. I made it a little more abstract for you.
  15. Jessica

    *hic*

    Posting was the cure - they are gone! Finally!
  16. The first time I read that I thought you said you WERE trying to get it running next week. Then I stopped laughing and read it again
  17. Jessica

    *hic*

    I've been hiccuping for 30 minutes now - help!
  18. Yes, you'll need to have a database to store all your user's info, as well as the dogs info, and other info. You might want to start with a smaller project honestly, but the first step for this is gonna be the user login like I said. There are some decent tutorials around about user logins. You're also going to need to read about SQL injection, user authentication, etc. (Otherwise how will you tell whose dog is whose, see?) Good luck
  19. That is actually one of the first decent virtual pet game ideas I have heard in a while. The idea of showing them instead of fighting them - I like it. I'd like to play it Although I'd prefer a cat version So here's some pseudo code: <?php ///Get $obey from DB if($obey < 20){ if($obey < { $inc = 2; }else{ $inc = 3; } $obey = $obey+$inc; //Save $obey to DB }else{ //No more training } ?> Edit: If you don't have anything at all written yet, your first task is a user registration/login system - create a class for the users, one for the dogs, set up your database, etc.
  20. <?php for($i=0; $i<7; $i++){ $date = mktime(0,0,0, date("m"), (date("d")+$i), date("Y")); print date("Y-m-d", $date); } ?>
  21. That would be javascript, and kind of worthless in time. You're going to have to check it serverside anyway with valid_date() (or whatever it is) so just go for 1-31 and give them an error after the fact if they mess with it.
×
×
  • 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.