[RESOLVED] problem with $_GET
Results 1 to 3 of 3

Thread: [RESOLVED] problem with $_GET

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    12

    resolved [RESOLVED] problem with $_GET

    Hello. I have a problem with $_GET. This is my code
    PHP Code:
    <!DOCTYPE html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>

    <body>

    <?php
    $usern
    =$_GET['us'];
    echo 
    "Welcome " $usern;

    ?>
    <br>
    <a href="quiz.php?x=1&zet=$usern">QUIZ HTML</a>
    <a href="quiz.php?x=2">QUIZ PHP</a>
    <br>
    <a href="login.html">Logout</a>

    </body>
    </html>
    And i want to send the $usern variable to another, variable which is already got from $_GET. I don't know if it's not possbile but on the coresponding link instead of an username it sais $usern. Please help and sorry for bad english.

  2. #2
    Pna lbh ernq guvf¿
    Join Date
    Jul 2004
    Location
    Kansas City area
    Posts
    19,429
    You can't place the name of a PHP variable inside of HTML and expect PHP to do anything with it.

    If you want to echo the value of a PHP variable inside the <a> tag, then you need to use PHP to do it - namely by adding <?php ... ?> tags around a PHP statement (e.g. echo or print).

  3. #3
    Junior Member
    Join Date
    Jan 2013
    Posts
    12
    O yea, you are right. Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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