sarah
10-10-2002, 06:28 PM
Hi
How do you read / write to a file using php?
I have an excel sheet which has Five columns.
ID Number | Name | Description | Image | Selected
I have various products for which I have ID numbers, product names, product descriptions, product images, and selected - (this is if a product has been selected). The default value of selected is always "0".
I want to read the excel sheet when the PHP page is loaded and enter the data from the excel sheet into the PHP page.
E.g
Products page will have 10 images of products available. A user selects the first product and clicks "Next". On the next page only the selected products' details will show up (ID number, Product Name, Product Description and the image of the Product).
Is this possible or do I have to export the file into a text file? If I have to export into a text file, can I still achieve this using a text file?
Also if a product is selected and the user proceeds with the transaction, I don't want any other user to be able to select the same product. Is it possible to write to the excel/text file and update the value of selected to = "1", so that when the user or any user refreshes the products page, the excel/text file is read and data of products with selected value="0" are only entered into the PHP page. (Have I confused anyone yet? - LOL)
Any examples, urls that u guys can point out to me will be greatly appreciated.
Thanks
Luv Sarah
How do you read / write to a file using php?
I have an excel sheet which has Five columns.
ID Number | Name | Description | Image | Selected
I have various products for which I have ID numbers, product names, product descriptions, product images, and selected - (this is if a product has been selected). The default value of selected is always "0".
I want to read the excel sheet when the PHP page is loaded and enter the data from the excel sheet into the PHP page.
E.g
Products page will have 10 images of products available. A user selects the first product and clicks "Next". On the next page only the selected products' details will show up (ID number, Product Name, Product Description and the image of the Product).
Is this possible or do I have to export the file into a text file? If I have to export into a text file, can I still achieve this using a text file?
Also if a product is selected and the user proceeds with the transaction, I don't want any other user to be able to select the same product. Is it possible to write to the excel/text file and update the value of selected to = "1", so that when the user or any user refreshes the products page, the excel/text file is read and data of products with selected value="0" are only entered into the PHP page. (Have I confused anyone yet? - LOL)
Any examples, urls that u guys can point out to me will be greatly appreciated.
Thanks
Luv Sarah