PHP Help
- Started
- Last post
- 19 Responses
- Dancer
I am far from being anywhere near a PHP code.
I am only using a couple of includes and stuff.
But All of a sudden my webpage has stopped viewing and is completely blank. I first of all thought it could be the host but I ran a PHP info file and it runs fine.
http://www.wokingham-hc.co.uk/ph…It would seem that the page is just not parsing the PHP. in any of my pages though:
http://www.wokingham-hc.co.uk/la…Any ideas?
Thanks
- Dancer0
IS there any way I can test if it is connecting to the Database?
- acescence0
turn error reporting on at the top of the page..
ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);
- sherm0
if all you are doing is including files, it could be that your pathing is wrong, but i think it would only kill the page if you use require instead of include.
then for db connections, typically that won't kill the page either, it just won't connect to the db and the error message would depend on what condition you are trying to catch.
try to post the code somewhere.
- sherm0
i would consider this:
http://pastebin.com/anyone else chime in on something better...
- Dancer0
Ah..... this is killing me... it was all working and then bang... all gone:
http://pastebin.com/me727f5d
- sherm0
why is your include written like this?
(@include_once 'Classes/Classes.php');i thought it would be:
@include_once('Classes/Classes.p...Also, any reason why you are prepending that statement with the @ to turn off error reporting?
- Dancer0
Sorry I posted the wrong page:
http://pastebin.com/m47143f9e
- Dancer0
So should I remove the @ symbol then?
- section_0140
No, remove the ()
- section_0140
Also, remove the @ because it supresses errors.
- Dancer0
hmmmm Still a blank page
I got someone else to write me some PHP a while back and now it is playing up
- Dancer0
"Parse error: syntax error, unexpected T_EXTENDS in /vhost/vhost8/w/o/k/wokingham-hc... on line 18"
- sherm0
its hard to gauge what is going on without testing the page. No output doesn't lend to easy debugging from afar.
- Dancer0
classes.php
- sherm0
in your classes file, the db connection doesn't mention host.
typically you'd specify:
host
username
password
db_nameunless $mysql_db is the host.
Line 18 refers to extends someClass..
this line should be at the top where you have Class myClass extends SomeOtherClassI have never seen it written where its on its own line without saying which class is inheriting the behavior of another class..
I would recommend, learning to write this stuff the procedural way just to know what is going on. How can you expect yourself to debug Object Oriented PHP without knowing how it works?
It should be easy enough if all you are doing is connecting then querying the db and outputting a result.
- Dancer0
ha, yeah. But I am a front end person that is doing this site for free and therefore do not intend to start learning PHP because of it... I cannot believe this has happened now... thanks for looking though...
- Dancer0
Ok.
Sherm, I think you are right. I may of cracked it.
But yeah if I don't suppress the errors then all hell breaks loose.
Thanks again
- sherm0
lol @ all hell breaking loose! I been there brotha.
errors should not occur however. some functionality could be compromised or flat out not work if not solved.