Jump to content

tfoster

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tfoster's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi All, I am trying to authenticate with our internal Exchange 2007 server to send emails from our externally hosted website. I am using: fsockopen($host='webmail.hostname.com',$port=25,$errno,$errstr,$timeout=5); The connection is continually refused. HOWEVER, I am able to open a telnet connection on port 25 to webmail.hostname.com. I'm sure there are multiple possible points of failure here, but I'm not sure where to start. Does anyone have any ideas what could be causing this? Thanks for any help you can offer!
  2. This sounds like an efficient method to me  :)
  3. Instead of calculating the number of rows in a loop, try using: $numRows = mysql_num_rows($query).  This may speed it up a little. Hope this helps.
  4. Just wanted to see if anyone has ever run across this before. $balance = $row[totalcost]; Then I am selecting checks from another table, and while fetching them, subtracting them from the balance, so: while($rowCheck = mysql_fetch_array($resultCheck))   $balance = $balance - $rowCheck[checks_amount]; I get down to the last check, everything is running smoothly.  The balance is 107.56 and the last check is 107.56.  When I subtract the two, I am getting 3.98457E-13.  What is the deal? I have found that I can get around this by adding the total of the checks and then subtracting them from the balance.  I was just curious if anyone know why this is happening.  It is not as if checks are being entered as 107.5600000000000045... Thanks for any feedback!
  5. Try something like this: $insertBTR = "insert into [i]tablename[/i] (date, user, map, time_completed) values ('" . $inputDate . "', '" . $inputUser . "', '" . $inputMap . "', '" . $input_time_completed . "') where BTR_no=[Btr]"; $resultBTR = mysql_query($insertBTR); if(mysql_affected_rows()>0)   echo "BTR inserted successfully"; else   echo "Failed"; A couple of notes about this: Between the first set of parentheses in the insert statement, use the field names from your database. Between the second set of parentheses, make sure you do single quote, double quote [input element] double quote, single quote. Also the inputs are whatever value you are wanting to insert into the database. When you go to get it out of the database, use a loop to go through all of them: $selectBTR = "select * from [table_name]"; $resultBTR = mysql_query($selectBTR); echo "<table>\n"; while($rowBTR = mysql_fetch_array($resultBTR)){   echo "  <tr>\n";   echo "     <td>" . $rowBTR[date] . "</td>\n";   echo "     <td>" . $rowBTR[map] . "</td>\n";   echo "     <td>" . $rowBTR[user] . "</td>\n";   echo "     <td>" . $rowBTR[time_completed] . "</td>\n";   echo "  </tr>\n"; } echo "</table>\n"; This should output it back into your table nicely.
  6. Hey Shoz! Thank you so much for the help! I ended up going a little different way with it. Instead of utilizing file variables, I just set another variable where a picture already existed called prodpic that was a text input, like this: if(empty($rowProd[products_pic])) echo "<td><input type=file name=inputProdpic height=20 width=20 value=\"" . $rowProd [products_pic] . "\"></td>\n"; else{ echo "<td><input type=text name=prodpic value=\"" . $rowProd[products_pic] . "\">\n<br><input type=file name=inputProdpic height=20 width=20 value=\"" . $rowProd[products_pic] . "\"></td>\n"; } Then, on update, I set it up like this: if(!empty($inputProdpic)) $updateProd = "update PRODUCTS set category_no='" . $editCat . "', products_name='" . $inputProdname . "', products_desc='" . $inputProddescription . "', products_avail='" . $inputProdavail . "', products_pic='" . $inputProdpic . "', products_group='" . $inputProdgroup . "' where products_no = " . $editProd; else $updateProd = "update PRODUCTS set category_no='" . $editCat . "', products_name='" . $inputProdname . "', products_desc='" . $inputProddescription . "', products_avail='" . $inputProdavail . "', products_pic='" . $prodpic . "', products_group='" . $inputProdgroup . "' where products_no = " . $editProd; This makes two text boxes when you are updating a product, so it is definitely not the most streamlined, but it works... Again, thanks for your hlep!
  7. [!--quoteo(post=358725:date=Mar 26 2006, 08:15 PM:name=shoz)--][div class=\'quotetop\']QUOTE(shoz @ Mar 26 2006, 08:15 PM) [snapback]358725[/snapback][/div][div class=\'quotemain\'][!--quotec--] Your browser may have been using the previous version of the image stored in its cache. When doing tests for something like this, you should empty your cache(temporary internet files) to force the browser to download the image from the server. [/quote] That makes sense. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] I don't think the "file" type of an input element is allowed an author inputted value for the "value" attribute. I believe that it's a security precaution. Perhaps you meant it to be "text"? [code] echo '<input type="text" name="inputProdPic" value="'.$row['products_pic'].'" />'; [/code] [/quote] The problem with changing it to text is that this statement serves dual purposes. It allows the user to add a new product picture, or edit an existing product picture. If I change it to text, it will not allow the file upload. I thought about putting in a if statement so it would be text when you edit the product, but if the user wants to overwrite the picture, I am denying them the ability. Hmmm... I think I am in a catch 22. :)
  8. [!--quoteo(post=358712:date=Mar 26 2006, 07:08 PM:name=lila)--][div class=\'quotetop\']QUOTE(lila @ Mar 26 2006, 07:08 PM) [snapback]358712[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hello! I am using move_uploaded_file to upload a picture. The pictures are associated with certain products, so the naming scheme makes the filename [primary key].gif. My problem is that when I try to change the picture, it will not overwrite the first picture in the directory being uploaded to. Any ideas? Thanks for any help! [/quote] When I closed the page and re-opened it, the picture had change. Is this just a database lag? And I have one more problem. If I try to just display what is in the database in this cell, it won't display properly. The filename doesn't come up. I have checked my code to make sure I am accessing it correctly. If I just echo it, it shows up okay, but it won't do it in the confines of this statement: echo "<td><input type=file name=inputProdpic height=20 width=20 value=\"" . $rowProd[products_pic] . "\"></td>\n"; Any ideas?
  9. Hello! I am using move_uploaded_file to upload a picture. The pictures are associated with certain products, so the naming scheme makes the filename [primary key].gif. My problem is that when I try to change the picture, it will not overwrite the first picture in the directory being uploaded to. Any ideas? Thanks for any help!
×
×
  • 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.