Results 1 to 4 of 4
  1. #1

    Question Need Help with simple script!!!

    Hi all,

    Can someone please help me... I KNOW NOTHING about PHP, and normally program with ASP. The problem i have, is simple, I need to create a redirect page. However the server it is for, Will not support asp, and only supports php... The details are as follows...

    A person enters the address,

    http://www.mydomain.com/members?ID=000565

    The page reads that info and sends the user automatically to

    http://www.mydomain.com/cgi-bin/view.cgi/000565/index.html

    That is it...

    IN ASP the script would be as follows
    *****************************
    <%
    dim members
    members = request.querystring("ID")
    Responce.redirect("http://www.mydomain.com/cgi-bin/view.cgi/" & members & "/index.html")
    %>
    *****************************

    simple... however i need it is php, can someone help me...

    I look forward to your replies...

    Keith

  2. #2
    Join Date
    Nov 2001
    Posts
    857
    PHP Code:
    <?
      $header_location 
    "Location: http://www.mydomain.com/cgi-bin/view.cgi/" $ID "/index.html";
      
    header($header_location);
      exit;
    ?>
    <?
    header("Location: http://www.hostevolve.com/");
    ?>

  3. #3
    Thank you very much, will try that this evening

  4. #4
    Join Date
    Jun 2002
    Location
    Sherbrooke, Québec
    Posts
    182
    Make sure there are not spaces/returns before <? or after ?> so that nothing is sent before header information. If you do, you will get a message such as "Header already sent"

Related Posts from theWHIR.com

Posting Permissions

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