Forum Moderators: coopster

Message Too Old, No Replies

php script blank in browser

but it work in dreamweaver

         

ConfusedNewbie

4:42 am on May 20, 2015 (gmt 0)

10+ Year Member



I use Adobe Dreamweaver CS6 to do my script and it work properly, but when I try to open it in browser it just a blank page .
do i miss something here ?

thank you

ps : sorry for my bad English

whitespace

8:30 am on May 20, 2015 (gmt 0)

10+ Year Member Top Contributors Of The Month



it work properly, but when I try to open it in browser it just a blank page


How does it "work properly" if you get a "blank page"? Does Dreamweaver have its own PHP engine?

do i miss something here ?


Yes; a detailed description of the problem.

- Do you have a webserver with PHP engine installed?
- Do you have full error_reporting set?
- What "script" are you trying to run?
- Have you tried a simple "hello world" type script?

ConfusedNewbie

8:57 am on May 20, 2015 (gmt 0)

10+ Year Member



this is the script and design in dreamweaver that i mean work properly
[postimg.org...]
but when i open it in browser it just a blank page
[postimg.org...]

yes i have a PHP engine installed
no i dont have an error reporting

thanks for the reply whitespace

whitespace

9:35 am on May 20, 2015 (gmt 0)

10+ Year Member Top Contributors Of The Month



At the very top of your script (before <html>) add the following:


<?php
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors','1');
?>


This sets full error_reporting (includes errors, warnings and notices) and makes sure that they are output to the page.

It might just be that "dbconnect.php" can't be found? Where is this located?

ConfusedNewbie

9:55 am on May 20, 2015 (gmt 0)

10+ Year Member



aww you are right
[postimg.org...]

thanks for your help whitespace

whitespace

10:32 am on May 20, 2015 (gmt 0)

10+ Year Member Top Contributors Of The Month



Although a require('dbconnect.php') should fail with a "fatal error" if the file cannot be found.

But the "Notice" messages you are seeing are indicative of some code not being included (or executed) correctly. For instance:

Notice: Use of undefined constant mysql_die - assumed 'mysql_die' in ...


This might only be a "notice", but it indicates a serious error. Not only is your database query failing, but "mysql_die" is not defined, so you are not seeing the correct error. Should that really be "mysql_die" and not simply "die"?

whitespace

10:41 am on May 20, 2015 (gmt 0)

10+ Year Member Top Contributors Of The Month



Incidentally, the Dreamweaver screenshot you posted earlier does not show the code "working properly" - in fact it doesn't seem to be doing anything, apart from showing the raw HTML? Is it actually executing the PHP? The screenshot seems to only show "PHP" placeholders?

ConfusedNewbie

10:48 am on May 20, 2015 (gmt 0)

10+ Year Member



dbconnect.php located in the same folder as detail.php so i guess thats not the problem
a simply "die" work no more notice error for that line, but can you tell me how to fix the undefined variable
line 28 : $Query = "SELECT * FROM informasi WHERE dates='$dt' AND times='$tm'";
line 144 : $Query2 = "UPDATE classified SET hits=$hits WHERE dates=$dt AND times=$tm ";

thank you

whitespace

11:01 am on May 20, 2015 (gmt 0)

10+ Year Member Top Contributors Of The Month



It's not necessarily simple to fix the "undefined variable" notice - we'll need to see the rest of your code.

It would be easy just to make that notice go away by defining that variable, but that won't fix the underlying problem, which is... Why are those variables undefined?

That notice seems to suggest that an earlier bit of code is not being executed or included correctly?

ConfusedNewbie

11:41 am on May 20, 2015 (gmt 0)

10+ Year Member



I'll try to fix this first ,thank you very much for your help and response whitespace
I'll comeback to report my result hehe