CGI. Define a new param

Posted on 2011-05-10
Last Modified: 2013-12-25
Is there anyway to manually add to the form data that has been submitted?

What I do is check the cookie and the form data submitted. if a data element is missing I want to add it before feeding the existing form data to subroutines.

i.e. the field TEST is missing. I want to assign a default value of 123

since you can't "$ar->param('TEST')=123;"... it is undefined and you can define an un editable varialble is there any way to modify the form data either before or after $ar = Apache2::Request->new($r); ?

use Apache2::Request ( );
use Apache2::Cookie;
use URI::Escape;
my $r = shift;
my $cookies = Apache2::Cookie->fetch($r);
my $ar = Apache2::Request->new($r);
Question by:Bob-Villa
    LVL 26

    Accepted Solution

    I don't know about Apache2::Request but the syntax looks similar to CGI and, in CGI, you can do:

    $ar->param('TEST', 123);

    I would try that and see if it works in AR.
    LVL 9

    Expert Comment

    by:Suhas .
    This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Join & Write a Comment

    It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
    This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
    Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
    Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now