gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

OffTopic > need php help, why doesnt this work?

#122451 - spinal_cord - Mon Mar 19, 2007 1:32 pm

I was going to use this

http://gr0w.com/articles/code/php_5_star_rating_system_using_hreview/

on a website, but i cant get the example to work, i just get a blank page.

can anyone shead some light on whay im doing/not doing?

thankyou.
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#122452 - keldon - Mon Mar 19, 2007 1:37 pm

I would check the source code of the produced output and check the file permissions and server features.

#122467 - gauauu - Mon Mar 19, 2007 3:02 pm

Do you have any php experience at all? I don't want to sound insulting starting at the very beginning.

First, go back and make a simple php file with just this in it:
Code:

   <? phpInfo(); ?>


Try to view that file, and it should come up with a giant block of stuff to show you that php is working right. If it is, go on with the rest of my post. If not, you've got to spend some time figuring out how to make php work correctly.

Now, back to your rating script....we're not sure if it's encountering errors and quitting without showing them to you...try adding this code to the beginning of your file rating script:

Code:

init_set('display_errors', 'On');
ini_set('error_reporting', E_ALL);


The script should then report any errors it encounters. This should help you figure out where the error is occurring.

Like Keldon said, there's a good chance it has to do with file permissions. You may have to manually give write access for the directory to whatever user apache runs as. (although that's nasty for security, so I don't necessarily recommend it).