473,626 Members | 3,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing data from PHP to Perl?

Thanks in advance for any help. I'm looking for a way to pass data
from php to perl. Basically, I want to take some dynamic data from a
database, mixed with user input, then reformat it to make a new set of
variables and pass those variables to a perl script to do all the hard
work.

Anyway, I can handle the database connectivity, and putting variables
together, but how do I pass the variables to perl?

I have seen other comments on this, but many suggest bringing the data
back to php to print out. Unfortunately, the output is more than text
- it includes pictures. So obviously, I need the perl script to output
as if it was called from a browser.

I really want to avoid any intermediate pages if possible.

Thanks,
Shane

Jul 17 '05 #1
9 2776
wrote:
Thanks in advance for any help. I'm looking for a way to pass data
from php to perl. Basically, I want to take some dynamic data from a
database, mixed with user input, then reformat it to make a new set of
variables and pass those variables to a perl script to do all the hard
work.

Anyway, I can handle the database connectivity, and putting variables
together, but how do I pass the variables to perl?

I have seen other comments on this, but many suggest bringing the data
back to php to print out. Unfortunately, the output is more than text
- it includes pictures. So obviously, I need the perl script to
output as if it was called from a browser.
You can't. A page with pictures are at least 2 objects from a browser's
point of view, so you can't return 2+ objects as one object (unless you
render the page to one object yourself).
I really want to avoid any intermediate pages if possible.


You either return data to PHP, or you have the PHP program redirect you
to the perl program. You can't have something in between.

I would drop PHP all together. You can do the database connectivity in
Perl, etc. Or the other way around. What is it you can do in Perl but
can't in PHP ( ok, not loosing time on bad documentation and weird side
effects ).

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Jul 17 '05 #2
I could code it in perl, but PHPis soooo easy to manipulate anything
from a database, and I want to create many interfaces to this perl
program in the future, so if this is possible, I could potentially save
myself a lot of time working with PHP.

Now when you say "Have the PHP program redirect you to the perl
program", that sounds a lot like what I want to do. The problem is
passing the variables as if they were form data to the perl script.
Any thoughts? Or am I dead in the water?

Thanks for the help!

Shane

Jul 17 '05 #3
wrote:
I could code it in perl, but PHPis soooo easy to manipulate anything
from a database,
*ROTFLMAO*

since when? And since when is that hard in Perl?
and I want to create many interfaces to this perl
program in the future, so if this is possible, I could potentially save
myself a lot of time working with PHP.

Now when you say "Have the PHP program redirect you to the perl
program", that sounds a lot like what I want to do. The problem is
passing the variables as if they were form data to the perl script.
Any thoughts? Or am I dead in the water?


redirect to http://example.invalid/cgi-bin/yours...1=value1&name2
=value2&etc.

But note that if the images also need to be dynamically generated that you
need more weird redirecting.

Please read the documentation of CGI.pm, DBI etc. and save yourself a lot
of troubles.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Jul 17 '05 #4

John Bokma wrote:
wrote:
I could code it in perl, but PHPis soooo easy to manipulate anything from a database,
*ROTFLMAO*


Okay, so I'm just too lazy to dust off my perl books ;-)
redirect to http://example.invalid/cgi-bin/yours...1=value1&name2 =value2&etc.


Yeah, but you can't pass more than 2,038 characters that way, right?.
We're talking about (potentially) a lot of data.

I guess I'll just use perl and save the headaches. Thanks for the
help.

Shane

Jul 17 '05 #5
JDS
On Tue, 08 Mar 2005 17:44:20 -0800, google_nospam wrote:
I could code it in perl, but PHPis soooo easy to manipulate anything
from a database, and I want to create many interfaces to this perl
program in the future, so if this is possible, I could potentially save
myself a lot of time working with PHP.

Now when you say "Have the PHP program redirect you to the perl
program", that sounds a lot like what I want to do. The problem is
passing the variables as if they were form data to the perl script.
Any thoughts? Or am I dead in the water?

Thanks for the help!

Shane


Instead of HTTP redirects which will get complicated, try serializing the
information somehow. Save it to a plaing text file in serialzed form. Use
XML, WDDX, or something like that.

http://www.devshed.com/c/a/Perl/Using-Perl-With-WDDX
http://us4.php.net/wddx

I don't know what happened to WDDX exactly, but it looks dead. Even so,
it can still be useful.

As for XML, you're on your own. Good starting place:
http://us4.php.net/manual/en/ref.xml.php
--
JDS | je*****@example .invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Jul 17 '05 #6
wrote:
John Bokma wrote:
wrote:
> I could code it in perl, but PHPis soooo easy to manipulate anything > from a database,
*ROTFLMAO*


Okay, so I'm just too lazy to dust off my perl books ;-)


Dust off CPAN then.
redirect to

http://example.invalid/cgi-bin/yours...1=value1&name2
=value2&etc.


Yeah, but you can't pass more than 2,038 characters that way, right?.


Depends on server afaik. I wouldn't rely on it.
We're talking about (potentially) a lot of data.


