Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: unable to pass data

by cord-bin (Friar)
on May 22, 2014 at 14:45 UTC ( #1087110=note: print w/replies, xml ) Need Help??

in reply to unable to pass data

There are few mistakes that should be corrected in your scripts. Your CGI script should receive through the param() function the information sent from your first script that is parsing the xml file. Your xml parse is ok, I tested:
Platon$ ./ Frank Sanbeans 3/10 Sandy Sanbeans 4/15
Your CGI script should be the one you call from this:
my $server_endpoint = "http://localhost/cgi-bin/stackoverflow_in.cgi";
stackoverflow_in.cgi should be the name of your second perl file. This code is wrong:
my $sth = $dbh->prepare(qq{INSERT INTO cust_details.c_details(f_name,l +_name,dob_email) VALUES ('$customer->{first_name}->[0]','$customer->{ +last_name}->[0]','$customer->{dob}->[0]','$customer->{email}->[0]')}) +;
You should use the param() function go get the passed data from the first program. You don't have access to $customer->{last_name}... here! You could pass data in the first script with names like
my $firstname = param('firstname'); my $lastname = param('lastname');
And then get it to the second CGI script for the insert in sql.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1087110]
[Discipulus]: shmem i'm searching it.. but failing i was sure was in Re: Let's Make PerlMonks Great Again! -- suggestions and dreams
erix recommends Vanished Kingdoms
[Corion]: shmem: Yeah, something like that. Not that that would be a solved issue. Simply process all events that come in from a single interface sequentially. Ah well.
[Discipulus]: their

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2017-05-23 08:31 GMT
Find Nodes?
    Voting Booth?