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
cgi_redirect_uri(3)						     cgi/cgi.h						       cgi_redirect_uri(3)

NAME
cgi_redirect_uri - send an HTTP 302 redirect response SYNOPSIS
#include <cgi/cgi.h> void cgi_redirect_uri (CGI *cgi, const char *fmt, ...) ATTRIBUTE_PRINTF(2,3); ARGUMENTS
cgi - cgi struct fmt - printf style format with args DESCRIPTION
cgi_redirect_uri will redirect the user to another page on your site. This version takes the full URL, including proto- col/domain/port/path. As with all printf style commands, you should not call this with arbitrary input that may contain % characters, if you are forwarding something directly, use a format like cgi_redirect (cgi, "%s", buf) RETURN VALUE
None SEE ALSO
cgi_debug_init(3), cgi_parse(3), cgi_destroy(3), cgi_js_escape(3), cgi_html_escape_strfunc(3), cgi_register_strfuncs(3), cgi_output(3), parse_rfc2388(3), cgi_url_validate(3), open_upload(3), cgi_cs_init(3), cgi_url_escape_more(3), cgi_html_strip_strfunc(3), cgi_neo_error(3), cgi_redirect(3), cgi_filehandle(3), cgi_register_parse_cb(3), cgi_url_escape(3), cgi_init(3), cgi_redirect_uri(3), cgi_cookie_clear(3), cgi_url_unescape(3), cgi_vredirect(3), cgi_display(3), cgi_html_ws_strip(3), cgi_error(3), cgi_cookie_set(3), cgi_text_html_strfunc(3), cgi_cookie_authority ClearSilver 12 July 2007 cgi_redirect_uri(3)
All times are GMT -4. The time now is 08:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy