#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    6
    Rep Power
    0

    PHP shows blank Page


    Hi everybody I just started to study PHP and got blank page for one program but the other one works absolutely fine I don't know why I decided to delete everything and just leave the printing statements but it does not help. I searched in the internet help in some places it is said because of the missed sign in another some problems with setting php so I am lost any help???
    Here is my code:
    PHP Code:
    <? php 
    $connect
    =mysql_connect("localhost""user""");
    echo 
    "Hello"
    if(!
    $connect){ 
    die(
    "Failed to connect: " mysql_error()); 
    } else if(!
    mysql_select_db("studentdatabase")){ 
    die(
    "Failed to connect to a database" mysql_error()); 
    } else{ 
    echo 
    'Hello world'; } 
    ?>
    I tried to print errors by putting
    PHP Code:
    error_reporting(E_ALL); ini_set("display_errors"1); 
    after the connect no luck and by default when I setting up I made to print all errors . Any help??? Thanks in advance!!!!
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    6
    Rep Power
    0
    OH! Sorry for spamming! I was really stupid! I found my mistake ?php should go together! Just in case smb will have the same problem in the future!!!
  4. #3
  5. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1046
    Hi,

    the actual problem is that your error reporting is turned off (or the errors are written to a log file you don't know about).

    You need to set the reporting in your php.ini(!). Turning it on at runtime doesn't help, because the script may not even run due to a parse error -- which is what just happened. So find the php.ini and then configure PHP as explained in the error tutorial in my signature.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".

IMN logo majestic logo threadwatch logo seochat tools logo