Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 31st, 2001, 02:55 AM
kinghobo kinghobo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Posts: 12 kinghobo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Using HTML Hyperlinks to start a Perl Script

I have written a Perl script to convert ringtones for my web site, it takes input as follows

Nokring:d=16,o=5,b=63:c,32p,c,32p,c,g,4p,g,32p,g,8d#,48d.,48d#.,48d.,32p,c,32p,c,32p,c,g,4p,g,32p,g, 8d#,48d.,48d#.,48l.,32p,48c.,32p,48c.,48c.,32p,48c.,48c.,32p,d,48d#.,32p,d,48d#.

The problem is I want the script invoked from a text hyperlink so I have the HTML code as follows

<a href="http://www.ringtones4all.com/cgi/nok2eric.cgi?nokring=Nokring:d=16,o=5,b=63:c,32p,c,32p,c,g,4p,g,32p,g,8d#,48d.,48d#.,48d.,32p,c,32p, c,32p,c,g,4p,g,32p,g,8d#,48d.,48d#.,48l.,32p,48c.,32p,48c.,48c.,32p,48c.,48c.,32p,d,48d#.,32p,d,48d# .">
Ericsson</a></td>

When I run the perl script in Dsofts Perl editor(which by the way is a great program) it works ok, when I run it on the web it reads in Nokring:d and then stops at the =

I have tried enclosing the string in Quotes (single and Double) any ideas

My only other idea was to use a form to submit the data using a field but I want the link that invokes the script to be ran from a text link rather than a submit button

Any ideas ???

Mike

Reply With Quote
  #2  
Old May 31st, 2001, 10:16 AM
mullaney mullaney is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 0 mullaney User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Consider using different characters for the equals sign (maybe an X) in your link and then in your perl script use something like...

$var =~ tr/X/=/;

...to get your equals signs back if your script requires them. I know this isn't the most elegant solution, but perhaps it will be simple enough to serve your needs. Good luck.

Bob

Reply With Quote
  #3  
Old May 31st, 2001, 11:47 AM
footinmouth footinmouth is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: North Vancouver, BC, Canada
Posts: 44 footinmouth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Cool A GET syntax

I am guessing you wish to format the data into a GET .

The GET must be URL encoded to work on the web. I am expect your software interprets this like command line data, so it works.

To create a url encoded string try this:

Make an HTML form with method=get and add all your named inputs and their values.

Submit this to a cgi that will just respond. Now look at your Url bar , does this contain your get info. If so you will see a URL encoded string conataining all your name / value pairs.

Else search for a URL Variables on the web and manually substitute the characters.......

Good Luck Foot in Mouth ver 1.00

Reply With Quote
  #4  
Old June 1st, 2001, 02:42 AM
kinghobo kinghobo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Posts: 12 kinghobo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for this, becasue I want the links to appear as a peice of text in a table I have just done the simple substition which has worked fine

I guess sometimes the simplest solutions are the easiest and are overlooked

thanks again

Mike

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Using HTML Hyperlinks to start a Perl Script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT