jimojeda
06-30-2004, 10:44 AM
Hello Amigos!
I'm facing a challenge that I hope someone here can help me with.
I need a simple cgi script that can take the contents of a post to my site and display them as a web page.
Nothing too fancy, just something simple.
Here's what I mean...
After my client buys from me, my CC processor redirects all info back to my site via the GET method.
Some of the variables in the query string are:
bill_name
amount
orderid
options1
... and so on.
When the person is redirected back to my site, the address bar displays something like:
http://www.mysite.com/cgi-bin/file.cgi?bill_name=John+Doe&amount=7.95&orderid=12345&description=Miracle+Widget
What I'd like the file.cgi to do is to be able to get each of those variables and print out an HTML page that says something like:
*********
Dear John Doe,
Thanks for ordering the Miracle Widget!
Remember that your order ID is: 12345
and you paid only $7.95 for it.
Thanks again and I hope you enjoy your
new Miracle Widget!
**********
Now, since the query string has a "+" for every time there is more than one word, the script needs to be able to convert that "+" into a space. That way, the HTML page won't read, "Miracle+Widget". Instead it should read, "Miracle Widget".
One more thing... If possible, could you add a little security so that if someone tries to access the "file.cgi" by typing it into the browser, it gives them some kind of "access denied" error. It should only be accessible after a successful post from the processor.
Well, that's it, if you're up for the challenge or if you know someone else who can help me, please ask them to post their solution here.
Thanks for your time and kind consideration.
Sincerely,
Jaime Ojeda
I'm facing a challenge that I hope someone here can help me with.
I need a simple cgi script that can take the contents of a post to my site and display them as a web page.
Nothing too fancy, just something simple.
Here's what I mean...
After my client buys from me, my CC processor redirects all info back to my site via the GET method.
Some of the variables in the query string are:
bill_name
amount
orderid
options1
... and so on.
When the person is redirected back to my site, the address bar displays something like:
http://www.mysite.com/cgi-bin/file.cgi?bill_name=John+Doe&amount=7.95&orderid=12345&description=Miracle+Widget
What I'd like the file.cgi to do is to be able to get each of those variables and print out an HTML page that says something like:
*********
Dear John Doe,
Thanks for ordering the Miracle Widget!
Remember that your order ID is: 12345
and you paid only $7.95 for it.
Thanks again and I hope you enjoy your
new Miracle Widget!
**********
Now, since the query string has a "+" for every time there is more than one word, the script needs to be able to convert that "+" into a space. That way, the HTML page won't read, "Miracle+Widget". Instead it should read, "Miracle Widget".
One more thing... If possible, could you add a little security so that if someone tries to access the "file.cgi" by typing it into the browser, it gives them some kind of "access denied" error. It should only be accessible after a successful post from the processor.
Well, that's it, if you're up for the challenge or if you know someone else who can help me, please ask them to post their solution here.
Thanks for your time and kind consideration.
Sincerely,
Jaime Ojeda