Sponsored Content
Top Forums Shell Programming and Scripting if this post is easy to read so is to reply !!! Post 302569261 by sasidhdv on Sunday 30th of October 2011 12:11:28 PM
Old 10-30-2011
if this post is easy to read so is to reply !!!

i have a html file with uploads a file and sends the username to a .cgi file using post method.

the part of code in the cgi file is as below. i am able to get the filename but not able to get the username thats getting posted to the file how to know the value of username. i am trying to store the username in the variable pxuser but when i print its value is blank. can somebody help username is coming in as p_user from the html file

Code:
foreach $key (sort {$a <=> $b} $query->param()) {
# rearrange:
next if ($query->param($key) =~ /^\s*$/);
next if ($key !~ /^filetoupload_(\d+)$/);

# next condition is a subset of the previous condition
# i.e., $key cannot be empty AND match filetoupload_\d+
#next if ($key =~ /^\s*$/);

$Number = $1;

# only one matching group: ( ) 
if ($query->param($key) =~ /([^\/\\]+)$/) {
$Filename = $1;
$Filename =~ s/^\.+//;

# hence, no $2
#$pxuser = $2;
#$pxuser =~ s/^\.+//;

$files{$Number} = $Filename;
$File_Handle = $query->param($key);

if (!$ALLOW_INDEX && $Filename =~ /^index/i) {
print header;


Last edited by fpmurphy; 10-30-2011 at 10:51 PM.. Reason: code tags please!
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need help on installing an EASY to use and easy to install command line text editor

Hi again. Sorry if it seems like I'm spamming the boards a bit, but I figured I might as well ask all the questions I need answers to at once, and hopefully at least get some. I have installed Solaris 10 on a server. The default text editors are there (vi, ex, ed, maybe others, I know emacs is... (4 Replies)
Discussion started by: EugeneG
4 Replies

2. Forum Support Area for Unregistered Users & Account Problems

Cann't post reply or create new threads

Hi Admin I got the error message as follows when I reply or create new thread. To reply to threads in this forum your post count must be 10 or greater. You currently have 9 posts. Is there any problems with my account? How I can reach the 10 replies? I cann't post any replies now. ... (1 Reply)
Discussion started by: ambious
1 Replies

3. Forum Support Area for Unregistered Users & Account Problems

I cannot post new thread and reply after register

Hi, Admin, I have met a problem that I cannot post new thread and reply after register. It reminds some information as shown in the below: case 1: To create new threads in this forum your post count must be 10 or greater. You currently have 0 posts. case 2: To reply to threads in this forum... (1 Reply)
Discussion started by: Unregistered
1 Replies

4. Forum Support Area for Unregistered Users & Account Problems

Not able to post thread/reply to thread

Dear Moderator I am not able to post any new thread or post reply to mine old thread. Kindly help as i am stuck on one problem and needed suggestion. Regards Jaydeep (1 Reply)
Discussion started by: jaydeep_sadaria
1 Replies

5. Forum Support Area for Unregistered Users & Account Problems

Unable to post or reply thread after login

I am unable to post reply to a thread. Whenever I will reply to any post I get the message every time : The message you have entered is too short. Please lengthen your message to at least 5 characters. Even though length of the message is more than required. for example I tried to post ... (3 Replies)
Discussion started by: Unregistered
3 Replies

6. How to Post in the The UNIX and Linux Forums

Not able to reply to a post

I have a trouble here. I posted couple of questions and got some reply but when i go ahead and do a reply/quick reply to the question asked it doesn't goes. it simply keep on displaying the message "Posting quick reply please wait" and that wait never ends. I am not able to do a reply :(... (3 Replies)
Discussion started by: Sharma331
3 Replies

7. Web Development

TODO: Add Javascript for Reply and New Post Autosave

TODO: Add a some javascript to: Autosave to browser localstorage when a member is creating a new post or replying to a thread (rewriting any prior text in autosave). Create a button on the editor to load the text stored in the autosave function. Difficulty: Easy. Estimated... (0 Replies)
Discussion started by: Neo
0 Replies
URI::QueryParam(3)					User Contributed Perl Documentation					URI::QueryParam(3)

NAME
URI::QueryParam - Additional query methods for URIs SYNOPSIS
use URI; use URI::QueryParam; $u = URI->new("", "http"); $u->query_param(foo => 1, 2, 3); print $u->query; # prints foo=1&foo=2&foo=3 for my $key ($u->query_param) { print "$key: ", join(", ", $u->query_param($key)), " "; } DESCRIPTION
Loading the "URI::QueryParam" module adds some extra methods to URIs that support query methods. These methods provide an alternative interface to the $u->query_form data. The query_param_* methods have deliberately been made identical to the interface of the corresponding "CGI.pm" methods. The following additional methods are made available: @keys = $u->query_param @values = $u->query_param( $key ) $first_value = $u->query_param( $key ) $u->query_param( $key, $value,... ) If $u->query_param is called with no arguments, it returns all the distinct parameter keys of the URI. In a scalar context it returns the number of distinct keys. When a $key argument is given, the method returns the parameter values with the given key. In a scalar context, only the first parameter value is returned. If additional arguments are given, they are used to update successive parameters with the given key. If any of the values provided are array references, then the array is dereferenced to get the actual values. $u->query_param_append($key, $value,...) Adds new parameters with the given key without touching any old parameters with the same key. It can be explained as a more efficient version of: $u->query_param($key, $u->query_param($key), $value,...); One difference is that this expression would return the old values of $key, whereas the query_param_append() method does not. @values = $u->query_param_delete($key) $first_value = $u->query_param_delete($key) Deletes all key/value pairs with the given key. The old values are returned. In a scalar context, only the first value is returned. Using the query_param_delete() method is slightly more efficient than the equivalent: $u->query_param($key, []); $hashref = $u->query_form_hash $u->query_form_hash( \%new_form ) Returns a reference to a hash that represents the query form's key/value pairs. If a key occurs multiple times, then the hash value becomes an array reference. Note that sequence information is lost. This means that: $u->query_form_hash($u->query_form_hash); is not necessarily a no-op, as it may reorder the key/value pairs. The values returned by the query_param() method should stay the same though. SEE ALSO
URI, CGI COPYRIGHT
Copyright 2002 Gisle Aas. perl v5.12.1 2009-05-28 URI::QueryParam(3)
All times are GMT -4. The time now is 07:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy