Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Problems Of PHP Script Running Perl Program With Spreadsheet::ParseExcel Module


My php script is to call perl scipt which makes use of
Spreadsheet::ParseExcel module to parse Excel file. I am able to launch
php script from command line so that perl script can run and properly
parse Excel file. However, when I put php script on server side and
then launch php through client request, perl program can't run.




View Complete Forum Thread with Replies

Related Forum Messages:
PHP Running Exec() Windows Program Very Slow In Comparison To UNIX Equivalent Program
Does anyone have an explanation or solution for the following.
I have a PHP script that uses exec() to call a program to do certain
calculations.

The UNIX version of this program I call runs in about 4 to 5 seconds.
When I run the same PHP script using exec() to call the Windows equivalent
of this same program on my Windows desktop, it takes about 32 seconds....

View Replies !
Exeucte A Perl Program Via Http
because currently when i execute the perl program it does run on the background while if i call the program via php using system command it does not execute in background.

View Replies !
Using Proc_open To Write To A Perl Program
I'm using proc_open to write to a perl program. Sometimes (not always) the fwrite function below takes about 10 seconds to complete. Most of the time it takes about 0.001 seconds. I don't know what could cause this strange problem. Does anyone have a clue of where to start looking:

$xml = "<xml>...</xml>";
$start = array_sum(explode(' ', microtime()));
$process = proc_open(HOME_DIR . "/perl.pl", $descriptorspec, $pipes);
print (array_sum(explode(' ', microtime())) - $start);
fwrite($pipes[0], $xml);
print (array_sum(explode(' ', microtime())) - $start);

View Replies !
Running A Module Twice
I've got a voting script that's a little too simple. I can vote as as many times as I can click on the link in my browser. I'n not trying to write an official voting system but I would like to do something as simple as catching the user's IP address and
remembering it for a time interval. That has it's own problems, but it would at least prevent double clicks. I can get the IP #, but how do I store it on a server? I can do a flat file or something.

View Replies !
Running Perl-script
i created a perl-script that returns a string and i want to run that script from php to get the value of that string for further processing.

View Replies !
Calling PHP Email Program From A Perl Script
After i finish some amount of computation using a perl script, i need
to send out an email to a receipient which can change and is known to
the Perl script. Is there a way to call the email.php(the php program
to send out the email) passing to it the recipient email ID, from the
perl script?

View Replies !
Running External Perl Script
I wish to run an external perl script from one of my php pages. To run the script from the command prompt I use text_cat.pl -l "This is some sample text"

How do I run this from a php script? I have used shell_exec but this loads an external command prompt window, is there a way to hide this window?

View Replies !
Running Program
I have a program called "rlx" that takes two arguments and writes a file. The command line could be "~/rlx file b" and it executes correctly from shell. What it does is to write a file to webserver/rlx/file.dat. The permission for the program rlx is 755, the permission for the dir rlx is 777, and the text output from the program after having run it is correct. (It displays the filename and other data). Code:

//Commandline tried are all these, just one of them in the real code of course:
$commandline = "/home/me/rlx/rlx file b";
$commandline = "/../../rlx/rlx file b";
// since above didnt work, i tried to copy the program file to the web directory, renaming it to rlx2 so it doesnt have the same name as dir
$commandline = "rlx2 file b";
$commandline = "/.rlx2 file b";

// one of following in the real code of course
exec($commandline);
system($commandline);
shell_exec($commandline);

View Replies !
Is DOMXML Module Unstable When Running On The Server?
I have signed up to a hosting company and every now and again some of
my websites fail because DOMXML has been uninstalled or is not running
properly on the server. Is this a common thing with hosting companies
supporting DOMXML or is this a serious lapse in competence from my
provider?

View Replies !
Check To See If A Program Is Running
Is there any specific way to check to see if a certain program is up and running? Like I want something to pop up only if program ****.exe is running.

View Replies !
Exec() - Running An External Program From Inside PHP.
I'm having difficulties running an external program from inside PHP. I'm trying to create thumbnails using ImageMagick's convert utility using the following program: PHP Code:

View Replies !
Cannot Remove Module Mod_php5.c: Not Found In Module List
Today I see in my apache error log file an entry 'Cannot remove module mod_php5.c: not found in module list'. Anybody any idea where this is located or where I get this php5.c file or why this shows up since today in my error log file?

Everthing still seems to work well except the anoying error entry.

View Replies !
ENV Variables In Perl Scripts Called From Perl.
I have a perl script in which I am using a ReadParse routine that parses the
$ENV{'QUERY_STRING'} or $ENV{'CONTENT_LENGTH'}*which are two variables passed
to the script under usual SSI (.shtml) containing form data submitted to the
page from which the script is executed from. Code:

View Replies !
What Is Apache Module And What Kind Of Module It Has?
I'm planning to make apache module.
I made php code. but it's too slow to handle requests for my project.
So i'm thinking if i replace php code to c and make apache module
then it maybe much faster.

upon above idea I have three questions.
1. Is it really worth to replace php code to c and make as apache
module?
2. It seems like that apache has two kind of module. One looks like
*.c and the
other is *.so.
If i regard that *.c is being compiled together with apache code
and *.so is exactly same as shared library then my idea is right or
there can be more difficult concept?
3. when the php is running as cgi does apache call php.exe and php.exe
interetes *.php file?

View Replies !
Warning: Invalid Argument Supplied For Foreach() Running On A OS X Machine Running Apache 1.x And PHP 4.x.
The following script was running on a OS X machine running Apache 1.x and PHP 4.x. I just moved the script over to a Linux machine running Apache 2.0.51 and PHP 4.3.8, and now the foreach line does not work. It says Warning: Invalid argument supplied for foreach()

in /var/www/localhost/htdocs/warehouse/whse_order_submit.php on line 39

Here is the script:

<?php
//get the variables from the other page
$id=$_POST['id_no'];
$sku=$_POST['sku'];
$description=$_POST['description'];
$order=($_POST['order_qty']);
$store=$_POST['store'];
$comment=$_POST['comment'];

$ip=$REMOTE_ADDR;

//check if store is empty
if(empty($store)) {
die("Store is required. Please press the back button and enter in your store.");
}

//connect to the database
require('../inc/database_conn.php');

//$month=getdate(mon);
//$day=getdate(mday);
//$year=getdate(year);
//$today=$year . "-" . $month . "-" . $day
$today=date('Y-m-d');

// create the unique order number

$headerqry = "INSERT INTO misc_order_header (order_date, store, comment, ip) VALUES ('$today', '$store', '$comment', '$ip')";

mysql_query($headerqry, $conn) or die(mysql_error());
$order_no=mysql_insert_id();
foreach($order_qty as $id_no => $val) {
if($order_qty[$id_no] > 0) {
$detailqry = "INSERT INTO misc_order_detail (order_no, id_no, sku, order_qty, order_date, store) VALUES ('$order_no', '$id_no', '$sku', '".$order_qty[$id_no]."', '$today', '$store')";
mysql_query($detailqry, $conn) or die(mysql_error() . "<BR>" . $detailqry);
}
}

