Browser MMO Video #7

Location of the Videos
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#7

Post by hallsofvallhalla »

I started to teach myself PHP less than a year ago.
mh2n
Posts: 4
Joined: Thu Oct 01, 2009 2:48 am

Re: Video#7

Post 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
User avatar
Lord Strife
Posts: 104
Joined: Wed Oct 28, 2009 3:10 pm

Re: Video#7

Post 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
mh2n
Posts: 4
Joined: Thu Oct 01, 2009 2:48 am

Re: Video#7

Post by mh2n »

Thank you Lord Strife for the quick response. The warning is gone now.

Regards
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#7

Post 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!
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: Video#7

Post 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 :)
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#7

Post by hallsofvallhalla »

hehe everyone always blames my code :)

I have actually done that a few times myself
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: Video#7

Post 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! :)
zolacat999
Posts: 62
Joined: Tue Nov 24, 2009 11:09 pm

Re: Video#7

Post by zolacat999 »

I don't have auto increment on on my database yet im still only allowed to have one item on
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: Video#7

Post by OldRod »

Check and make sure the table is not indexed - that was my problem.
Post Reply

Return to “Older Browser MMO Videos”