473,321 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

HTTP and CGI

First and foremost, allow me introduce myself.
I am an active duty United States Marine stationed in Georgia. I have been a hobbyist programmer for the better part of my life, and my language of choice is usually Java. I hope that much suffices as an introduction.

Anyways let's get to my problem, which may very well have a simple solution that I keep overlooking..

I started writing a simple HTTP server a while ago, but over time I added bits and pieces of functionality. Right now I am trying to pass cookies from a CGI script (php, perl, etc) to the server, which will then send the Set-Cookie header to the client. Basically what I want to know is how does the cookie go from... say... the setcookie function in PHP to the header in the server.

I also would like to apologize if I posted in the wrong section. This is the only one which really looked feasible to me.
Oct 29 '08 #1
9 2350
RedSon
5,000 Expert 4TB
Maybe the HTML guys can help? If this is the wrong spot, someone ping me and I'll redirect it yet again.
Oct 30 '08 #2
Has nothing to do with HTML at all really
This could apply with something as small as simple text output or perhaps binary output, depending on the script..

...Thanks for the reply though.

Let me try to re-explain...It's hard to follow my train of thought at times.
I can parse data from the server application to the CGI scripting application (ie perl) but I can not do the opposite (send data from the CGI scripting application to the server).

Basically I send information to the CGI program but I cannot find a way to have the CGI program send information (like cookies, headers, etc) to the server.
Oct 31 '08 #3
drhowarddrfine
7,435 Expert 4TB
If you are writing your own server, then you do that with a print function to standard out which should be directed to the network. Just like you should start the header as "HTTP /1.1" and all that afterwards, in that header is the cookie information, such as "cookie: 12345-blah-blah-blah".

I don't know if I'm in the ballpark of the question.
Oct 31 '08 #4
If you are writing your own server, then you do that with a print function to standard out which should be directed to the network. Just like you should start the header as "HTTP /1.1" and all that afterwards, in that header is the cookie information, such as "cookie: 12345-blah-blah-blah".

I don't know if I'm in the ballpark of the question.
Pretty close...I already have the "cookie: 12345-blah-blah-blah" part down...What I need to do is get a CGI script to get the server to send specific headers such as "set-cookie: 12345-blah-blah-blah" if that makes any sense.
Oct 31 '08 #5
David Laakso
397 Expert 256MB
Pretty close...I already have the "cookie: 12345-blah-blah-blah" part down...What I need to do is get a CGI script to get the server to send specific headers such as "set-cookie: 12345-blah-blah-blah" if that makes any sense.
Do you have an html/css question that you would like to resolve?
Oct 31 '08 #6
RedSon
5,000 Expert 4TB
So you are using your own server instead of Apache or IIS?

We have some Apache experts to help you to config the server for cgi I could move this there.
Oct 31 '08 #7
I could give the source code to my webserver if you like...this isn't an HTML/CSS question nor is it really an apache question, however an apache expert could possibly answer it.
Nov 1 '08 #8
David Laakso
397 Expert 256MB
So you are using your own server instead of Apache or IIS?

We have some Apache experts to help you to config the server for cgi I could move this there.
Please move it. The OPs question has nothing to do with HTML/CSS afaik.
@RedSon
If you blink at me one more time, I will totally freak out, if not have a full-blown seizure.
Nov 1 '08 #9
Markus
6,050 Expert 4TB
-- Moving.
Nov 1 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
8
by: turnit \(removethis\) | last post by:
I have a login form that uses the post method to carry the information to the next page. The form works just fine in ie6.0, but fails in mozilla and fails in ie5.2 on a mac. "HTTP/1.1 400 Bad...
3
by: ashesdesign | last post by:
Hi All, I am very new to php and even newer to XML. Can anyone please shed some light on how to post XML requests via HTTP. I have been searching high and low and have come across many...
5
by: David Lozzi | last post by:
Howdy, I wrote a web service in .Net for my customer. My customer has another vendor who now has to consume it but they are not using Visual Studio. Most of their pages are jsp, and they said...
4
by: Bob Badger | last post by:
Hi, Simple question (although I guess with a complicated answer). Is HTTP an async protocol? For instance, if I send a message to a c# webservice via http what is the protocol actually doing? ...
1
by: zpinhead | last post by:
I am unable to get my downloaded extension from pecl to link up with php properly. seems like the php.so I could not use pear install http. pear claimed the extension was already installed....
3
by: webEater | last post by:
Hey, I am writing a file that reads in an external file in the web and prints it out including the response header of the http protocol. I do this to enable cross domain XMLHttpRequests. I...
1
by: rpjd | last post by:
I am completely new to this so please bear with me here. My project involves a webpage executing php scripts via an xmlhttprequest which queries a database and returns data to the webpage. This code...
1
by: rpjd | last post by:
I am having a problem getting the http.status of an xmlhttprequest. The request readystate has come back as readystate 4, but then it stops without confirming the http.status. Any help appreciated....
16
by: Harry Simpson | last post by:
I've been away from ASPNET - I open up a new Web app in VS2008 and go into properties and select to use IIS instead of the personal web server. Then I run in debug mode and it says I have to set...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.