header location

Posted on 2006-06-02
Last Modified: 2010-04-01
I would like to convert this into c/c++

header("Location: " . $_GET['link']);

can someone help me? thanks
Question by:aplelois
    LVL 12

    Expert Comment

    >> header("Location: " . $_GET['link']);
    >> die();
    What exactly they do ?

    Author Comment

    Lets say the name is (goto.c) and when its compiled is (goto.cgi)
    so if im at index.html and I make a links I want to use them this way
    <a href="cgi-bin/goto.cgi?link=">Google</a>
    <a href="cgi-bin/goto.cgi?link=">Yahoo</a>
    the 1 links goes directly to google the 2 goes to yahoo
    the php script does that

    Author Comment

    I dont want this, intead of google I want the site
    that is in here (goto.cgi?link=

    #include <stdio.h>
    int main()

    LVL 2

    Expert Comment

    i may suggest you to use a library like libCGI :

    about a fast solution to ur problem:

    it can get big fast.
    LVL 86

    Accepted Solution

    CGI applications receive these values as environment variables. Just use

    #include <stdio.h>
    int main()

       printf("Location:%s\n\n", getenv("QUERY_STRING"));

    and it will print


    See also ("CGI Environment Variables")

    Author Comment

    yes, jkr that is what I was looking for. thanks

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
    Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
    The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
    The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now