Then certainly don't move it between PHP and Perl. You can POST it to Perl,
and give the result back via PHP, but just don't do that.
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Jul 17 '05 #7
JDS wrote:
On Tue, 08 Mar 2005 17:44:20 -0800, google_nospam wrote:
I could code it in perl, but PHPis soooo easy to manipulate anything
from a database, and I want to create many interfaces to this perl
program in the future, so if this is possible, I could potentially
save myself a lot of time working with PHP.

Now when you say "Have the PHP program redirect you to the perl
program", that sounds a lot like what I want to do. The problem is
passing the variables as if they were form data to the perl script.
Any thoughts? Or am I dead in the water?

Thanks for the help!

Shane
Instead of HTTP redirects which will get complicated, try serializing
the information somehow. Save it to a plaing text file in serialzed
form. Use XML, WDDX, or something like that.


Ouch: file locking etc.
http://www.devshed.com/c/a/Perl/Using-Perl-With-WDDX
http://us4.php.net/wddx

I don't know what happened to WDDX exactly, but it looks dead. Even
so, it can still be useful.

As for XML, you're on your own. Good starting place:
http://us4.php.net/manual/en/ref.xml.php


SOAP, XML-RPC?

Perl does that quite easily. Guess PHP too.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Jul 17 '05 #8
JDS
On Fri, 11 Mar 2005 03:36:51 +0000, John Bokma wrote:
Depends on server afaik. I wouldn't rely on it.


Depends on browser, actually. At least the 2038 charcter number

--
JDS | je*****@go.away .com
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Jul 17 '05 #9
JDS wrote:
On Fri, 11 Mar 2005 03:36:51 +0000, John Bokma wrote:
Depends on server afaik. I wouldn't rely on it.


Depends on browser, actually. At least the 2038 charcter number


I am sure every server has a limit, could be it's higher than 2038
(technically it can also be trimmed down by the OS, since it's passed in an
environment variable).

But the most important thing: don't do it.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Jul 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5794
by: Romuald Favre | last post by:
Hi there, I just installed Perl (v. 5.6.1. built for MSWin32 from ActiveState) on a new server Windows 2000. Amazingly the passing of arguments doesn't work ! I saved the following code in a file saved in "test.pl" : #!/bin/perl -s
1
9586
by: Joe | last post by:
I am trying to write a Perlscript to be used with some HTML pages. Here is how it works: 1.. The first HTML page has a form which requests for user input. Then it passes the QUERY_STRING to a Perl script. 2.. The Perl script will then validate the data. If input validation fails, it returns to the previous screen and asks the user to retry. If the validation passes, it display the user input and asks for confirmation.
2
1975
by: Matthew | last post by:
I've been trying to find a way to gather up data contained in a table or tables on a previously generated html page in order to send it to a cgi for further processing. Ideally this would scrape the page for the tables' data (or even just those tables with more than 2 rows and 2 columns) in a way that could be sent to the cgi using a form. Thanks for any help or pointers in the right direction.
26
45497
by: Dave Hammond | last post by:
In document "A.html" I have defined a function and within the document body have included an IFRAME element who's source is document "B.html". In document "B.html" I am trying to call the function defined in "A.html", but every attempt results in an "is not a function" error. I have tried to invoke the function using parent.document.funcname(), top.document.funcname(), and various other identifying methods, but all result in the above...
2
1351
by: patsman77 | last post by:
Hello All, I am trying to pass records to a mysql database, but it is only passing 1 record... What I have so far, is it pulls selections from database, calculates weather the selection is a winner or a loser or a tie, prints out to the screen correctly, but when posting the results to the database, it only sends the first record, and not all the records even though they calculated. Hope fully someone can give me some assistance on this...
1
7182
KevinADC
by: KevinADC | last post by:
Introduction In part one we discussed the default sort function. In part two we will discuss more advanced techniques you can use to sort data. Some of the techniques might introduce unfamiliar methods or syntax to a less experienced perl coder. I will post links to online resources you can read if necessary. Experienced perl coders might find nothing new or useful contained in this article. Short Review In part one I showed you some...
3
7326
KevinADC
by: KevinADC | last post by:
If you are entirely unfamiliar with using Perl to sort data, read the "Sorting Data with Perl - Part One and Two" articles before reading this article. Beginning Perl coders may find this article uses unfamiliar terms and syntax. Intermediate and advanced Perl coders should find this article useful. The object of the article is to inform the reader, it is not about how to code Perl or how to write good Perl code, but to teach the Schwartzian...
11
2028
Kelicula
by: Kelicula | last post by:
Hey everyone! I am back. I have a script that handles the private messaging for a site I am working on and I created a subroutine to handle the sending of a message. I want to check if the "to" field was left blank, contains a user name that doesn't exist or has invalid characters in it. Everything worked fine, until I integrated the sending of messages to multiple recipients. What I did was create another subroutine to "prepare" the...
3
8063
by: vijayarl | last post by:
Hi all, i have perl script, which is used to send mail. its a command line utility. if we run this perl script in command line by passing all it's required arguments, it works very well.there no issues. my problem is : am just call this perl script by using "system" command inside the another perl script. ie, mail.pl --contains:
0
8707
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8366
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5575
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4202
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1812
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.