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 2 of 2

Thread: if...

  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    if...

    Right, am very new to this and started a little project.

    I have a page http://www.mediresponse.co.uk/golf.php

    you need to enter a username to enter, but no password is needed.

    what i want to use the username for is....the table that is then shown after hitting submit to be affected. So if $username was Jedi, then the array $golfer[0] would be made bold when used on the page.

    below is what i have tried. it doesnt seem to do anything, so was wondering also where in the page it needs to be, bearing in mind the page also starts with if (!submit) so there are 2 pages in one.



    <?php
    if($username=="Jedi"){
    echo "<b>" .$golfer[0]. "</b>";
    }
    ?>


    thanks

    SJC

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Your input field is named "Username", not "username". That results in $Username, not $username, if I'm not mistaken.
    Generally, in PHP all variables are case-sensitive, wheras function names aren't. Don't know why actually.


  •  

    Posting Permissions

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