Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2008
    Posts
    64
    Thanks
    11
    Thanked 0 Times in 0 Posts

    blank screen nothing shows up

    I am tying to make a forum and i get a blank screen off this script

    PHP Code:
    <?php
    session_start
    ();
    include 
    "./globl.php";
    ?>
    <HTML>

            <head>
                <title>Will's Fourm</title>
                
                <style type="text/css">
                    body {
                        background-color:#EEE;
                        color:#000;
                        font-family:Arial;
                        font-size:10pt;
                    }
                    
                    #holder {
                        width:90%;
                        color#000;
                        font-family:Arial;
                        border:1px solid #000;
                        padding:10px;
                        text-align:left;
                    }
                    
                    #userInfo {
                        width:100%;
                        color:#000;
                        font-family: Arial
                        border:1px solid #CCC;
                        text-anign:left:
                        padding:3px;
                    }
                </style>
            </head>

            </body>
            <center>
                <div id="holder">
                
                    <div if=userInfo>
                    <?php
                    
                    
    if($_SESSION['uid']) {
                        
    $sql "SELECR username FROM 'users WHERE 'id'='".$_SESSION['uid']."'";
                        
    $res mysql_query($sql) or die(mysql_error());
                        
                        if(
    mysql_num_rown($res) == {
                            
    session_destroy();
                            echo 
    "Please <a href=\"./login.php\">Login</a> to your account or <a href=\"./register.php\">Register</a> a new account!\n";
                        }else {
                            
    $row mysql_fetch_assoc($res);
                            echo 
    "Welcome Back!<a href=\"./index.oho?act=profile&id=".$row['id']."\">".$row['username']."</a>!\n";
                            
                            
                    }else {
                        echo 
    "Please <a href=\"./login.php\">Login</a> to your account or <a href=\"./register.php\">Register</a> a new account!\n";
                    }
                    
    ?>
            <?php
            
            ?>
                </div
            </center
            </body>
    </HTML>

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Add
    PHP Code:
    <?php
    error_reporting
    (E_ALL);
    ini_set('display_errors','On'); 
    ?>
    at the top of your page.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Aug 2008
    Posts
    64
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Did not help

    Did this not show errors it must not be a php

  • #4
    Regular Coder
    Join Date
    Mar 2008
    Posts
    118
    Thanks
    3
    Thanked 9 Times in 9 Posts
    Is $SESSION_['uid'] set? If it is, there are a lot of minor mistakes in your code that could cause your problem.

    Code:
    <div id="userInfo">
                    <?php
                    
                    if($_SESSION['uid']) {
    $sql = "SELECT `username` FROM `users` WHERE id='".$_SESSION['uid']."'";
                        $res = mysql_query($sql) or die(mysql_error());
                        
                        if(mysql_num_rows($res) == 0) {
                            session_destroy();
                            echo "Please <a href=\"./login.php\">Login</a> to your account or <a href=\"./register.php\">Register</a> a new account!\n";
                        }else {
                            $row = mysql_fetch_assoc($res);
                            echo "Welcome Back!<a href=\"./index.php?act=profile&id=".$row['id']."\">".$row['username']."</a>!\n";
                            // I'm guessing the above line should've had a php extension.
                            
                    }else {
                        echo "Please <a href=\"./login.php\">Login</a> to your account or <a href=\"./register.php\">Register</a> a new account!\n";
                    }
                    ?>
                </div>
    The lines I edited are in red.
    Last edited by peteyb383; 08-14-2008 at 12:34 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •