![]() |
How do I do this using CGI ?
I have a web page that generates a string of hexadecimal characters when the surfer is browsing and I want to store them in a text file.
EG. http://mydomain.com/cgi.pl?AAC7EE What I want to do is append a text file and add the "AAC7EE" or any other string after the ? to the file. Any help is appreciated. |
store the query string in a $variable
open a txt file and write the $variable in it |
Quote:
I already have the webpage that generates the text string I just need to know how to save all the info after the ? to a file when they click the link. |
Which language are you trying to write it in?
|
Quote:
|
Quote:
It used to be stored in a mysql database but this is no longer possible. Whilst the surfer is browsing a string of data is generated and appears after the ? in their browser, I don't care how its done but I need to store that information in a plain asci file. I was hoping this to be just 3 or 4 lines of CGI code |
Code:
#!/usr/bin/perl |
Quote:
|
Quote:
print "<b>hello there</b>"; to print to the browser....just remember the semicolon to terminate the statement and to "escape" things like a quotation mark: print "<a href=\"./dir/index.html\">home</a>"; see... add a backslash before the quotation mark: \" |
It don't appear to be working, for some reason when I click the link I get redirected to my 404 page!!!
I used unix format when I uploaded the script and set the test.pl file and the file.txt to 666 (chmod) |
You need to chmod the test.pl to 755 if it's not set to that already. Show the link and I'll see what might be happening. You can also check your error log files to see what might be happening to.
|
probably has something to do with your directory not allowing a cgi type file. so it rejects the file and redirects you a la .htaccess
well, that's my guess...any others? |
Quote:
Thanks for the help peeps I can get on with saving the world now :) |
Quote:
:thumbsup |
Quote:
|
Quote:
|
and that aching feeling in your nuts like you can't sit still when it just won't fucking work
|
Quote:
|
All times are GMT -7. The time now is 07:07 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123