• Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About JackW

  • Rank
  • Birthday 10/18/1946

Contact Methods

  • Website URL

Profile Information

  • Gender
  1. I have a website that has worked fine for several years. It uses php and a mysql data base. I can still make changes to the data base, but have a hard time getting the new text to show up. It is changed in the data base but the browser insists on showing a cached copy. In the past it worked fine. Don't know what changed. I also use a cookie set by a user name and password and now when I click on the log out function, I need to refresh the log out page before it logs me out. I have looked for a method to disable the cache but nothing I have found works. The site is on a Windows server, not by my choice. Any ideas?
  2. Thank you, I believe I can work with that and it will do just what I want it to do. JackW
  3. Thanks, I may be able to make that work. What I really need is just a simple piece of code that does the link part provided in the rich text editor. That may well not be something that is available. JackW
  4. I am developing a website where my client can update the text using simple forms. I have developed several such site using php and a MySQL database. My current client wants to have the ability to add links within the text without typing the full link code. The form I am using to post this question has the function I need. A box pops up where one can put in the url and form a link. Can someone tell me how to create that function for my page?
  5. Thank you! Thank you! Thank you! That Worked! I can't believe the number of hours I spent trying to find the answer because I was too stuborn to ask for help.Have a Merry ChristmasJackW
  6. I have several sites on Linux servers where I have set it up so the site owner can upload picture files. Below is a simplified version of the code used. (without security features that are on the real sites.)Now I have a client that would like this feature on his site, but it is hosted on a windows server. The code does not work on his site.Html form Page code: <body><form enctype="multipart/form-data" action="upload.php" method="POST">Please choose a file: <input name="uploaded" type="file" /><br /><input type="submit" value="Upload" /></form></body> Php page code: <body><?php$target = "upload/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) {echo "The file ". basename( $_FILES['uploaded']['name']). " has been uploaded";} else {echo "Sorry, there was a problem uploading your file.";}?></body> The html code is in a folder named test. That same folder named test contains a folder named upload. I set up the windows hosted site and one of my linux hosted sites exactly the same. On the linux server I get this message: “The file 100_0095.jpg has been uploaded” and the file is in the folder.On the windows server, no file in folder, and I get this message:“Warning: move_uploaded_file(upload/100_0095.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in D:\Hosting\5310323\html\test\upload.php on line 19Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'D:\Temp\php\php6435.tmp' to 'upload/100_0095.jpg' in D:\Hosting\5310323\html\test\upload.php on line 19Sorry, there was a problem uploading your file.”I have been looking for solutions and trying different things for 2 days. What am I doing wrong.Some one suggested it was a CHMOD problem. That is not the case on Linux. I don't have a clue about permissions on Windows. This is my first and I hope last experience with a windows server.Thank you for any help you can give.Is it possible to upload files to windows servers and how is it done?
  7. Thanks, I will play with it some more. Just knowing that it should work helps a lot. Maybe I have some brackets in the wrong place.
  8. Thank you and please do not spend a lot of time here as copy and paste will work.I will try to explain what I am trying to do.I have a data base with 3 tables. One contains product information. Item name, number, and price.One contains customer information. Customer Number, City, State, County.One contains tax rates for the City, State, and County where my client is required to collect sales tax when shipped to that City, State, and County.From the product table I can create variables for the product informationI can connect to the data base and with the Customer Number get the City State and County. Take that information to the tax rate tables and get the City, County and State tax rates and add those three to come up with a tax rate for the sale.Those variables then need to be placed in the shopping cart button form. This shopping cart button form is what I would like to insert with the require function. See the sample code.<?phpecho '<form target="cart" action="https://www.cart_URL" method="post"><input type="hidden" name="business" value="Bussiness_Code"><input type="hidden" name="item_name" value="';echo $title;echo '"><input type="hidden" name="item_number" value="';echo $stocknumber;echo '"><input type="hidden" name="amount" value="';echo $cost;echo '">';echo '<input type="hidden" name="tax_rate" value="'echo $tax_rate;echo '">';echo '<input type="hidden" name="add" value="1"><input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_SM.gif:NonHosted"><input type="image" src="cart_button" border="0" name="submit" alt="Add to Cart Button"><img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"></form>';?> When I use the php opening and closing, it doesn't let me use the variables I have created.When I do not use the php opening and closing it writes it as html and of course doesn't let me insert the variables I have created.I can copy and paste the code (without the open php and close php) in each place it is needed and it will work. Note: I did remove some lines from the total button code so it may contain errors that are not in the complete code.Thanks again for your help.
  9. You are correct in that what I am getting is the html content. On the complete page I have the php tags and it connects to the data base to get the information that would be included in the sample script. It is likely that what I want to do can not be done.When I include the php tags it does not allow the content from the data base to be inserted. I could include the complete code in the part that is accessed by require, but that would mean opening and closing the data base 10 times on the page. I would enclude the entire code for the page but there is 1067 lines on the page.I think that copy and paste may be the answer as it will work that way. Just looking for a simpler way to do it. Thanks for your help.
  10. I am working on a website where I would like to include or require a line of code within a mysql query. Is this possible?I can write the page and everything works fine. However as the query is repeated several times and on several pages and also needs to be changed on occasion I would like to use the require function so I would only have to change it once to have it changed in all applications.Just a piece of the code is included in the text box for reference. As I said when I write the entire code in the pages it works fine. Just looking for a way to include it without writing it many times. echo '<input type="hidden" name="item_name" value="';echo ($row ['title'] );echo '"><input type="hidden" name="item_number" value="';echo ($row ['stock'] );echo '"><input type="hidden" name="amount" value="';echo $shipped;echo '">'; When I use the require function, of course it places the code on the html page with echo ' and '; showing on the page instead of allowing it to be a part of the php mysql function.Thanks in advance for any help you may be able to give.
  11. I do believe that is going to work. The tests so far are all positive.You are a wonder.Thank you so much.Jack
  12. Change text based on database content?I have a database full of items in several categories.Examples are:Cowhide/Leather Milano style FurnitureCowhide/Leather Remington style FurnitureCowhide/Leather Winchester style FurnitureLampsAccessoriesPine FurnitureEtc.What I want to do is write a code so when a link is clicked and the description page comes up the description for any item with Cowhide/Leather in the category name has some different text than what is on all the other pages. Example: This is a special order item.The code I have below seems to work for Cowhide/Leather Milano style Furniture. Is there a way I can write it so that it will echo the correct text for all of the categories that contain the word Cowhide/Leather?Your help will be greatly appreciated. <?php$code=$_GET['code'];$style='Cowhide/Leather Milano style Furniture';@ $db = mysql_pconnect('myserver.net', 'mydatabase', 'password');mysql_select_db('mydatabase') or die( "Unable to select database");{$query= "select * from `table` where `ID` = '".$code."' order by ID DESC";$query_results=mysql_query($query);$match_results=mysql_num_rows($query_results);}for ($i=0; $i < $match_results; $i++){$row=mysql_fetch_array($query_results);if($row ['category'] ==$style){echo '<p class="centerbrown">';echo 'Write Something here';echo '</p>';}else{echo '<p class="centerbrown">';echo'Write something Different';echo '</p>';}}mysql_close($db);?>
  13. Thank you both. That did it. The new code is below and works like a charm. @ $db = mysql_pconnect('myserver','mydatabase','mypassword');mysql_select_db('mydatabase') or die( "Unable to select database");$query= 'SELECT * FROM `sponsors` order by RAND() LIMIT 0, 15 ';$query_results=mysql_query($query);$match_results=mysql_num_rows($query_results);for ($i=0; $i < $match_results; $i++){$row=mysql_fetch_array($query_results);echo '<a href="';echo($row ['url'] ), '"', '>';echo($row ['name'] ), '</a><br>';echo($row ['comment'] ), '<br><br>';}mysql_close($db);
  14. Thanks,Not sure I understand what you said. Here is what I have and it works great, but not random.Can I replace DESC with something that will make it random? I tried removing order by and it works but comes up in the same order most of the time. @ $db = mysql_pconnect('myserver','mydatabase','mypassword');mysql_select_db('mydatabase') or die( "Unable to select database");$query= 'SELECT * FROM `sponsors` order by `ID` DESC LIMIT 0, 15 ';$query_results=mysql_query($query);$match_results=mysql_num_rows($query_results);for ($i=0; $i < $match_results; $i++){$row=mysql_fetch_array($query_results);echo '<a href="';echo($row ['url'] ), '"', '>';echo($row ['name'] ), '</a><br>';echo($row ['comment'] ), '<br><br>';}mysql_close($db);
  15. I am stumped. I want my site to display the information from the data base in a truly random order. I know how to write it to display in ASC (ascending) or DESC (descending) order but I want it to come up in a different order each time it displays. Is that possible? I have 30 rows of sponsors in the data base and want to display them 15 at a time but not in any specific order.It sounds simple but I can’t seem to find anything about it.