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 5 of 5
  1. #1
    Senior Coder
    Join Date
    May 2006
    Posts
    1,683
    Thanks
    28
    Thanked 4 Times in 4 Posts

    Please help: In my link the http:// are doubling up !

    Hi,

    I am trying to construct a link and when I do keep getting a relative
    link instead of the url.

    This is my code:
    PHP Code:
    <?php  $the_file 'creative_thinking.mp3'; echo "<a href=\"".urlencode(makelink($the_file))."\">Better-Creative-Thinking.mp3</a>"?>
    The link shows up as:

    Code:
    http://www.mysite.com/sub-dir/https://my-bucket.s3.amazonaws.com/my-file.mp3?acesskey=hfllghlgflshgsl ...
    of course it should not include the relative path but start off with the https.

    like this
    https://my-bucket.s3.amazonaws.com/m...fllghlgflshgsl

    How can I get it to drop the relative part ?

    I thought is was automatically detected when it starts with "http" ?




    .
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #2
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    What does the makelink function look like
    You shouldn't be urlencoding the whole URL either, just the uri at the most
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #3
    Senior Coder
    Join Date
    May 2006
    Posts
    1,683
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Hi

    The makelink() builds up the link,
    the last line is this:

    PHP Code:
     $link "https://{$bucket}.s3.amazonaws.com/{$file}?{$authentication_params}"
    I am using a similar link to play a video using a player,

    Maybe it is because the "://" are encoded and therefore the "https://" is not being recognised ?

    So I need to take the $link and break it up ??

    What do you think ?_



    .
    Last edited by jeddi; 02-15-2010 at 08:59 PM.
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #4
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    remove the urlencode and see what happens
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #5
    Senior Coder
    Join Date
    May 2006
    Posts
    1,683
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Thanks, goog idea.


    I'll give that a try




    .
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.


  •  

    Posting Permissions

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