Page 3 of 12
Re: Video#7
Posted: Thu Oct 15, 2009 11:14 pm
by hallsofvallhalla
I started to teach myself PHP less than a year ago.
Re: Video#7
Posted: Thu Nov 05, 2009 3:53 pm
by mh2n
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
Re: Video#7
Posted: Thu Nov 05, 2009 4:04 pm
by Lord Strife
its a problem with whitespace before your <?php tag
Code: Select all
<?php
some code here
and more code here
?>
should be
Code: Select all
<?php
some code here
and more code here
?>
get rid of the blank spaces before the <?php and it should fix itsself
Re: Video#7
Posted: Thu Nov 05, 2009 4:33 pm
by mh2n
Thank you Lord Strife for the quick response. The warning is gone now.
Regards
Re: Video#7
Posted: Thu Nov 05, 2009 5:04 pm
by hallsofvallhalla
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
Posted: Thu Dec 17, 2009 3:40 am
by OldRod
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

Re: Video#7
Posted: Thu Dec 17, 2009 2:38 pm
by hallsofvallhalla
hehe everyone always blames my code
I have actually done that a few times myself
Re: Video#7
Posted: Thu Dec 17, 2009 3:36 pm
by OldRod
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!

Re: Video#7
Posted: Thu Jan 07, 2010 6:24 pm
by zolacat999
I don't have auto increment on on my database yet im still only allowed to have one item on
Re: Video#7
Posted: Thu Jan 07, 2010 7:39 pm
by OldRod
Check and make sure the table is not indexed - that was my problem.