| Home | Forums | What's new | Resources | |
| A bit of perl code |
| RitualOfTheTrout - Jan 14, 2006 |
| slinga | Jan 14, 2006 | ||
| Check the permissions of the file your writing to. | |||
| dibz | Jan 16, 2006 | ||
| Why not parse the apache access log? It should have all that information. | |||
| dibz | Jan 18, 2006 | ||
| Not sure if a place like angelfire would allow that, but most places if you can view your logs you can check your own domlogs. It has pretty much exactly the same info and is better at tracking. | |||
| vbt | Jan 18, 2006 | ||
| this : <img src="/cgi-bin/log.cgi should not be allowed to run a cgi script. Why don't you try | |||
| dibz | Jan 19, 2006 | ||
| Incorrect vbt, the command you gave is to use the cgi as a server side include which is partially correct. There is no reason it needs to be ran as a server side include. If he sets the cgi to return image output and also do the logging he wants, using it in an image tag would be fine as its just like any other request, it won't technically log the exact same request, but the difference would be nill. He may need to create an .htaccess rule for it to rewrite a request for what looks like a real image like Edit: the reason it would need to be something like | |||
| RitualOfTheTrout | Jan 24, 2006 | ||
| Well after I emailed angelfire several times all of the sudden the exact code I posted above is now working agian.. hmmm seems odd One other question, when you submit a form it automatically redirects you to like a confirmation or thankyou page. I cant seem to find the code or a guide on how to write the cgi code to do that. Anyone know of a good place to find that or just know off hand a way to do it? | |||
| dibz | Jan 25, 2006 | ||
| Just have your script echo in the header: Location:http://mydomain.com/thankyou.etc... | |||
| RitualOfTheTrout | Jan 25, 2006 | ||
| Well I finally got it to work, I had print "Content-type: text/html\n"; near the start of the file for some reason so it just kept printing the url in the browser screen, took me like 2 hours to figure it out. Now, is there anyway to append text files at the begining rather than at the end? I read about Tie::File, but its not installed and I have no way of installing it. Id also like to avoid reading the entire file into memory as over time it may become large. Im just trying to make a real basic guestbook and I would like the the newest post to be the first thing in the file. Thanks for all your help everyone. | |||
| dibz | Jan 26, 2006 | ||
| How are you reading the file? Have it read it in by chunks. | |||