SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    URL passing a variable

    I need to pass a variable which will be the current logged in members id to another website. I dont care if it is not secure or not. This is how it MUST be done. So the user will click on a link then the link will pass the password and user id to the new website. Here is what I have so far, but doesnt seem to work. Any ideas would be great! Thanks.

    <?php global $current_user; get_currentuserinfo(); echo '' . $current_user->user_login . "\n"; ?>
    <?php echo $current_user->user_login;
    echo '<a href="http://sport.net/clubpro/clubs/cs-squash/index.php?username<?php echo '$current_user';?>;password=bff23476a33b6bfe
    " target="_blank">Squash Login</a>';
    ?>

    I cant figure out how to put the current user id into the username part of the URL.

  2. #2
    Non-Member Kalon's Avatar
    Join Date
    Aug 2010
    Location
    At my computer
    Posts
    2,012
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    when you run that code, if you have a look at the generated html in your broeser for this line
    Code:
     
     
    echo '<a href="http://sport.net/clubpro/clubs/cs-squash/index.php?username<?php echo '$current_user';?>;password=bff23476a33b6bfe
    " target="_blank">Squash Login</a>'
    the error should become obvious.


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
  •