This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Convert CSV to XML with PHP - When the data.csv is outside from the folder xml file is empty  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I moved the 'data.csv' to other place location it will not save the 'xml-import.xml' on my computer. The code only works if the CSV file 'data.csv' is in the same folder with convert.php (name of my PHP script) but if you moved the data.csv to different location, the 'xml-import.xml' are not save.

All I need is even if you move the data.csv files from different location the 'xml-import.xml' also save. Is that possible?

 
Ranch Hand
Posts: 724
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it is a file upload php script, the file name that is loaded would not be captured by $_POST['fname'] but would be hidden in $_FILES. Maybe it is after all not a file upload script, but a script allowing the client to give instruction to transform the csv to an xml. In any case, you said it works in some condition, I take your words for it.


If this is the line where you intend to set up for the case where the uploaded csv file is at some other (sub-directory), this is certainly not to work. You cannot even to take profit from the interpolation using double-quote as such without further twist for the purpose, as for $value.

Using it would be closer to a solution.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!