troubleshooting Question

Edit Flatfile with PHP

Avatar of tomrector
tomrectorFlag for United States of America asked on
PHP
5 Comments1 Solution331 ViewsLast Modified:
I want to use php to replace data in a flatfile. (sorry about the format below, just paste to notepad for clarity):
my flat file is foramted as a CSV with the 'pipe' as the delimiter instead of a comma
each row is a 'record' with unique record numbers, "ID"
the rowdata is identified by column names at the top.  Total file is 1600 lines long.

|ID|Item|Qty|Cate|Price4|Price1|Price5|Price6|Price7|Out|Due|Name|Total|avail|image|safety|
|2101|12 ft Utility Trailer|1|Trailer||30.00 |75.00 |45.00 |150.00 |||||Yes|Image2101.png|2101_S.pdf|
|2102|16 ft Utility Trailer|1|Trailer||35.00 |87.50 |52.50 |175.00 |||||Yes|Image2102.png|2101_S.pdf|
|2103|2 Person Tent|1|Camping||6.00 |15.00 |9.00 |30.00 |||||Yes|Image2103.png||
|2104|2 Person Tent|1|Camping||6.00 |15.00 |9.00 |30.00 |||||Yes|Image2104.png||
|2105|24ft -29ft Travel Trailer|1|Camper||70.00 |175.00 |105.00 |350.00 |||||Yes|Image2105.png|2105_S.pdf|

etc...

I want to update the the 'avail' colmun  with "NO", the 'Name' column with a "name" and the Out and Due cols with a date
 (the 'change' data is gathered from a form passed to the script by using unique record number 'ID').

I have used the following in the past, but does not work withg my hosting provider now.

$arg = "http://www.mysite.com/cgi-bin/RentUpdate1.pl?ID=$ID_1&action=save&password=''&avail=No&Name=$LName&Due=$DueItemA";
require ($arg);

 I would appreciate any direction, I prefer to do it from same php script.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros