Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
Before trying to use a variable, you need to make sure it exists and is set. if(isset($question)){ echo $question; }
-
Sending login information in an e-mail if user forgets, HELP!
Jessica replied to SauloA's topic in PHP Coding Help
Well for one there is no function called that... -
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/"
-
Well if you post those errors and the lines of code they refer to, we can help.
-
add this to the top of the page: ini_set('display_errors', 1); error_reporting(E_ALL);
-
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
-
Edit: woops. What was I thinking? Try this: echo '<form name="myForm" action="'.$_SERVER['PHP_SELF'].'" method="post">';
-
http://us3.php.net/move_uploaded_file You rename it by passing the new file name.
-
[SOLVED] Parse error: parse error, unexpected $end in C:
Jessica replied to suttercain's topic in PHP Coding Help
You never close your heredoc of EOTABLE Whoops, didn't preview -
You should use sessions here, not cookies.
-
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.
-
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.
-
What doesn't work?
-
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.
-
<?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.
-
Posting was the cure - they are gone! Finally!
-
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
-
I've been hiccuping for 30 minutes now - help!
-
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
-
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.
-
<?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); } ?>
-
Need help with php generated drop down list using date()
Jessica replied to offsprg01's topic in PHP Coding Help
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. -
Textpad is another good one