Send and recieve text from a server
Posted: Sat Aug 05, 2006 11:35 am
Hi,
I'm a somewhat experienced PHP programmer, but have just been faced with a task I can't figure out. I'm supposed to send a single line of text to a server at a given URL, and get its reply for use in my page.
To help you understand better, this is the background:
I am a TA at a university and I'm attempting to implement a system for posting student grades. The university's rules on Internet grade posting require that you have students authenticate using a university-assigned username and password, and then you can pull grades for them based on their username.
You have to create an HTML form whose action attribute is the login server and with a hidden input field of the page you want the login page to return the user to. They log in, and a special cookie is given to the browser. Then they are sent back to the return address.
So you're back to your original page, except now you have this cookie. It contains a hash code. Then you have to send this hash code to another server, and it will reply with the student's username.
That's the part I can't figure out how to do. Just send a line of text to a URL, and I guess wait for a reply. Then put the reply into a variable and use it. How do I do that?
I am posting here because I am on a tight schedule and I have already tried asking officials at the University but they take weeks to get back to you, which I do not have.
I'd appreciate any help on this problem. Thanks!
-Mike
I'm a somewhat experienced PHP programmer, but have just been faced with a task I can't figure out. I'm supposed to send a single line of text to a server at a given URL, and get its reply for use in my page.
To help you understand better, this is the background:
I am a TA at a university and I'm attempting to implement a system for posting student grades. The university's rules on Internet grade posting require that you have students authenticate using a university-assigned username and password, and then you can pull grades for them based on their username.
You have to create an HTML form whose action attribute is the login server and with a hidden input field of the page you want the login page to return the user to. They log in, and a special cookie is given to the browser. Then they are sent back to the return address.
So you're back to your original page, except now you have this cookie. It contains a hash code. Then you have to send this hash code to another server, and it will reply with the student's username.
That's the part I can't figure out how to do. Just send a line of text to a URL, and I guess wait for a reply. Then put the reply into a variable and use it. How do I do that?
I am posting here because I am on a tight schedule and I have already tried asking officials at the University but they take weeks to get back to you, which I do not have.
I'd appreciate any help on this problem. Thanks!
-Mike