Browser MMO Video #7
- hallsofvallhalla
- Site Admin
- Posts: 12023
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#7
I started to teach myself PHP less than a year ago.
Re: Video#7
Hello To all,
This is my first time to post here. I just finished the video#7 tutorial and copy all the codes. it's working properly except for the warning's:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/mffernac/public_html/bgame/authenticate.php:1) in /home/mffernac/public_html/bgame/authenticate.php on line 3
Logged in successfully
Continue
it is true in all the pages. I close and restart again my browser (Firefox version 3.5.4). The Warning still comes out.
Please Advice,
Regards
This is my first time to post here. I just finished the video#7 tutorial and copy all the codes. it's working properly except for the warning's:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/mffernac/public_html/bgame/authenticate.php:1) in /home/mffernac/public_html/bgame/authenticate.php on line 3
Logged in successfully
Continue
it is true in all the pages. I close and restart again my browser (Firefox version 3.5.4). The Warning still comes out.
Please Advice,
Regards
- Lord Strife
- Posts: 104
- Joined: Wed Oct 28, 2009 3:10 pm
Re: Video#7
its a problem with whitespace before your <?php tag
should be
get rid of the blank spaces before the <?php and it should fix itsself
Code: Select all
<?php
some code here
and more code here
?>
Code: Select all
<?php
some code here
and more code here
?>
Re: Video#7
Thank you Lord Strife for the quick response. The warning is gone now.
Regards
Regards
- hallsofvallhalla
- Site Admin
- Posts: 12023
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#7
yeah he beat me to it, i wasnt sure what code 7 had in it, making sure it wasnt your header refresh, they have to go at the top of the page also. but you are good. Thanks to Strife for the quick save!
Re: Video#7
I got around to trying this video tonight and it works except for one thing.
I can only have 1 item in my inventory at a time - any attempt to purchase anything else results in"can not insert item into backpack". Is that by design? I can't see anything in the code that limits it, but there must be. If I use the item, then I can purchase another, but if there's already an item in my inventory, I can't.
What am I doing wrong?
*edit* well, as usual, 5 seconds after posting, I found the answer myself :p
When I set up my inventory table, I had accidentally set id to be AUTO_INCREMENT. I removed this later, but it left behind an index that was preventing duplicate id's from being inserted. Removed the index and it works now. Just ignore me
I can only have 1 item in my inventory at a time - any attempt to purchase anything else results in"can not insert item into backpack". Is that by design? I can't see anything in the code that limits it, but there must be. If I use the item, then I can purchase another, but if there's already an item in my inventory, I can't.
What am I doing wrong?
*edit* well, as usual, 5 seconds after posting, I found the answer myself :p
When I set up my inventory table, I had accidentally set id to be AUTO_INCREMENT. I removed this later, but it left behind an index that was preventing duplicate id's from being inserted. Removed the index and it works now. Just ignore me
- hallsofvallhalla
- Site Admin
- Posts: 12023
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#7
hehe everyone always blames my code
I have actually done that a few times myself
I have actually done that a few times myself
Re: Video#7
Well, every other table up to that point, ID was an auto-increment field and when I was creating it, I set it up that way out of habit.
Then I saw the screen of your db listing and it wasn't that way. I didn't realize the indexes were still there (they are hidden unless you click on 'details')
It's all good though - it's a learning process!
Then I saw the screen of your db listing and it wasn't that way. I didn't realize the indexes were still there (they are hidden unless you click on 'details')
It's all good though - it's a learning process!
-
- Posts: 62
- Joined: Tue Nov 24, 2009 11:09 pm
Re: Video#7
I don't have auto increment on on my database yet im still only allowed to have one item on
Re: Video#7
Check and make sure the table is not indexed - that was my problem.