How Do I Edit A List Of Files Associated With A Product ?
-I wrote a script that you use it to add products in the database.
-Each product is associated with files.
-In the Form to add the product you have to enter the product name in a
textfield and below there are $no_of_add_file filefields.
$no_of_add_file is an integer that determines the Maximum number of
filefields that you want to associate/add for each product.
So it succesfully adds the product and the files in a database and the
filesystem.
The problem I am trying to solve is how am I going to edit those files in
the product.
If you know what I mean... and you have done something like that or you know
a url or script that does that, pls let me know.
What I need mostly, is not the PHP code but the logic and what are the
possible ways of doing something like that.
In the database i have two tables that this script needs:
One is the products and the other the files.
Products : product_id, product_name
Files : file_id, file_name, product_id
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Creating A Product List Page!!!!
I was able to retrieve information from the database but I get an error message that says "Notice: Undefined variable: SubCatID " and I can`t get my list to display right. I wanted my SmallIMG to be on the right and my and my ProductName to appear right beside it along with the UnitPrice. Kinda like straight across because I want it to be a link to the individual product page. If I can get help on this part, I can get started on my shopping cart. Code:
List Certain Files In A Dir
I am working on a news script were my members can post what they are currently working on. I have a dir were all of there images are going to be uploaded, and I need to know if the following is possable to do. $username = the members name selected from the database $projname = the projects name selected from the database What I want to do is select only images with the filename containing the info. The filenames are like this: TheBlackshinobi_3dmountain_1.jpg TheBlackshinobi_3dmountain_2.jpg TheBlackshinobi_3dmountain_3.jpg
List Dir And Files In Sub Dir
I am trying to make a script that list all of the files in a directory and then if the file in the directory is a sub Directory it will list the files in the subdirectory. If anybody would have a clue how to do this or where to start, please tell. Also in the end i want it to check file dates and delete them if they are older then 3 days, but i dont have a clue where to start on this.
Php Foreach Dir List Files In Dir
I've got some code to loop through a directory and it's sub directories and bring back a list of files and folders. What im wanting to do is have this in a state where i can put all info into a database so i can quickly index and then see what files are in what folders. It's all my security camera triggerd avi files. The following code will loop through an give me an array of files and folders Code:
Get A List Of Files On A Website
I need to get a list of all files in a particular virtual directory on a web site, such as - http://www.myServer.com/FileStore I tried using the directory functions, but this doesn't work. if($dirHandle = opendir("http://www.myServer.com/FileStore/")) { while(false !== ($file = readdir($dirHandle))) { print($file."<br>"); } } closedir($handle); } Is there a way to do this?
How Does One Get A List Of All Files In A Folder?
need a list of all files (i have like 5k or so) in a folder, I need to add there names to a table I am doing this so i can compare two tables table 1. comments added to uploaded pics -finished pictures- table 2. no comments added yet to uploaded pics (so they can be commented on GET IT?) -unfinished pictures- All the pictures are in a single folder for the time being i'm going to be making a form based on the pictures that are on table 2 so that they can have comments and titles and file name added to table 1 (to be done still) but i need to know all the file names for the folder in question, i guess i could do it via cmd line ls or something like that, i'll get back to you.
List Php Files In Directory.
I am creating a plugins folder that I will use to store php files. I also store other folders within that "plugins" folder. The problem I have is getting the script to read only the the .php files and skip subfolders. Plugins[main folder] ->plugin1.php ->plugin2.php ->screenshot[folder] ->downloads[folder] How to keep the script from checking the folders (screenshots, downloads..) This part of my script filters the main folder and parent but not subfolders if ($file!= "." && $file!= "..") { How do i get that code to not check subfolders.
Dropdown List Of Files In Folder
I am preparing a form that includes a drop-down list consisting of the names of files in a certain folder on the server. I only need to trap the file name (jpg), not the path and I'm not trying to upload the files or anything - simply allow the user to select one of a number of different image files (they're actually location maps).
Generating A List Of Files On Another Server
I have been messing about with the folder / file functions on the php.net website but they all seem to be for local folders. All I am trying to do is generate a list of files on another servers folder - so my variable to generate a list from would be "www.tnauk.org.uk/bbs/daily" but the script would be running on nimmox.com. Is it possible?
List Files In Directory Excluding Directories
I have the following code which I require to get the list of files in a given directory. However in that given directory I have other directories as well. I thought the second if condition was taking care of excluding the directories, but its not. I get a bunch of directories listed along with the files. PHP Code:
List Of Files Fetched Via Include() Or Require()
I want to be able to, at the end of an executed file, summarize what files it included and required (via include() and require()). I have a very dynamic script that depending on the situation handles several different files and scripts. To aid in developing, listing them would be helpful, to troubleshooting problems. Iss there a way to list all the files that have been included along the way?
Create PHP Pages From List Of Files In Directory
this is probably easy for a php pro... but I cant figure it out.. I have a directory of mp3 files named like this. Chevy_Car_Commercial.mp3 There are about 150 files. I am trying to find a script that will make php pages based on the file names. chevy_car_commercial.php And also dump that variable title Chevy Car Commercial into the <title> of the web page... I have made dynamic pages before... but that was using a form..
Ereg, Read The Dir And Print List Of Files.
I have a dir of html files that link to websites, i would like to read the dir and print a list of those files as a link. Which the script i have does. I would like to take this one step further and replace the ".html" extension with ".com" so it winds up being:
List Files In Directory For Apache Alias
I want to list the files in a given <dir> with a given file extension ... opendir() or scandir() would seem to be my solution. BUT! those files are outside the root dir of the site ... accessed via an apache alias. so opendir() and similar functions do not seem to work as I cannot feed it a relative path. is there a way to do this? my page: <http://myintranet/prodinfo/listdir.php> http location of dir to be listed: <http://myintranet/dailies/> /dailies/ is an alias pointing elsewhere on the server. indexing has been turned on for this alias in apache, so loading the above URL shows the dir contents by default. so for example ... this works because /images is in the root of the web dir: $myDir = "../images/"; $scanFiles = scandir($myDir); print_r($scanFiles); this does not work as dailies is an alias and not a dir in the web root: $myDir = "../dailies/"; $scanFiles = scandir($myDir); print_r($scanFiles); one option I see is to grab the html of that apache auto-generated index page and parse the content to grab the links out of it. but this seems rather roundabout, and with all the great php file tools, I'm hoping there's a much simpler way. does anyone have any ideas, or is there some addtl info I can provide to make my question clearer?
Online Product Catalog
Can anyone suggest me a good and reasonably priced or free script for setting up an online product catalog. Like the other image library scripts the catalog can create its own thubnails and we can also input the details about the product.
Product Attributes Problem?
While trying to design a database for shopping cart i encountered few problems which i am mentioning here. I had hierarchical level of categories for products for which i designed table as:
I Need A Product Review Script
I need a script for reviewing products (much like epinions.com) written in either perl or php (can't use asp). i am very strapped for time and need a functional script asap, which is why i dont have time to write it myself. i would prefer if it used a mysql db. basically, i just need for people to be able to have members write out how much they paid, pros/cons, overall opinion, whether or not they would buy again, and some sort of rating system (ex 1-5 stars)/ i would need to have a master page for each product which would have msrp, manufacterer description, pic, etc. under that would be my sites review of the prouct (if available), and under that member reviews. members would be able to browse products by category w/ one sub-category level, or manufacturer, or all 3. inside this products would need to be able to be sorted by: newest, highest rating, lowest rating, and price. i really, really, really need this soon. even if u know of a script that is like this, but basic, it would really help as i could finish it myself. if any of u have a script that u use on your site that is still fine i can customize it myself.
Emailing Product Details
i have kind of a shopping cart i can add products to the cart but i need to email this selected informtaion to an email address. PHP Code:
Multiple Product Options
I've built a number of online shops with but I want to increase the flexibility of the system that I use, mainly relating to product options. Currently I just use an admin area to assign one or more options to a product and these get displayed on the product page of the site, however what I really want to do is relate those options so that only the options available are displayed. This has my head in a bit of a spin as I haven't entirely decided on the best way to do this. My current thinking is to - in the admin area - list all the permutations for a product each with a stock level form element, then when submitting the form I use PHP to only grab the options that are available and store them in MySQL as an string that can be eval'd when extracted and processed on the product page. The product option drop-downs would be displayed in an iframe so that it can refresh quickly based on the options chosen and what's available. I was going to output a JavaScript array and use that but I want the system to work whether JS is on or off. Does this sound the best way to go about this or are there better more efficient ways?
Product Display PROBLEM With PHP + CSS
I have the folowing code looping thru a result set from the Database and displaying a list of products. I want to use CSS to display 3 products for each line ... or any number of products that will fit in a line and look nice. So from the php side How can I do something for every 3 records e.x every 3 records echo "<ul>". Without any CSS it will display them vertically.... /************************************************** */ echo "<ul>"; while ($row_newProd=mysql_fetch_assoc($new_products)) {?> <li> <?php echo $row_newProd['products_shrt_desc']; ?><br> <div align="center"><a href="index.php?products_id=<?php echo $row_newProd['products_id']; ?>"><img src="/images/thumb_<?php echo $row_newProd['products_img']; ?>" border="0" ></a></div> <p><?php display_product_price($row_newProd['products_price'],$row_newProd['products_offer']); ?></p> </li> <? } echo "</ul>"; /************************/ css: #new_products ul { margin:0px; list-style-type: none; text-align:center; padding: 0px; } #new_products ul li { font-size:0.8em; display:inline; float:left; /*border: 1px dashed #CCCCFF;*/ width:30%; margin:2px; } /**************************************/
Echo Only The Most Recent Of A Product....
Right now I have a basic drop down menu which is populated by the MySQL database. Once the user submits the form they are taken to the results page that match their criteria. Code:
Changing Product System
Currently, in my shopping cart, it checks for a product id. If it already exists, it adds to the value ct_qty. if (dbNumRows($result) == 0) { // put the product in cart table $sql = "INSERT INTO tbl_cart (pd_id, ct_qty, ct_session_id, item_color, item_size, ct_date) VALUES ($productId, 1, '$sid', '$color', '$size', NOW())"; $result = dbQuery($sql); }else{ $sql = "UPDATE tbl_cart SET ct_qty = ct_qty + 1 WHERE ct_session_id = '$sid' AND pd_id = $productId"; $result = dbQuery($sql); But I want to be able to compare all the products where the product ids are the same, as well as session id. If one product exists and matches the same color AND size I want that quantity to update. If not, just add another item. My problem is I'm not sure how to access every single row that matches the product id and session id.
Remove Product Quantity's
I'm trying to develop a simple shopping basket, how do I remove the quantity option from the following code, so that only one of each item can be purchased instead of 2 or more? Also, if the product selected to add to basket, already exists in the shopping cart, how do I display a message notifying the user? Code:
Remove Product Quantity's
I'm trying to develop a simple shopping basket, how do I remove the quantity option from the following code, so that only one of each item can be purchased instead of 2 or more? Also, if the product selected to add to basket, already exists in the shopping cart, how do I display a message notifying the user?...
Product Variants In An Ecommerce Application
I am trying to create a product variants facility for an ecommerce site (php/mysql). Each of my products have options & option values stored in the db like this: -------------------- ------------------------- | product_options | | product_option_values | -------------------- ------------------------- | option_id | | option_value_id | | name | | option_id | | product_id | | value | -------------------- ------------------------- I have created product variant tables as follows: -------------------- ------------------------- | product_variants | | product_variant_items | -------------------- ------------------------- | variant_id | | variant_item_id | | price | | variant_id | | weight | | option_id | | stock_available | | option_value_id | | product_id | | | -------------------- ------------------------- This allows the stock, price etc to be set for combinations of options. For example: Blue/Medium/Long Sleeved Blue/Large/Long Sleeved The problem comes when i try to generate these variants from the product options. I need to get all the combinations as shown in the example but i have no idea how to do it. For the moment i have created a form where each combination can be added manually but idealy this would be generated automatically. Of its more than possible that this is just not the way to do it ;0)
Making A Function For A Product Discount
im trying to make it if the category equals necklace and the product id returns with the word necklace the product price will be discounted on checkout. <?php if($cat=="necklaces"||$prodid= strpos("necklace",$prodid,TRUE)) { $productprice=///$productprice discounted at 10 percent off ;}?>
Product Image In Database For Froogle Feed
All the images for my products are stored in the database. I have to post a url for the image in my froogle feed. I used to put the URL I put in the src of the img file and that doesn't work anymore. If I remember correctly, putting http://<domain>/pic.php?id=47&table=table1&column=column_id just got me the picture, now IE tells me it failed downloading a file. Presumably it is because the browser doesn't know the type of the file returned whereas in the img tag it expect an image? Is there anyway to fix that please?
Create Popup Window With Product Details
I am attempting to create a popup window using the code that's shown here http://forums.devshed.com/t15928/s.html I want it to display the product information when a user clicks a link from a table. But, I havent got a clue about where to start. I am displaying an alternate color table from what i assume is a recordset. please excuse my ignorance if this is straight forward as i only just started to attempt anything like this in the last week. PHP Code:
Form For Uploading Product Details And Image
I am creating a product upload form, which includes product details, category and image. The databases are as follows: Category: (cat_id) (cat_name) Products: (prod_id) (cat_id) (prod_name) (prod_photo) (prod_link) (prod_description) (prod_price) (prod_size) products.cat_id will link to category.cat_id Here's my major concern: My image upload is not working. Of course, I have no idea whether the category info will work at this point, but if I can get the image upload to work -- I'll be able to test the category input and I'll post in a separate thread. The prod_photo field is saved as LONGBLOB in the table. I believe the database is setup correctly. Code:
Displaying Currency Exchange Rates On A Page For Product Price
i want to display the price of a product on my site in multiple currencies that is constantly updated to keep in line with exchange rate fluctuations can anyone tell me how i could get access to basic exchange rate data automatically for my site? (just a few major currencies)
List Contents Of A Folder, Make List Of Links
Does anyone know how I can write a script that: - reads in all the files in a particular directory - displays the file names in a html list and makes a link of them: <ul> <li><a href="filelocation1">filename 1</li> <li><a href="filelocation2">filename 1</li> <li><a href="filelocation3">filename 1</li> </ul> etc.? So basically it creates a list of links with the contents in that directory, so you can download them from there.
Get List Of Messages From One Table, Message List Indicator From
I have two tables. One has a list of messages left by users using fields named mbxno for the mailbox and msgno for the message number. I have another table that has mailbox settings for each user that contains a field named "messagelist" to indicate if they want to be included on the message list or not. What I'm trying to create is a list of the most-recent messages with a lookup on the users table to indicate whether a message in the list should be included in the message list based on the user's mailbox settings. SELECT messages.msgno, messages.mbxno, users.messagelist FROM messages, users WHERE (users.messagelist = Ƈ') ORDER BY msgno DESC LIMIT 100 What I'm getting, though is a list that looks like this: mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 I think what's happening is that I'm using the wrong type of join and more rows are being created than necessary. If I add "DISTINCT" to the query, I get a list of the most-recent messages as I expect, but the "messsagelist" value is sometimes wrong (again, probably because the data is getting jumbled). For example, the messagelist value for the second row (2214) should be 0, not 1. mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 2214 msgno: 0412141622 msglist: 1 mbxno: 2189 msgno: 0412141408 msglist: 1 mbxno: 0000 msgno: 0412141213 msglist: 1 mbxno: 0003 msgno: 0412141213 msglist: 1 mbxno: 2265 msgno: 0412132029 msglist: 1 mbxno: 0000 msgno: 0412131950 msglist: 1 How should I be doing this? If nothing else, what kind of join will work with a long list compared to a value from a short list?
Mailing List Manager, Send To List
I'm looking for a mailing list script (php) that has a function to let users to reach out to all recipient on the list by simple send the email to a specific maillist- address. Mailman has this functionn but as a just got a webserver account I can't use mailman nor install it.
EDIT CSS
i need a script that will allow my to edit the css file through a website. Like without going through the cPanle I could just click a link throught the site and it will allow me to edit it.
PHP Edit Itself?
Can a PHP script edit itself? And if so would it be faster to store/retrieve information this way instead of using a database? Or would it be slower?
Creating A Product "activation Key" For Php Scripts?
I'm try to figure out the best way to create a "license key" for php scripts. Basically the key would be unique to the user and if valid would unlock the script. I'm guessing the code that deciphers the key would need to be encoded with ioncube or something similar so that it couldn't be circumvented. Any ideas on how to approach this?
Edit/replace?
How would I edit or replace a field of a row in my database?
Edit MySQL Using PHP
I know that I need to include a textbox and everything, but dont know how. In my database I would like to be able to edit it from my website that has a textbox and a button that allows it to change a field in the database and replace it with the text in the box.
Trying To Edit A Txt File
Hi I am trying to edit a text file... the format of which is like #####abc.conf poll somethin proto pop3 via 127.9.02.1 user "me@me.com" pass "dell" is me.nutcase preconnect "abc abc abc abc" ## poll ak # proto pop3 via 11.11.22.33 user "ak@bk.com" pass "eatme" is nutter fetchall preconnect "abs -e -f -f /ss/ss/ " ## The way i am tryin to edit this file is .... <?php $file = "/som/thing/abc.conf" $dele = "poll ak"; $open = fopen($file, "r+w"); $read = fread($open, filesize($file)); $sep1 = explode($dele, $read); $sep2 = explode('##', $sep1[1]); $read = str_replace(array($dele, $sep2[0]), array("", " "), $read); fseek($open, 0); fwrite($open, $read); fclose($open); The result of what happens is it delete the tag from poll ak till the ## but also adds some text at file end like .... Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2Resource id #2defaults via 11.11.22.33 user "ak@bk.com" pass "eatme" is nutter fetchall preconnect "abs -e -f -f /ss/ss/ "
Edit Profile
I would like the user to edit their own profile. But how can I retrieve the data in the form to perform update, instead of display as the code below? PHP Code:
Read And Edit Xml With PHP
I'm trying to write some php that will read in some xml and then allow me to modify the tag and write back out to xml. In the following example, I want to read in 'text_for_paragraph_1', then allow it to be viewed, edited, and saved back to the xml... I have absolutely no clue even where to start...
Php Edit Xml File
I have an xml file that looks roughly like this: <?xml version="1.0" encoding="ISO-8859-1" ?> <videos> <video url="new.flv" desc="Guitar Solo" /> </videos> what i want to be able to do is add more entries like "<video url="new.flv" desc="Guitar Solo" />". How can I get it to add the entry into the right place, so it doesnt show up after the </videos>?
Video Edit
It is possible to upload your own video and then mix it the way you want. Is there available a php library for modifying flv videos to mix them and add effects just like in eyespot. I know for flvtool 2 but i am not sure it will do the thing and i couldnt find any documentation for it.
Allow To Edit Within X Hours
I have data that is inserted into a database, one of the fields is named 'time_stamp' and is a "datetime; 0000-00-00 00:00:00" type. I was wondering how one could make an if statement that will show code (code is just the editing portion of the page) if the 'time_stamp' is less than the 'time_stamp' + 72 hours. Other wise, don't show the code and inform them that they can no longer edit.
Edit Regarding Check Box?
I am trying to write a little script that when the user chooses to edit there ad on the site, it will display a list of there images as thumbnails. They then check a box for the images they want to keep. Is this the correct syntax? Code:
Edit Php To Html
I have a website on a cd and is in php format.How do i change from php to html?Or what program should i use so i can publish the website.
|