Strange Problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nazgul42
    New Member
    • Jul 2007
    • 12

    Strange Problems

    Ok... I'm having a strange problem: I have a php signup page that I want to be able to display an error message on, but it starts to show some of the PHP code. My page is as follows:
    [PHP]
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Sign Up - The Zammarket</title>
    </head>
    <body style="backgrou nd-color: rgb(51, 51, 0); color: rgb(255, 255, 51);" link="#00ff00">
    <p text="#FF00FF" align="center"> To get back to our
    home page click <a href="index.htm ">here</a></p>
    <form method="post" action="signup. php">
    <p align="center">
    <?php
    if (isset($GET['Error']))
    {
    if ($GET['Error'] == 1)
    {
    echo "<p>This Username Is Already Taken.</p>";
    }
    else if ($GET['Error'] == 2)
    {
    echo "<p>This Runescape Username Is Already Taken.</p>";
    }
    }
    ?>
    Runescape Username: <input maxlength="12" name="RSUsernam e" size="12"><br>
    Desired Username: <input maxlength="30" name="Username" size="20"><br>
    Password (<b>NOT</b> RS password): <input maxlength="30" name="Password" size="20" type="password" ><br>
    <input value="Submit" name="B3" type="submit">< br>
    <input value="Reset" name="B4" type="reset"></p>
    </form>
    </body>
    </html>
    [/PHP]

    You can see the result on http://zammarket.freehostia.com/signup.htm
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, nazgul.

    You're getting that behavior because your webserver is not set up to parse .htm files as PHP scripts.

    If you have access to your server's httpd.conf file, verify that you have this line in there and then restart Apache.
    [code=apache]
    AddType application/x-httpd-php .php .htm .html
    [/code]

    If you don't have access to that file, or if your server is not running Apache, try renaming your file to have a .php extension.

    Comment

    • nazgul42
      New Member
      • Jul 2007
      • 12

      #3
      Thank You Very Much, that solved my problem.

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        Heya, nazgul.

        Originally posted by nazgul42
        Thank You Very Much, that solved my problem.
        Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)

        Comment

        Working...