View Replies !
2>&1 Arg In Exec(perl.... + "sh: /perl Not Found Error" TIA For Help
I have the following line in a php file:

$msg= exec("perl $scriptPath/insert.pl $d $u $t 2>&1", $returnVal);

Can someone explain the "2>&1" argument?


Second problem, this same line of code when run from the unix command line
returns the following error:

sh: /perl: No such file or directory

I've verified that perl is located in /usr/bin/
/usr/bin is in the environment variable "PATH"
all the directories from php program to the root and back down to usr/bin
have 755 permissions.
if I run the program (insert.pl) from the command line it works
I've tried putting the following in both the php and perl programs:
#!/usr/bin/perl
#!/usr/bin

View Replies !
Spreadsheet
I'm trying to print out mysql table data into excel. I found code on
web but it outputs everything into one cell instead of spacing out on
spreadsheet. I have no clue how to fix.

<?PHP
$result = mysql_query("SELECT * FROM $db_table3");
$count = mysql_num_fields($result);

for ($i = 0; $i < $count; $i++){
$header .= mysql_field_name($result, $i)." ";
}

while($row = mysql_fetch_row($result)){
$line = ''
foreach($row as $value){
if(!isset($value) || $value == ""){
$value = " ";
}
else
{
# important to escape any quotes to preserve them in the data.
# needed to encapsulate data in quotes because some data might be
multi line.
# the good news is that numbers remain numbers in Excel even though
quoted.
$value = $value . " ";
}
$line .= $value;
}
$data .= trim($line)."
";
}
# this line is needed because returns embedded in the data have "
"
# and this looks like a "box character" in Excel
$data = str_replace("
", "", $data);
# Nice to let someone know that the search came up empty.
# Otherwise only the column name headers will be output to Excel.
if ($data == "") {
$data = "
no matching records found
";
}
# This line will stream the file to the user rather than spray it
across the screen
header("Content-type: application/octet-stream");
# replace excelfile.xls with whatever you want the filename to default
to
header("Content-Disposition: attachment; filename=excelfile.xls");
header("Pragma: no-cache");
header("Expires: 0");
echo $header."
".$data;
?>

View Replies !
Excel Spreadsheet
I'm going to be starting a project for a client and they want a MS Excel spreadsheet generated from data from a PHP form and a MySQL database.

View Replies !
Forms To Spreadsheet
If i fill out a online form that I made how can I get it to transport
values to an excel Spreadsheet?

View Replies !
Excel Spreadsheet To DB? Possible?
I'm currently doing some work for a client and he would like to have me add a feature in his CMS to let him upload a excel spreadsheet from time to time that will update the DB allowing clients to sign in and view their individual inventory.

Simple enough. The problem I'm having is what exactly do I need to run to get the excel to post to the DB? Another thing is he wants it set up so if the account number for a certain client in the spreadsheet isn't already in the db to add a new row and if the client info is in the db to just update the inventory row?

View Replies !
Parsing Excel Spreadsheet To Db
What would one best recommend to parse an existing Excel spreadsheet (was
done in Excel 97 or 2000 not sure to be honest)? I am looking for the most
practical way of parsing an existing spreadsheet to place contents into a
mySQL db.

View Replies !
Using PHP To Read XL Spreadsheet Files?
Is there a simple way to read the content of uploaded Microsoft XL
spreadsheet files?

View Replies !
Output To Spreadsheet - How To Use Format?
I use OpenOffice but I suppose similar formatting rules apply to MS Excel.
For example, to format a cell for two digit numbering, the format code is:

#,##0.00

I can use formulas (=F$temp + 5) and there's likely a way to write
formatting strings in the output code, I just need a little help.

My code is fairly typical to export to spreadsheet:
//get data from database
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename="my-data.xls"");
$data = "";
$temp = 0;
foreach($r as $row) {
$temp++;
$data .= $row['data1'].",".$row['some_number'].",=F$temp + 5
";
};
echo $data;

View Replies !
Want To Get Data From Google Spreadsheet
I want to fetch the data from google spreadsheet any one can help........

View Replies !
Excel Spreadsheet Validation
i am creating an application in which users can download and upload an xls file in order to interact with the database.  the download option will give them a spreadsheet that is partially filled with data.  some cells however will be blank, which they will fill in, then upload the spreadsheet for the data to be parsed and added into the database.

my question is... when a user attempts to upload a spreadsheet, how can i validate that it was previously downloaded from my application?  i want to make it so that the only spreadsheets that will be accepted via upload, are ones that were generated by my application.  how can i do this?

View Replies !
Generating A Spreadsheet Form
Is there a way to generate a spreadsheet form embedded in HTML? or is there a way to retrieve information entered in an excel spreadsheet embedded in HTML.

View Replies !
Extract Data From Spreadsheet
I need help with extracting data from a spreadsheet, such as an excel file and importing that data into a static html file. I don't want to import the whole file into one page, want specific information on specific lines and to import that data to thepage/product it belongs to on an individual bases.

The main issue is that I have pricing information in an excel format that updates fairly often. There is around 10,000 products total, and updating is a nightmare. I want to insert a line of code into each product page that will extract the relevant prices from the spreadsheet for that product. The order and line number is always the same for the spreadsheet and each line is specified by a product ID number.

View Replies !
Can I Read An Excel Spreadsheet?
Is it possible to read cells from an Excel spreadsheet, and what is the
code for this?

View Replies !
Creating Excel Spreadsheet
I found this PHP class that creates an Excel spreadsheet.  I am trying to use the script as described in the tutorial but it's not working for me.  Could someone help me figure out why my variables show up as zeros in the outputted Excel spreadsheet, but if I were to echo these same variables they have other values?  I have tried contacting the author and the site that hosts the tutorial, but no go.  I'm hoping someone here can help me, please.

Here's the relevant parts of my script that I run via the command line....

View Replies !
Interview An Excel Spreadsheet?
I have a client who'd like to update a few lists of data in their primary format (Excel). I don't really want to employ a database as the job is not well paid and I'd like to make it simple as possible for them.

So I wonder if there is a PHP (.asp?) method of interviewing an excel spreadsheet - so that my client can make changes to the spreadsheet, upload it and any pages that reference one or more table cells are updated too.

I'm guessing I will need additional software on the server... It seems to me to be a very clunky way of doing things but as I say I need 'quick and dirty' - the simpler the better.

View Replies !
Open Document Spreadsheet
I am to use a ODS (open document spreadsheet) to dynamically update some content on a page. Does anyone know of a class that will read ODS? if I could just convert the spreadsheet to an array would be great.

View Replies !
Reading A Particular Record From Excel Spreadsheet
I would like to read a particular record from excel spreadsheet.
For Example:A Shopping Cart.The data in database and excel sheet are
same,but if a user clicks on a particular product say productid:23456
then he can only see that data from excel spreadsheet,though there are
other records but no need to show other records. If anyone knows the solution for this please pm me or reply to this message.

View Replies !
Is PHP Able To Extract Data Out Of An Excel Spreadsheet?
The only form of database we use is an Excel database.
Otherwise is it possible to import the relevant spreadsheet data
into say MySQL?

Perhaps it is possible but does anyone know how or point me
in the right direction.

View Replies !
Transfer Data From An Xls Spreadsheet Into A Table
Is there any way I can transfer data from an excel spreadsheet to my table?? Example:
I have an .xls spreadsheet called hello.xls and it has 5 columns with hundreds of rows of data in it. I want to copy all this data to my table instead of copying line by line which will take me eternity. I have a table called hello which has the same 5 columns.

View Replies !
Is Anybody Porting New Version Of Spreadsheet-WriteExcel To PHP?
there is a new(er) version of John McNammara's Excel package for Perl:

http://homepage.eircom.net/~jmcnama...l-0.49.7.tar.gz

The package writes Excel97 instead of Excel5, it has e.g. no longer
the 255 char's limit for one cell etc.

See:
http://homepage.eircom.net/~jmcnama.../excel97_7.html

View Replies !
Extract Data From Excel Spreadsheet
Firstly, users will upload the excel spreadsheet with information. Then, i would like to extract all information then insert into the existing database.

In addition, all the information uploaded by the users will overwrite the existing data in the table.

From what i know, it is possible to do so. however i have no idea how to start.

View Replies !
Read Images/graphics In Spreadsheet
I have to read images from spreadsheet, is it possible to do with php?

View Replies !
Putting Mysql Data Into An Excel Spreadsheet
I want to take data from a MySQL database and stick it into an Excel Spread sheet so the speadsheet is upto date and with data format intact. any easy way to do this?

I don't want to just drop data into the spread sheet. Diffent bits have to go in different places. Basicly the fields names arn't going to be the colum names ect.

View Replies !
Searching For Serial Numbers That Don't Match In A Spreadsheet
I have a list of serial numbers. One has more serial numbers than the other and I need to identify the units that do not match. Can someone explain a simple way to identify these units?

View Replies !
Can't Insert Spreadsheet Edited In Linux With PHP Script
I have no idea if this is a Linux issue or PHP. Looking for clues here.

I have a PHP script which I use to upload a CSV spreadsheet into a
mySQL database. (The script follows here in a sec.)
I was using WindowsXP and MS Excel to take these sheets, edit it if
needed, and save it in text based CSV. Then use the PHP script to
upload it and insert into the DB.

Now I've eschewed Windows and am using Fedora Core 3. I've tried doing
the same thing I always do, but with Open Office, and I've tried with
Gnumeric and KSpread, and I save it as CSV, but for some reason the PHP
script no longer properly uploads. It acts as if it's an empty file.

I don't think it's file folder or structure issue, because I'll edit it
in one of the three programs and then copy it to a WindowsXP machine
and upload it with the script and I get the same problem.

If I edit it and save it in CSV in MS Excel and then open it in
Notepad, I get proper lines with proper carriage returns in the right
places. If I edit it in a Linux program and then open it in an ASCII
editor it also looks just fine, but if I open it in Windows Notepad,
there carriage returns are in odd places and there's little squares
indicating a hidden or binary character here and there. Weird!

a) Is there anything I can do in one of the Linux programs (preferably
Open Office Calc) to save it properly in ASCII only CSV with proper

carriage returns? or
b) Anything I can do in the PHP to compensate for whatever the Linux
programs are doing to the CSV?

