Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2003
    Location
    New York
    Posts
    494

    Convert PHP file to ASP

    Greetings,

    I was wondering if anybody can convert the following PHP code into ASP. Your help would be greatly appreciated!

    <?php
    $referer = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : "";
    $path = "http://www.domain.com/tracker.php?" . $_SERVER['QUERY_STRING'] . "&ref=" . $referer;
    header("Location: $path");
    ?>

    Boris
    - AdWatcher - From the founders of HostVoice, comes the first ad management and tracking service created with web hosts in mind. Track Google AdWords, Overture, hosting directories, local advertising, etc. Compatible with ModernBill, WHM AutoPilot, ClientExec, PayPal, 2CO and others.
    - Pay Per Click Marketing Book - Don't spend another dollar on PPC ads before you read this book.

  2. #2
    Join Date
    Jul 2003
    Location
    Kuwait
    Posts
    5,099
    Now, I am not a ASP programmer (haven't touched ASP in more than 4 years) but try this:

    Code:
    <%
    
      Dim referer
      Dim path
    
      if Server.RequestVariables("HTTP_REFERER") <> ''
         referer = Server.RequestVariables("HTTP_REFERER")
      referer = ''
    
      path = "http://www.domain.com/tracker.php?" + Server.RequestVariables("QUERY_STRING") + "&ref=" + referer
    
      response.redirect path
    %>
    LOL if that actually works, I'd be very surprised But atleast you have something to start with.
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

  3. #3
    Join Date
    Sep 2003
    Location
    New York
    Posts
    494
    Thanks!

    This is actually for a client of ours. Could anybody confirm if this is correct before I send it off?

    Thanks again!

    Boris
    - AdWatcher - From the founders of HostVoice, comes the first ad management and tracking service created with web hosts in mind. Track Google AdWords, Overture, hosting directories, local advertising, etc. Compatible with ModernBill, WHM AutoPilot, ClientExec, PayPal, 2CO and others.
    - Pay Per Click Marketing Book - Don't spend another dollar on PPC ads before you read this book.

  4. #4
    No I would say instead of:
    Code:
    if Server.RequestVariables("HTTP_REFERER") <> ''
         referer = Server.RequestVariables("HTTP_REFERER")
      referer = ''
    this should be different:
    Code:
    referer = Server.RequestVariables("HTTP_REFERER")
    WatermarkIt: Take ownership of your images
    Salo Storm Software

  5. #5
    Join Date
    Sep 2003
    Location
    New York
    Posts
    494
    So just to confirm:

    <%

    Dim referer
    Dim path

    referer = Server.RequestVariables("HTTP_REFERER")

    path = "http://www.domain.com/tracker.php?" + Server.RequestVariables("QUERY_STRING") + "&ref=" + referer

    response.redirect path
    %>

    Is that the right one?

    Boris
    - AdWatcher - From the founders of HostVoice, comes the first ad management and tracking service created with web hosts in mind. Track Google AdWords, Overture, hosting directories, local advertising, etc. Compatible with ModernBill, WHM AutoPilot, ClientExec, PayPal, 2CO and others.
    - Pay Per Click Marketing Book - Don't spend another dollar on PPC ads before you read this book.

  6. #6
    Join Date
    Sep 2003
    Location
    New York
    Posts
    494
    Guys?

    Could anybody confirm the right code, please?

    Boris
    - AdWatcher - From the founders of HostVoice, comes the first ad management and tracking service created with web hosts in mind. Track Google AdWords, Overture, hosting directories, local advertising, etc. Compatible with ModernBill, WHM AutoPilot, ClientExec, PayPal, 2CO and others.
    - Pay Per Click Marketing Book - Don't spend another dollar on PPC ads before you read this book.

Posting Permissions

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