1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How To Make A Link That'll Link To A Profile Page

Discussion in 'PHP' started by Ipodman79, Nov 30, 2014.

  1. #1
    I want to be able to create links to pages that will display information depending on the link value. I know you can do this using $_GET but I want the link to look something like, example.com/username and not example.com/profile.php?username=username.

    What is the best way to do this using PHP?

    Thanks,

    Cicisoft
     
    Ipodman79, Nov 30, 2014 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    You don't do this with PHP, you do this with .htaccess
     
    PoPSiCLe, Nov 30, 2014 IP
  3. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    737
    Likes Received:
    52
    Best Answers:
    33
    Trophy Points:
    150
  4. ezprint2008

    ezprint2008 Well-Known Member

    Messages:
    611
    Likes Received:
    15
    Best Answers:
    2
    Trophy Points:
    140
    Digital Goods:
    1
    #4
    if youre talking about the way they show in the address bar, they're right you have to convert it by htacess
    but if you want them displayed on a page for better looking links perse'
    then you can display them for display purpose as
    $website = "example.com/";
    $username = $_POST['username'];
    $display_URL = $website . $username;
    echo $display_URL

    but then for them to actually work you could put a graphic button like a small arrow --> after the displayed name (since the displayed name URL which wouldn't be a hyperlink)
    the arrow graphic itself would have the hyperlink as in <a href="<?php echo 'example.com/profile.php?' . $username; ?>"> <image src="arrow.jpg" border="0">

    then you would have a webpage display of example.com/username [arrow graphic] so the link still works.
     
    ezprint2008, Jan 12, 2015 IP
  5. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #5
    Why in the WORLD would you do something as stupid as that? Why having a image-arrow be the link? Why not just have the actual "pretty" text be the visible indication of a link, and just, instead of that image-elemtn in the link, have the $display_URL echoed out in the link? Why make stuff more difficult than it has to be, besides, having an image be the only url is bad form and bad useability.
     
    PoPSiCLe, Jan 12, 2015 IP