Results 1 to 9 of 9

 

Thread: Get a dynamic php link from user URL

  1. #1
    Registered User

    Status
    Offline
    Join Date
    Apr 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts


    Hi guys,
    I need to change my static HTML page (i.e. http://www.mypage.com) with a link
    (<a href="http://www.mypage.com/form.php"> to a page with dynamic link - if user's URL for my page is
    http://www.mypage.com/?123456789 this 9-digit number from URL should appear in the link to the form - http://www.mypage.com/form.php?123456789
    Thanks in advance.

  2. #2
    Registered User

    Status
    Offline
    Join Date
    Feb 2005
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    I have read that a few times and I cant work out what you are looking to do. Can you explain/expand?

  3. #3
    Registered User

    Status
    Offline
    Join Date
    Apr 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I will try.
    I have a web page - http://internet-system.info/ (it's in Russian, but it doesn't matter) with the link on the bottom ( Fill The Form) to the form -
    http://internet-system.info/form.php
    I want people whom I work with (they have an ID - 9-digits number) send the visitors to the first page by providing link to http://internet-system.info?ID - the same URL but with there ID (the page visitors see is the same). If visitors continue and fill the form, the field "9-digits number" should be filled automatically with ID that will be taken from the first page's URL.
    I have two files: index.html for http://internet-system.info/ and form.php
    Thanks

  4. #4
    Registered User

    Status
    Offline
    Join Date
    Feb 2005
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What scripting language are you using.
    How is the 9 digit ID carried into the first page? Is it in a variable of some sort?

  5. #5
    RezaBadel's Avatar
    Registered User

    Status
    Offline
    Join Date
    May 2008
    Location
    Newcastle Upon Tyne
    Posts
    185
    Thanks
    0
    Thanked 19 Times in 18 Posts
    Hi Leon,

    You could set-up a request variable in PHP, for example:

    $partner = $_REQUEST['ID'];

    Then in your URL have the parameter named the same as what you are requesting i.e. www.mypage.com/?ID=123456789

    This way you can then use the variable $partner to pass into your form with the other values as well as possibly set a cookie so if the same user arrives at the site with a new ID you can update the cookie etc. Also you could include this value in your buy.at affiliate links so that the partner ID is passed into the buy.at LID (Link ID) parameter:

    http://merchant.at/affhandle?LID=<<echo out $partner value>>

    Then any subsequent sales can be attributed back to the partners you are working with.

    Hope that helps!

    Kind regards,

    Reza
    Solutions Engineer
    buy.at
    reza.badel@buy.at

  6. #6
    Registered User

    Status
    Offline
    Join Date
    Apr 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No script in the first page. Everyone takes my URL - http://internet-system.info and ads his ID (with question mark) - http://internet-system.info?ID

  7. #7
    Registered User

    Status
    Offline
    Join Date
    Apr 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you, Reza,
    but I don't know PHP at all and can't write a code.
    I thought it could be two tasks:
    1. the variable (ID) from URL
    http://internet-system.info/?ID=123456789 "transferred" somehow to the link to form -
    href="http://internet-system.info/form.php?ID=123456789"
    2. the variable (ID) from form's URL
    http://internet-system.info/form.php?ID=123456789 passes to the form (the other values are filled by visitors).

    If the script is simple I'd like somebody just writes it ready for use.

    Thanks

  8. #8
    Brett's Avatar
    Registered User

    Status
    Offline
    Join Date
    Dec 2003
    Location
    Oxford
    Posts
    521
    Thanks
    2
    Thanked 11 Times in 8 Posts
    You need to do the following.

    On index.html

    replace

    Code:
    <a href="form.php"><img src="form_button.jpg" width="280" height="47" /></a>
    with something like

    Code:
    //check if ID exists in current url
    <?php
    if ($_GET['ID']<>"") {
    $ID=$_GET['ID'];
    $ID = $_GET['ID'];
    ?>
    
    //if ID does exist then append it to the new link
    
    <a href="form.php?ID=<?php echo $ID;?>"><img src="form_button.jpg" width="280" height="47" /></a>
    <?php
    
    //if it doesn't then display the normal link
    else {
    ?>
    <a href="form.php"><img src="form_button.jpg" width="280" height="47" /></a>
    <?php
    }
    ?>
    Then on form.php you'd need to do this:

    Code:
    <form method="post" action="" enctype="multipart/form-data">
    
    <?php 
    if ($_GET['ID']<>"") {
    $id=$_GET['ID'];
    ?>
    <input type='hidden' name='partner' value='<?php echo $id;?>'>
    <?php
    }
    ?>
    Then when your form gets submitted you'll get an additional field passed through that shows the ID field.

    Brett

  9. #9
    Registered User

    Status
    Offline
    Join Date
    Apr 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you Brett,
    I will try it, may be it's what I'm looking for



Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 29-07-10, 09:36 PM
  2. User ID tracking Link Help?
    By dogcat in forum Zanox
    Replies: 8
    Last Post: 24-10-06, 09:01 AM
  3. Comet Dynamic link no tracking?
    By Mogga in forum Affiliate Window & buy.at
    Replies: 0
    Last Post: 27-12-05, 11:53 AM
  4. Dynamic link list
    By Melter in forum Programming
    Replies: 6
    Last Post: 14-06-05, 10:42 PM
  5. creating link on dynamic text
    By ukyellowpage in forum Programming
    Replies: 3
    Last Post: 21-02-05, 11:28 PM

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
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2