if this post is easy to read so is to reply !!!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting if this post is easy to read so is to reply !!!
# 1  
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!
# 2  
Old 10-30-2011
Please follow forum rules...
1. No duplicate post is tolerated (https://www.unix.com/shell-programmin...ays-empty.html)
2. Use code tags
3. Have better post titles

I am NO CGI expert, so can't help you...
btw... where is the code for pxuser?... its commented here... looks like coming from inputs... $2?

--ahamed
# 3  
Old 10-30-2011
that's what i am asking what to write to get username hope u can read my initial post
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

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

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

6. 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

7. 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
Login or Register to Ask a Question