Jump to content

LLLLLLL

Members
  • Posts

    306
  • Joined

  • Last visited

Everything posted by LLLLLLL

  1. How can I encrypt POST data from a form? Basically, I want to ensure that the data on the form is not in plain text ever. Is this possible? <form method="post"> <input type="text" name="email" size="40"> <input type="password" name="password"/> ... Basically, when this posts, I want to do a foreach on $_POST and see something like: password = 1f3870be274f6c49b3e31a0c6728957f and not password = stringTheUserTyped I hope what I'm asking for is clear. (PHP 5.2.14) Thanks!
  2. This may not be a my_sql question after all, but rather one about the input field and post messages. HTML Special Chars might be what I need: http://www.php.net/manual/en/function.htmlspecialchars.php But I don't necessarily want to convert it, I want to be sure it is not converted!
  3. I have an input textbox on a form. If the user enters &#39; into the field, how can I store that exact string in the database? And then, how can I read that string back out? As it is now, the text is being converted to an apostrophe. I assume that similar strings would also be translated. I need to store the string exactly as entered, because later that text will be used on a webpage (where the browser will translate it appropriately). Ideas? On MySQL 5.1.47, PHP 5.2.14
  4. I kinda figured. Argh. Related question: I've read that readfile() may not be the best option, especially for large files. Some of the files I'm providing are around 10MB. How would you change the code to handle that?
  5. On PHP 5.2.14. I want to make files downloadable from my website. This seems easy enough: <?php $file = "downloads/someFile.txt"; // Set headers header( "Content-Description: File Transfer" ); header( "Content-Type: application/force-download"); header( "Content-Length: " . filesize( $filename ) ); header( "Content-Disposition: attachment; filename=$file"); // header( "Content-Transfer-Encoding: binary"); readfile( $file ); unlink( $file ); ?> You'll notice, however, that I have "unlink" at the end of this file. That's exactly what I want: to remove the file from the server once it has been downloaded, to prevent anyone else from downloading it. Here's the conundrum: When the user navigates to this URL, browsers offer the choice of Open/Save/Cancel. I don't want users to "open", and if the user presses "cancel", well then I probably don't really want the file deleted. In short: I want the file SAVED, only. And I want to delete the file immediately after it has been downloaded. Thoughts?
  6. There really aren't. I've looked everywhere, and I only asked here because there was nothing to find. As it is, I'm now using PHPMailer to attach real files -- not storing files in the database.
  7. I've looked all around for the answer on this, and I still cannot find it. I'm most confused about getting the file out of the database and turning it into a stream of data to attach. fread() and fopen() don't work because they require file paths. :'(
  8. Hello again. I had planned on using the standard "mail" function: mail($to, $subject, $message, $from);
  9. Right... could you provide an example of how to do this? Is it necessary to turn the BLOB into a file and then attach it, or can the BLOB be attached directly?
  10. On MySQL 5.1.47, PHP 5.2.14 I have some PDFs stored in a database as BLOBs. Using PHP code, how can I attach these BLOBs to an email?
  11. Well that sucks. But I do thank you for this information.
  12. Ah. ENGINE=MyISAM Does MyISAM support transactions?
  13. I don't know. Can you tell me how to find out that info? (FYI: my web host says transactions are supported.)
  14. On MySQL 5.1.47, PHP 5.2.14 I have looked at every PHP and MySql website I can find, and I'm sure my syntax must be incorrect, but I don't know how, why, or where. All I want to do is put this information in a transaction. Many queries are being run, and I don't want one failure to screw up everything else. You'll notice that there aren't many queries here... most of them are in the classes themselves. Maybe that matters; not sure. Anyway, for testing purposes I'm simply calling ROLLBACK at the end of all this. Alas, nothing is rolled back, and all the queries succeeded in adding information to the DB. Because of this, I'm convinced my transaction syntax is wrong. I've tried many ways, and this just happens to be the current syntax. Please help! mysql_query( 'SET AUTOCOMMIT=0' ); mysql_query( 'BEGIN' ); $cust->findIdOrAdd( $adrs ); // add the order to the db $order->add(); // before adding products, we need to map the skus to ids $skumap = array(); $sql = 'select sku, id from products'; $result = mysql_query( $sql ); while ( $data = mysql_fetch_assoc( $result ) ) { $skumap[ $data[ 'sku' ] ] = $data[ 'id' ]; } // loop through all the items. set the orderid and custid, // and then call the add function, passing in the skumap foreach ( $order->products as $product ) { $product->add( $skumap ); } mysql_query( 'ROLLBACK' ); mysql_query( 'SET AUTOCOMMIT=1' );
×
×
  • 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.