Jump to content

kenwvs

Members
  • Posts

    194
  • Joined

  • Last visited

    Never

Everything posted by kenwvs

  1. I have this basic script (below) that is getting the information from a form, and then converting it into a csv file. Is it possible to have the fopen statement get the filename from the form that it is getting all the data from, and then save the same data to this form in a csv format? I went with the process of listing each item individually (instead of using an array) as I needed one item to be in a different order in the csv file than it is listed on the form, and although I beleive there is a way to organize it, this is my first attempt at PHP and I was getting confused. I need to let each person who fills out the form input what they want the filename to be called, and it needs to be saved in csv format. Thanks, Ken <?php $writetocsv = $_POST['item_title'] . "," . $_POST['item_category'] . "," . $_POST['item_type'] . "," .  $_POST['quantity_available'] . "," . $_POST['starting_bid'] . "," . $_POST['bid_increment'] . "," .  $_POST['reserve_price'] . "," . $_POST['duration'] . "," . $_POST['auto_relist'] . "," . $_POST['city'] . "," . $_POST['state'] . "," . $_POST['country'] . "," . $_POST['item_description'] . "," . $_POST['paypal_id'] . "," . $_POST['hit_counter'] . "," . $_POST['end_hour'] . "\n"; $file = fopen([color=red]filename_from_form[/color]]","a"); fwrite ($file,$writetocsv); fclose ($file); ?>
  2. I ended up having to install and run System Privacy Shield to get whatever file it is cleaned up.  From time to time I still have to run it or certain pages won't refresh
  3. I have manually written the script as I originally did, and have it working.  Is it possible that when you press submit on the form, it will automatically end that line so you can enter new data in the form and then press submit again.  I am thinking there must be an EOL code, and I just haven't found it yet. If you want to see what I am trying to do, you can go to [url=http://www.forsale4u.ca/unloadform.html]www.forsale4u.ca/uploadform.html[/url] and see the form I have generated, although you won't see any results when you hit submit, and the form isn't quite the way I want it yet. ken
  4. Based on the two examples that were provided to me as alternatives is there a way to have the results listed in the csv file in a different order than they fit on the form.  For cosmetic reasons I would like the form in the same order, but due to the csv file, it needs to be in a specific order. The submit button also appears in the csv file, which again, won't work, can that field be eliminated from appearing in the file. thanks, Ken
  5. just read the replies again, and again, and am getting a headache and confused...... two different answers......... will they both result in the same end result? If those dots join strings would I be correct in assuming I don't want them if I am working on a csv file, hence the ',' to separate them throughout the $Post strings? Ken
  6. You mean I spent all that time typing them in, ever so carefully, and there is a way to get around it.....  :o Please explain what that word concatinating Ken
  7. I have a basic script (first one I am attempting) and have this error haunting me.  I have looked for all kinds of syntax errors, but must be going blind, so any help would be appreciated. Parse error: syntax error, unexpected T_VARIABLE in /home/forsa7/public_html/upload2.php on line 3 [code]<?php $writetocsv = $_POST['item_title'] . "," . $_POST['item_category'] . "," . $_POST['item_type'] . "," .  $_POST['quantity_available'] . "," . $_POST['starting_bid/price'] . "," . $_POST['bid_increment'] . "," .  $_POST['reserve_price'] . "," . $_POST['duration'] . "," . $_POST['auto_relist'] $_POST['city'] . "," . $_POST['state'] . "," . $_POST['country'] $_POST['item_description'] . "," . $_POST['paypal_id'] . "," . $_POST['hit_counter'] $_POST['end_hour'] . "," . ; $file = fopen("upload.csv","a"); fwrite($fp,$writetocsv); $fclose ($file); ?>[/code] there could very well be more that needs to be added to this script, I am kinda going one step at a time, and trying to make an idea work.  I would appreciate it if someone could explain what the cause of this error is.  I am not sure what the periods throughout the first line are for, as the examples I have been watching don't show them, but they were in the one example, so thought I would try putting them in. thanks, Ken Thanks, Ken
  8. I have determined that the problem was caused by there not being a [i][b]session_start()[/b][/i]  at the top of the index.php page.  Once I added that line to my page, the error disappeared and everything is working well. I am not sure why I didn't have this problem on the old server, but I am not going to worry about it since the problem is solved.
  9. I just moved my website from one server to another and have moved both the files and the database.  I had to create new names for the database and user and did this and changed it in a file called myconnect.php.  When you go to the site you get errors on the page as follows: [quote]Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/forsa7/public_html/index.php:6) in /home/forsa7/public_html/session.php on line 2 Warning: mysql_connect(): Access denied for user 'forsa7_dbmforsal'@'localhost' (using password: YES) in /home/forsa7/public_html/myconnect.php on line 14 I cannot connect to the database because: Access denied for user 'forsa7_dbmforsal'@'localhost' (using password: YES)[/quote] I am not understanding what is causing this error as I have made sure the database name, server, user and passwords are all correct.  I even deleted the user, created a new one and gave him permission for this database, in case I had a wrong password. Any ideas what might be causing this. thanks, Ken
  10. anyone else trying to go there using the www is able to get there.  The guy at the support desk and my friend can get there....... it is just me that can't.  If you type it in, you will get there, but will see a page full of errors as I don't have the DB set up properly. Ken
  11. I just moved my website to a new server and it has been propagated completely.  For some reason, if I type in www.forsale4u.ca it takes me to the old server.  If I type in http://forsale4u.ca it takes me to the new server.  I have emptied my files, cleared the cache, removed all temp files on my computer, and it is still doing it.  I know the site is not working and isn't related to this, but this is driving me nuts.  I had a friend try it on his machine and he can get to the new server. Any ideas what I am missing, or not doing that it won't go there.  Obviously there is some reference in my computer to go to the old spot.........but no clue what or where that reference is. Thanks, Ken
  12. I have done a google search trying to find detailed info on creating a table using phpMyAdmin (as it is supplied by my server) but can only find ones that give a quick overview.  As I have never created a table before, and am trying to figure this out, is there such a thing.  I want to know what all the rules are for field, what do the choices in type do, what is collation, etc.....  I am assuming I need to have one field marked as primary and have it auto_increment, but would like to know why, and this type of thing. Is there such a help manual/site available? Thanks, Ken
  13. I have designed a html form and want people to be able to complete it and then save it locally on their computer in a csv file format. It is a form that they can complete and then upload multiple items to my auction site, but it requires the data to be in csv format. When configuring the "button", I labelled it as a normal button, but it won't let me stipulate that it saves to a local computer. I thought this would work, but am not sure how to configure the save button to do this, or if I need to do something a little different. the form can be located at [a href=\"http://www.forsale4u.ca/uploadform.html\" target=\"_blank\"]upload form[/a]   but I am not sure this will help. I hope this makes sense. I am not sure if what I am wanting to do is even remotely possible, let alone possible for someone not really sure what he is doing. I have designed a form that allows people to list multiple items on an auction site at once.  The file has to be saved in csv format.  This is strictly for appearance sake, as they could just complete the form in excel or an editor if nothing else.  I would like to be able to have them download the form, complete it and then save it locally on their computer in csv format, and then they would upload the csv file to the auction site. Any help out there? Ken Ken
  14. Hi All I have designed a form, using excel and then converting it to html using spreadsheet converter, and have placed it on a website. The purpose of the form is that people can order literature online (there are about 50 items). Is it possible to have the form sent in its entirety, opposed to just the results, in a list format? It would be easier for the person receiving the order to be able to view the whole form, instead of just the results. The form can be found at [a href=\"http://www.albertaga.net/onlineliterature.htm\" target=\"_blank\"]online order form [/a]This form also does calculations for the total order amount, so am not sure if that will make a difference. It would be ideal if it could be emailed to the person, but if they had to pick it up elsewhere, after receiving an email notification that wouldn't be out of the question. Alternatively, could they receive a file with the results that they could import into the base form? Thanks, Ken
  15. Hi All: I purchased a script for an online auction site and have it up and running and have noticed a few problems, which have all been solved except for this one. From what i understand the time shown is obtained from wherever my server is located. (I confirmed this with my provider) I did add a line in the script to have it show my time zone by using this command.[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--] putenv("TZ=US/Pacific");[!--colorc--][/span][!--/colorc--] except I used mountain standard time. This worked and the correct time and date appeared on my main page. The problem occurs when people list an item, or place a bid, or leave feedback. The time is uses for these functions is wrong. It is either -4 or -6 hours. When I remove that line from the template.php page, the time shown for all functions is still -4 hours from the time shown on the screen. I asked the people I purchased the script from and they say that the time is obtained from the server, not from the script. Any ideas on what needs to happen to get the time appearing correctly on all functions. Ultimately, I would like to be able to use mountain standard time, but would be happy with Eastern Time, or anytime, as long as they all were the same. I really don't know how to change much, so if you have suggestions, please keep it simple, as I could be considered Stupid, when it comes to this. This is the lines "I think" that relate to this problem. If you think there are other lines, please let me know. I have taken these lines from a file called "template.php" [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] $config=mysql_fetch_array(mysql_query("select * from sbauctions_config ")); ///////////////////////////////////////////AUTOLIST CODE//////////////////////////////////////////////// $auction_period=$config["max_period"]; $rs_query=mysql_query("Select *,UNIX_TIMESTAMP(date_submitted) as t,UNIX_TIMESTAMP(DATE_ADD(date_submitted,INTERVAL auction_period DAY)) as t1 from sbauctions_products");[/quote] AND [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]/////////////////////////////////////AUTOLISTED////////////////////////////////////////////////////////// $sbq_frozen_q="select * from sbauctions_products where UNIX_TIMESTAMP(DATE_ADD(date_submitted,INTERVAL auction_period DAY)) <= UNIX_TIMESTAMP(NOW()) and status='open'"; //echo $sbq_frozen_q; $frozen_q=mysql_query($sbq_frozen_q); while($frozen=mysql_fetch_array($frozen_q)) { autoclose($frozen["id"]);[/quote] another question, is there an area on here to post requests for quotations on modifications to my script. The company I purchased it from is not happy with me, as I asked them to fix the script to what I originally requested, and didn't want to pay more $$ for them to correct their errors. It is all fixed now, but there are some changes we would like to make, and I am not sure this company will do it for me. If it makes a difference, i am in Canada, and prefer to deal with someone who is close to the same time zone, as when dealing with someone who is +12 hours, it is hard to connect when trying to sort out issues. Thanks, Ken
  16. I purchased an online auction script from Softbiz Scripts and I have now noticed that the time on certain functions are not working properly. When I purchased the script, we had to put a time zone script into the template.php page as our server is located in a different time zone from us. Our time zone is -2 hours from where our server is located. That allowed the time to display on the site properly. I have now noticed that when we add a listing to the site, the time shows 4 hours earlier. When we purchase an item outright, it shows a time difference of -6 hours, and when we use the feedback function it also shows a time of -6 hours. Any ideas on what has to happen to get the time to work properly on these functions. Would it be as simple as adding the time zone script to each of the affected pages? Thanks for your time on this. If you need to look at this site, it is located at www.forsale4u.ca Ken
  17. Problem solved by making a table. Thanks for the help, and I am sure I will be back. I appreciate the comments and now know that I need to supply more information and some code with any questions. This site ROCKS!!
  18. I purchased an auction script that uses the extension php on the files. I know absolutely nothing about this, but I have used HTML in the past. I am trying to insert a couple of pay per click sites on a page, and have put the proper code in, and one appears, or both will appear, but I can't get one to go on the left side of the page, and one on the right. They appear one on top of the other. I have tried using <align="left" and <div align="left" and different variations, just trying anything. I am not even positive where to put the command. These two codes use <script type='text/javascript'> Hope you can help me with this, as I am sure the time has come that I will need to learn and understand atleast the basics of this language. Thanks, Ken
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.