Gossamer Forum
Home : General : Perl Programming :

In Search Of A Script

Quote Reply
In Search Of A Script
Hi,
I'm after a script which does somethign like this:

From mysite.com/links.shtml?Text+To+Go+In+Text+Box (Should have pluses between each but the board removes them)
or .pl?Text+To+Go+In+Text+Box

I wanted a script to make it so the text after the ? appear in a text box, or prints on the page.
I'm sure it can't be that hard, I just can't find the right words to search for it.
Thanks in advance for any help :)

Last edited by:

Matty: Sep 9, 2001, 1:30 PM
Quote Reply
Re: In Search Of A Script In reply to
Well you can't do it with .shtml unless you have Embperl or EPerl installed.

With perl.....

#!/usr/bin/perl

use CGI qw(:standard);

my $text = $ENV{QUERY_STRING};
$text =~ s/\+/ /g;

print header;

print qq|<textarea>$text</textarea>|;

Last edited by:

PaulWilson: Sep 9, 2001, 1:35 PM
Quote Reply
Re: In Search Of A Script In reply to
I hate to ask this cos I'll sound really pathetic, probably cos I am.
I have very little perl experience, the best I have managed is downloading and chmoding :]
Any chance you could tell me what to do with that, how to put it into a file, or where i could find a pre-made script
Thanks Again

Last edited by:

Matty: Sep 9, 2001, 1:47 PM
Quote Reply
Re: In Search Of A Script In reply to
Quote:
how to put it into a file, or where i could find a pre-made script

You don't know how to cut and paste into a file?

That is a pre-made script :)

Just paste it into a file and call it whatever.cgi

Chmod it to 755 after uploading it to your server

Then visit the URL of the file in your borwser like:

http://www.myurl.com/cgi-bin/whatever.cgi?This+is+some+text

Quote Reply
Re: In Search Of A Script In reply to
I thought I tried doing that and it didn't work so I assumed it would have to be part of a bigger file. Oh well it works now,
Thanks alot :]
Quote Reply
Re: In Search Of A Script In reply to
Hi,
One other thing, one day hopefully I won't have to ask, but school gets in the way (or thats my excuse)

Can you tell me how to include an html file at the top and bottom of this, or just write in html, like in an shtml file. I've seen it in other scripts but copying and pasteing what they did doesn't seem to work :[
Hopefully by the time my next problem comes along I will have learnt some of the language and i'll attempt it on my own :]
Quote Reply
Re: In Search Of A Script In reply to
Under print header; you can cut and paste your html. Just make sure it is within print qq| |;

eg.....

print header;

print qq| html code here |;

textarea code...

print qq| html code here |;