#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Argentina
    Posts
    4
    Rep Power
    0
    Hi everyone,
    I'm new in php and I'm programming my first site using it.
    The problem I have now is that when I run a php script (file_name.php3) I receive a white page. It doesn't matter what kind of php script is inside the page. For example:
    <body>
    <?php
    $db = mysql_connect("localhost");
    mysql_select_db("mydb",$db);
    if ($submit) then
    //script
    else
    ?>
    HTML tags
    <?php
    }
    ?>

    Please let me know if I did somthing wrong because I can't understand why the page I ask to see appears in blank.
    Let me know if you need further information to help me in this.
    Regards and thanks in advance
    Socrates
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    3
    Rep Power
    0
    Try:
    if ($submit) {

    then is a Pascal-word...
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Argentina
    Posts
    4
    Rep Power
    0
    Sorry, I meant
    If ($submit) {
    I don't know why I wrote then.
    Regards-
    Socrates
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Location
    UK
    Posts
    50
    Rep Power
    15
    Hi

    Have included/required any files in the code. Have you tried commecting out various pieces of code, try narrowing down the section of code. Have you had the page working with php before, if not try something more simple. Think back to last time you had it working what modifications did you make.

    As far as I can see the code in your message is fine.

    I hope the questions help you.

    Falcon
  8. #5
  9. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    18
    You need to use brackets in your if..else construct:

    if (condition)
    {
    //code
    }
    else
    {
    //code
    }

Similar Threads

  1. How to see the Memory used by a PHP script?
    By Pardall in forum PHP Development
    Replies: 4
    Last Post: February 13th, 2004, 03:54 PM
  2. Change this PHP script to use NETPBM instead of GD
    By hknight in forum Project Help Wanted
    Replies: 1
    Last Post: February 10th, 2004, 11:46 AM
  3. Replies: 0
    Last Post: February 8th, 2004, 10:11 PM
  4. running a script, after one script gets done running
    By sc_dan in forum Perl Programming
    Replies: 1
    Last Post: February 7th, 2004, 10:32 PM
  5. Replies: 1
    Last Post: February 4th, 2004, 01:39 PM

IMN logo majestic logo threadwatch logo seochat tools logo