Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^9: INSERT file contents inside a table

by poj (Abbot)
on Jun 07, 2018 at 06:21 UTC ( [id://1216079]=note: print w/replies, xml ) Need Help??


in reply to Re^8: INSERT file contents inside a table
in thread INSERT file contents inside a table

If you mean by clicking this link

<td><a href=/cgi-bin/release.pl>$id</a></td>

then you need to add the id as parameter

<td><a href=/cgi-bin/release.pl?release=$id>$id</a></td>
poj

Replies are listed 'Best First'.
Re^10: INSERT file contents inside a table
by theravadamonk (Scribe) on Jun 07, 2018 at 11:45 UTC

    yeah, U r right.below code is OK. it's what I mean. But, I need YES and NO option after clicking for safety purpose. Anyway, It's my NEXT TASK.

    <td><a href=/cgi-bin/release.pl?release=$id>$id</a></td>

    My IDs r in below formats

    spam-IUiA-_bUe0eN.gz

    badh-Xh-Vzy9BSsHN

    banned-8KuHlZuzBCaA

    virus-gUS5QeJ_ayqZ

    So, I had to changed the below code. It has UNDERSCORE as well

    if ($id =~ /^spam-[a-zA-Z0-9-]+\.gz$/) {
    to
    if ($id =~ /^spam-[a-zA-Z0-9-_]+\.gz$|^badh-[a-zA-Z0-9-_]+|^banned-[a- +zA-Z0-9-_]+|^virus-[a-zA-Z0-9-_]+/) {
    also changed
    my $cmd = "sudo /usr/bin/amavisd-release $id 2"; <code> to <code> my $cmd = "sudo /usr/bin/amavisd-release $id";

    Now, code WORKS well. Many thanks once again. UNLESS u helped me, I may NOT achive what I expect. hope to hear from you

      Your additions to the regex make it unsafe because they are not terminated with $.Try

      #!perl use strict; my @ids = qw( spam-IUiA-_bUe0eN.gz badh-Xh-Vzy9BSsHN banned-8KuHlZuzBCaA virus-gUS5QeJ_ayqZ virus-gUS5QeJ_ayqZ;stopme ); for my $id (@ids){ if ($id =~ /^(?:spam|badh|banned|virus)-[a-zA-Z0-9-_.]+$/) { print "OK : $id\n"; } else { print "ERROR : Invalid id '$id'\n"; } }
      poj

        Thanks a lot.

        here's the OUTput of the code

        OK : spam-IUiA-_bUe0eN.gz OK : badh-Xh-Vzy9BSsHN OK : banned-8KuHlZuzBCaA OK : virus-gUS5QeJ_ayqZ ERROR : Invalid id 'virus-gUS5QeJ_ayqZ;stopme'

        it's OK

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1216079]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-25 15:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found