Thanks for any help!!
Here's the PHP:

$uploaddir = '/var/www/html/home/accounts/trackfiles/'
$upfilename = $_FILES['csvfile']['name'];
$uploadfile = $uploaddir . $upfilename;
move_uploaded_file($_FILES['csvfile']['tmp_name'], $uploadfile);
$change_perm = escapeshellcmd("/bin/chmod a+rw -R
/var/www/html/home/accounts/trackfiles");
exec("$change_perm 2>&1", $output);

// INSERT SPREADSHEET DATA INTO DATABASE
$sql = "LOAD DATA INFILE '".$uploadfile."' INTO TABLE `".$tbl."` FIELDS
TERMINATED BY ','".
"OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '
'".
"(".$fields.")";
$result = @mysql_query($sql, $dbconn) or die("Couldn't query DB: " .
mysql_error());

View Replies !
Html Form Results To Excel Spreadsheet
This sounds like overkill, but is there any way I can take the results of an html form, and plug them into their respective cells on a excel spreadsheet?

View Replies !
Advanced Email / Excel Spreadsheet Writer
I have to run a script that generates a report into an excel document then emails the document simultaneous to the user with the spreadsheet attached! Although it needs to write a document for each users specific details in the database and mail that user his specific spreadsheet with his details in! Heres a sample of what im trying to do. Code:

View Replies !
How To Export Data From An Excel Spreadsheet To Database
I have a query regarding how to export data from an excel spreadsheet to a mysql database, by using PHP. I have created the upload form functionality, which enables the excel spreadsheet to be uploaded on to my webserver. But from there on I am confused as to how I can start getting the data extracted from the excel spreadsheet and in to a mysql database table.

View Replies !
Pear Spreadsheet Writer - Writing 0 Byte File
When I try examples from the docs, it writes out a 0 byte *.xls file. For
example:

View Replies !
Email / Excel Spreadsheet Writer Part Of Previous
I have to run a script that generates a report into an excel document then emails the document simultaneous to the user with the spreadsheet attached! Although it needs to write a document for each users specific details in the database and mail that user his specific spreadsheet with his details in! Heres a sample of what im trying to do. Sorry forgot to mention in the previous post that the part that i cant get working at all is how to mail the document while the scripts runs all that happens now is it open an asks whether i want to save the document. If im going about this all wrong an there is an easier or better way please advise.

require_once 'Spreadsheet/Excel/Writer.php';
$sql = "select distinct agent from leads";
$qry = mysql_query($sql, $conn);
$workbook = new Spreadsheet_Excel_Writer();
$workbook->send('liveleads.xls');
$worksheet =& $workbook->addWorksheet(liveleads);
$worksheet->write(0, 0, 'agent');
$worksheet->write(0, 1, 'leadID'); // all leads for that agent
$worksheet->write(0, 2, 'contactperson'); // all contacts that agent has
while($array = mysql_fetch_array($qry)) {
$i = 1;
$sql2 = "select * from leads where agent = $array[agent]";
$qry2 = mysql_query($sql2, $conn);
     
        while($array2 = mysql_fetch_array($qry2)){
               $worksheet->write($i, 0, $array[agent]);
               $worksheet->write($i, 1, $array[leadID]);
               $worksheet->write($i, 2, $array[contactperson]);
               $i++;


         }
mail($array[email],"subject"etc.......");
}
$workbook->close();

#so basically i need to loop through the agents get the leads that belong to the specific agent
#then write an excel document for each agent listing his specific leads
#then mail each agent with his specific document attached containing his leads while the script runs

View Replies !
How To Call *.exe Program From Php Program
I have a php program, and from that program I wanna call C program that counts number of visitors on my page.

This is a piece of my program:

View Replies !
Two Sessions: Session A By A Program Destroys Session B By A Program
I have two separate programs that I want to use together on a website
Program A starts first and calls session_start(). Program B is started by the user clicking on a link and it also calls session_start(). The session started by program B blows away the session started by program...

View Replies !
Sessions? External Program / External Program
I am trying ac ouple of days now to learn some things on SESSIONS,but I think I am not getting it very clearly. I have a PHP page tha contains a form.

Users enter data in the form, which are then written in a file (the file is created at the time a user enters some data) The file is then given as an input to an external program The external program runs and gives some results which are then stored in another file (that is created when the external program finishes) What I want to do is to somehow create these files and, when the user exits from the browser, then both files that refer to this user, will be deleted. Code:

View Replies !
PHP Vs. Perl/Mod Perl
Age old question which program language is better PHP or PERL with MOD PERL.

Depends on that application? Well how about if we examine this application:

A website that has 1000s of concurrent users all with their own session. A website that is dynamically generated via a database.

Now I know with PHP there is the advanced ZEND optimizers / engines - that help in some areas.

What about PERL / MOD PERL? Do they have such a thing?

Support: The amount of PHP usage on the net is prolific - even this message board runs on PHP. Even if we compare the PERL post to the PHP post there is a difference of 10 to 1 in favour of PHP.

Thanks so much!

View Replies !
PHP Vs Mod Perl
I'm doing some research on different programming languages, and I'm looking for some help! I apologize in advance if my questions seem naiive, but I'm not a programmer, and I am approaching this from the business side of things.

I work with a company that has an existing site using mod perl to process subscriber information and a number of other high-volume items. We need to add significant new functionality quickly and we are considering using PHP. My questions are:
1) is is possible to have mod perl and PHP coexist so we do not have to re-do the work that we've already done
2) what makes PHP better than mod perl
3) are there speed issues using some of the existing web email applications such as IMP or Endymion

View Replies !
Which Is The Best, Perl Or PHP?
I am a totally new comer for server side scripting
and I want to learn it because of its high functionality.
Which language is best to begin with? Perl or PHP?

View Replies !
PHP To Perl/CGI
I have somewhat of dilemma. I have created a php script for a client that works fine if executed manually but now he wants it as a cron job.
i don't have any problem creating a cron job, but apparently i can't call my php script, i have to call perl and cgi.
I thought you could call any file under a UNIX server. PHP Code:

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved