flat assembler
Message board for the users of flat assembler.

Index > Heap > CGI howto easy way to redirect

Author
Thread Post new topic Reply to topic
Braz



Joined: 06 Aug 2014
Posts: 1
Braz
Please, show me easy way to redirect query to another host
or how do you pass query string in cgi
Linux 32
Thanks!
Post 06 Aug 2014, 05:41
View user's profile Send private message Reply with quote
redsock



Joined: 09 Oct 2009
Posts: 360
Location: Australia
redsock
This message seems pretty vague and not really fasm related, but since this board has been an invaluable resource to me, I can't let it go unanswered.

CGI simply means that your binaries get run with extra webserver environment variables. Before you bother writing assembler to do it, simple redirectors in bash would be a good starting point IMO. The equivalent assembler isn't difficult, but your question makes it seem like you don't have a solid handle on basic CGI handling to start with.

Code:
#!/bin/bash

echo "Location: http://board.flatassembler.net?q=${QUERY_STRING}" && echo
    
Post 07 Aug 2014, 19:55
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
IMHO, the best way is to respond with one of HTTP 3xx codes: 301, 302 or 303.
The response will look like:
Code:
HTTP/1.1 302 Found
Location: http://your.url/    


P.S. BTW this topic have to be moved to the heap.
Post 08 Aug 2014, 08:48
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.