![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Jun 2003
Location: AssTown
Posts: 674
|
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.
__________________
I sale lube |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Mar 2002
Location: Mass Ass
Posts: 5,294
|
store the query string in a $variable
open a txt file and write the $variable in it |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Confirmed User
Join Date: Jun 2003
Location: AssTown
Posts: 674
|
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.
__________________
I sale lube |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Jan 2002
Location: In the walls of your house.
Posts: 3,985
|
Which language are you trying to write it in?
__________________
"Every normal man must be tempted, at times, to spit on his hands, hoist the black flag, and begin slitting throats." --H.L. Mencken |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Confirmed User
Join Date: Jul 2003
Location: Grand Central
Posts: 2,948
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Join Date: Jun 2003
Location: AssTown
Posts: 674
|
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
__________________
I sale lube |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Jun 2003
Location: Lutz, FL
Posts: 1,022
|
Code:
#!/usr/bin/perl print "Content-type: text/plain\n\n"; if ($ENV{'QUERY_STRING'}) { open(FILE, ">>file.txt") || die (print "$!\n"); print FILE $ENV{'QUERY_STRING'} . "\n"; close(FILE); }
__________________
Clips4Sale.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Confirmed User
Join Date: Jun 2003
Location: AssTown
Posts: 674
|
Quote:
![]()
__________________
I sale lube |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Join Date: Jul 2003
Location: Grand Central
Posts: 2,948
|
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: \" |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Join Date: Jun 2003
Location: AssTown
Posts: 674
|
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)
__________________
I sale lube |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Join Date: Jun 2003
Location: Lutz, FL
Posts: 1,022
|
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.
__________________
Clips4Sale.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Join Date: Jul 2003
Location: Grand Central
Posts: 2,948
|
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? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | |
Confirmed User
Join Date: Jun 2003
Location: AssTown
Posts: 674
|
Quote:
![]() ![]() ![]() Thanks for the help peeps I can get on with saving the world now ![]()
__________________
I sale lube |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 | |
Confirmed User
Join Date: Jul 2003
Location: Grand Central
Posts: 2,948
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 | |
Confirmed User
Join Date: Jun 2003
Location: AssTown
Posts: 674
|
Quote:
![]()
__________________
I sale lube |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | |
Confirmed User
Join Date: Jul 2003
Location: Grand Central
Posts: 2,948
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
So Fucking Banned
Join Date: Aug 2002
Posts: 5,579
|
and that aching feeling in your nuts like you can't sit still when it just won't fucking work
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 | |
Confirmed User
Join Date: Jul 2003
Location: Grand Central
Posts: 2,948
|
Quote:
![]() ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |