SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    this page belongs to....

    Hi Im having a few problems understanding this.....
    I run a club, which members can join by using a referral link, which when clicked takes them to the index.php page.
    this script is present
    <?php
    if ($username != "")
    $ref= "join.php?username=$username";
    else
    $ref= "join.php";
    echo "<a href=";<BR> echo $ref;<BR> echo " class='tex'>";
    echo "Sign Up";
    echo "</a>";
    ?>
    which is the link the new member clicks to join.
    I want however a simple test that says....
    this page belongs to *****
    how do I add it using the $username above
    Thanks

  2. #2
    SitePoint Wizard Rick's Avatar
    Join Date
    Oct 2002
    Location
    Lancashire, UK
    Posts
    3,847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you mean something like this?
    PHP Code:
    <?php

    $username 
    $_GET['username'];

    if (!
    $username == '') {
        
    $ref"join.php?username=$username";
        
    $belong "This page belongs to $username";
    } else {
        
    $ref"join.php";
        
    $belong "";
    }


    echo 
    "<a href='" $ref "' class='tex'>Sign Up</a><br />";
    echo 
    $belong;

    ?>
    This will echo This page belongs to 'username' if a username has been specified, and nothing otherwise.

    ZOO
    Rick

  3. #3
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I'm not sure if this is what you want...
    PHP Code:
    <?php
    if ($username != "" ) {
    $msn "Welcome. This page belongs to $username";
    $ref"join.php?username=$username";
    } else {
    $msn "Welcome";
    $ref"join.php";
    }
    ?>
    <html>
    <head>
    </head>
    <body>
    <font face="verdana, arial" size="2"><b><?=$msn?></b><br>
    <a href="<?=$ref?>" class='tex'>Sign Up</a></font>

    </body>
    </html>


Bookmarks

Posting Permissions

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