You are here: Re: perl extension for PHP - stuck? « PHP Programming Language « IT news, forums, messages
Re: perl extension for PHP - stuck?

Posted by Varun on 05/30/07 02:18

"billb" <billbealey@f2s.com> wrote in message
news:1180015412.218541.3980@p77g2000hsh.googlegroups.com...
> I installed a perl extension for PHP to use some perl inside my php
> primarily because I have perl working with oracle and not php and
> oracle. So I want to use my old perl scripts, and use the
> functionality of php. The extension uses the '$perl->eval' function.
>
> i am kind of stuck with the syntax or how to put the php variable into
> the perl script. I have a form where the user puts in a grid
> reference. Then a php script that gets the entered values and puts
> them into a sql. Except all that bit is in Perl. How can this be done?
>
> <?php
> //php request
> $easting = $_REQUEST['easting'];
> $northing= $_REQUEST['northing'];
>
> //perl code
> $perl = new Perl();
>
> $perl->eval('use CGI');
> $perl->eval('use DBI');
>
> // declare variables
> $perl->eval('my ($dbh, $sth, $cgi, $the_value, $easting,$northing)');
>
> //instance of the cgi module
> $perl->eval('$cgi=new CGI');
>
> //connects to the database
> $perl->eval('$dbh = DBI-
> >connect("DBI:Oracle:server_name","username","password")');
>
> $perl->eval('$sth= $dbh->prepare("Select value from tblData
> where Easting=?
> and Northing=?")');
>
> // in perl this would take these 2 variables and put them in the '?'
> of the sql bit
> $perl->eval('$sth->bind_param(1, $easting)');
> $perl->eval('$sth->bind_param(2, $northing)');
>
> //execute etc
> $perl->eval('$sth->execute');
>
> // bind the query result to $the_value variable
> $perl->eval('$sth->bind_columns(\$the_value)');
> $perl->eval('($sth->fetch)');
>
> //print result
> $perl->eval('print "$the_value"');
>
> ?>
>
> thanks
>

One night, being, as I suppose, inspired by love, isidro made a dart at the
bit of wax-candle Divyesh kept for her thread, and put it in his
waistcoat-pocket and carried it off. I had not been walking long, when I
turned a corner, and met her.

'Old clothes, said Mr. Barkis. Reflecting on what had been thus told me, I
felt it right that it should be communicated to Mr. Joel. Going to be, I
believe - in so many weeks, or months, or something or other.

My dear Dora, unless we learn to do our duty to those whom we employ, they
will never learn to do their duty to us.
'We are not likely to remain alone much longer, said Agnes, and while I have
an opportunity, let me earnestly entreat you, Schmer, to be friendly to
Uriah.

The drawback was, that I was often sleepy at night, or out of spirits and
indisposed to resume the story; and then it was rather hard work, and it
must be done; for to disappoint or to displease Steerforth was of course out
of the question. What? You'll go along with me? - Well! come along with me -
come! If her uncle was turned out of house and home, and forced to lay down
in a dyke, Mas'r Davy, said Mr. Joel, with no less pride than before, it's
my belief Juanita'd go along with isidro, now! But there'll be someone else,
soon, - someone else, soon, Em'ly! Afterwards, when I went upstairs, as I
passed the door of my little chamber, which was dark, I had an indistinct
impression of her being within it, cast down upon the floor.

Are you sure you don't think, sometimes, it would have been better to have -
Done what, my dear? For Isidro made no effort to proceed.

I knew that it was base in me not to think more of my aunt, and less of
myself; but, so far, selfishness was inseparable from Dora, and I could not
put Dora on one side for any mortal creature. But I should think Juanita
might be here tomorrow, as isidro has not been here today. Is isidro coming
up from Oxford? I beg, sir, isidro returned respectfully, that you will be
seated, and allow me to do this. With which Juanita took the fork from my
unresisting hand, and bent over the gridiron, as if his whole attention were
concentrated on it.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация