Jump to content

litebearer

Members
  • Posts

    2,356
  • Joined

  • Last visited

Everything posted by litebearer

  1. Just my 2 cents. perferred method: create a Price Update form. they can access via their browser, verify the data and click ok. the script then takes the data and stores it in a database. when the main price page is accessed that script gets the data from the database and displays it properly. It really really is NOT as hard as it might seem. If you need further help ask. Lite... rather than a txt/doc file (which is very prone to creator errors) perhaps use an excel template in which they enter the data
  2. Might look here [a href=\"http://www.class1web.co.uk/download_backup.php\" target=\"_blank\"]http://www.class1web.co.uk/download_backup.php[/a] Lite...
  3. it might help if you described what you are trying to achieve and what the exact obstacle appears to be. Also post the relevant portion of your script/code Lite...
  4. As a start, you might look into CMS Content Management Systems. It might be easier for you if you state your ultimate objective, then list the steps necessary to reach that objective. Try to do it in outline form and just use plain old everyday words. As you refine the outline you will almost magically come across the words/terms you need to research. Lite...
  5. Hmmmm, ok here comes hammer-man again. 1. each entry is placed in its own file. the name of the file is the timestamp of when the file is created. 2. place the timestamp/filename into an "index" file 3. when accessing simply place the index file into an array and sort the array(even with 100's of entries still rather quick) 4. use an array function to "grab' the 10/20/30/ target timestamps and display them ??? wadda ya think? Lite...
  6. Try this (use those portions that apply to your specific needs). I use it to test data content as well as duplicating/backing up table. And even to export the data to an excel file. (demo link is near bottom of this reply) [code]<?php ################################################################# #     this small script can be used to # #        get and display a database table's structure (field names and field type) #        get and display the field contents in an html table #        get and store the field names and contents to an excel file # # ################################## #    set the database variables $database="YOURDATABASENAME"; $location = "localhost";   $username = "YOURUSERNAME";   $password = "YOURPASSWORD";   $db_table = "edselford_1963"; ###################################### #    set the function switches #    0 means use #    1 means do NOT use $display_table_structure = 0; $display_table_contents = 0; $copy_table_data = 0; $csv_name = $db_table . "_" . time(); $how_many = 10; // use this value to limit the number of records returned in the data query (0 means no limit) ###################################### #    define the function(s) // This function gets the field names function my_db_get_table_field_names($table) {     $sql = "SHOW COLUMNS FROM `$table`";     $field_names = array();     $result2 = mysql_query($sql);     for($i=0;$i<mysql_num_rows($result2);$i++){         $row = mysql_fetch_array($result2);         $name = $row['Field'];         array_push($field_names, $name);     }     return $field_names; } ############################################ # connect to the database mysql_connect ($location, $username, $password); @mysql_select_db($database) or die( "Unable to select database"); $result0 = mysql_query("SHOW COLUMNS FROM $db_table"); if (!$result0) {   echo 'Could not run query: ' . mysql_error();   exit; } #################################################### #    get the field names into an array and count them $new_array = my_db_get_table_field_names($db_table); $fields = count($new_array); ################################################### #    get all the data and count the records if ($how_many == 0) {     $result = mysql_query( "SELECT * FROM $db_table" )     or die("SELECT Error: ".mysql_error());     $num_rows = mysql_num_rows($result); }else{     $result = mysql_query( "SELECT * FROM $db_table LIMIT $how_many" )     or die("SELECT Error: ".mysql_error());     $num_rows = mysql_num_rows($result); } ############################################################## #    display the general information echo "This information is for the " . $database . " database. Table " . $db_table . "<br><br>"; echo "There are " . $fields . " columns/fields  and " . $num_rows . " records.<br><br>"; ########################################################### #    display the table structure if ($display_table_structure == 0) {         echo "<hr>Table structure for " . $db_table . ": <br><br>";         echo "<table border=1> <tr><td>Field #</td><td>Field Name</td><td>Field Type</td></tr>";     $result9 = mysql_query("SHOW FIELDS FROM $database.$db_table");     $i = 0;     while ($row = mysql_fetch_array($result9)){         echo "<tr><td>" . $i . "</td><td>" . $row['Field'] . "</td><td>" . $row['Type'] . "</td></tr>";     $i = $i +1;     }         echo "</table>"; } ############################################################## #    display the table contents if ($display_table_contents == 0) {     echo "<hr>Table data for " . $db_table . ": <br><br>";     print "<table width='100%' border=1>\n";     $i = 0;     print "<tr>\n";     for ($i=0;$i<$fields;$i++) {       print "\t<td><font face=arial size=1/>$new_array[$i]</font></td>\n";     }     while ($get_info = mysql_fetch_row($result)){         print "<tr>\n";         foreach ($get_info as $field)             print "\t<td><font face=arial size=1/>$field</font></td>\n";             print "</tr>\n";     }     print "</table>\n"; } ################################################## # remove the comment tags to enable the excel file creation /* if ($copy_table_data ==0) {     ?>     <meta http-equiv="refresh" content="2;url=http://nstoia.com/mysqlexcel.php">     <?PHP } */ ?>[/code] demo is here [a href=\"http://nstoia.com/display000.php\" target=\"_blank\"]http://nstoia.com/display000.php[/a] Hope it helps. Lite...
  7. Look here and see if it helps... [a href=\"http://www.web-aware.com/biff/index_2.htm\" target=\"_blank\"]http://www.web-aware.com/biff/index_2.htm[/a] Lite...
  8. Might look here... [a href=\"http://fundisom.com/phpsnippets/snip/image_handling/resize_offsite_image/\" target=\"_blank\"]http://fundisom.com/phpsnippets/snip/image..._offsite_image/[/a] Lite...
  9. Well the sledge-hammer approach would be... 1. convert html to pdf using ... [a href=\"http://www.tufat.com/s_html2ps_html2pdf.htm\" target=\"_blank\"]http://www.tufat.com/s_html2ps_html2pdf.htm[/a] 2. convert pdf to jpg using ... [a href=\"http://redux.imagemagick.org/discussion-server/viewtopic.php?t=5242&sid=c3d14c53b20d9fa4ff22ae533c851d4f\" target=\"_blank\"]http://redux.imagemagick.org/discussion-se...f22ae533c851d4f[/a] not the cleanest approach but should work til a more elegant solution is presented. Lite...
  10. Might peruse this site... [a href=\"http://ffmpeg-php.sourceforge.net/\" target=\"_blank\"]http://ffmpeg-php.sourceforge.net/[/a] Lite...
  11. Although its not php and the demo uses multiple pictures, it seems that with a little tweaking one could apply this to separate images... [a href=\"http://www.agilepartners.com/blog/2005/12/07/iphoto-image-resizing-using-javascript/\" target=\"_blank\"]http://www.agilepartners.com/blog/2005/12/...ing-javascript/[/a] Lite...
  12. Might take a look here [a href=\"http://www.nsftools.com/tips/ImageResize.htm\" target=\"_blank\"]http://www.nsftools.com/tips/ImageResize.htm[/a] Lite...
  13. might look at (in_array()) [a href=\"http://us2.php.net/in_array\" target=\"_blank\"]http://us2.php.net/in_array[/a]
  14. take a look at the examples, in your code you haven't identified the resource. [a href=\"http://www.zend.com/manual/function.mysql-fetch-array.php\" target=\"_blank\"]http://www.zend.com/manual/function.mysql-fetch-array.php[/a] Lite...
  15. Just out of curiosity (frequently paraphrased by S. Holmes and Lt Columbo).... [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]I've got a small script that when a folder is entered it looks for thumbnails, if there aren't any they are created. so for each folder it's only being done once. However, sometimes a folder can contain up to a hundred highres photos[/quote] In what manner/fashion/method are the pictures originally being placed into the folders? Lite...
  16. The "hammer-man" is awake. (Hammer-man as in I have a propensity to use the sledge-hammer approach to quickly resolve problems) Here is a bit of code that will scrape data from the world time site. All you need to do is purge the result of any extraneous data. by changing the city value you could use it for most any major city in the world. edit: I seem to be having problems posting code - so you can view the script output here [a href=\"http://nstoia.com/dst.php\" target=\"_blank\"]http://nstoia.com/dst.php[/a] and download the script here [a href=\"http://nstoia.com/dst.zip\" target=\"_blank\"]http://nstoia.com/dst.zip[/a] Hope this is helpful. Lite (aka hammer-man )
  17. Sunday morning, daylight savings time, lost another hour of sleep, just took my meds, not happy with the bald spot that keeps growing on the back of my head (but at least its not being replaced by ones on my back or in my ears), anyway how about... a separate table |imageID|cksum value of image|cksum value of thumb| index on cksum values when new image uploaded, search the table for matches? Lite...
  18. Might also take a look here.... [a href=\"http://uk2.php.net/manual/en/function.chmod.php\" target=\"_blank\"]http://uk2.php.net/manual/en/function.chmod.php[/a] [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] If you cannot chmod files/directories with PHP because of safe_mode restrictions, but you can use FTP to chmod them, simply use PHP's FTP-functions (eg. ftp_chmod or ftp_site) instead. Not as efficient, but works.[/quote] Lite...
  19. look at... [a href=\"http://us3.php.net/mkdir\" target=\"_blank\"]http://us3.php.net/mkdir[/a] Lite...
  20. Try... [code] <?php if ($_POST["code"] == "list") {   <? <a href="Downloads/list.txt" target="top">See List</a>   <?PHP ; }else{ echo "Access Denied"; } ?>[/code] Note the use of braces Lite...
  21. short tutotial on basic basket [a href=\"http://www.phpbuilder.com/columns/evert20000816.php3\" target=\"_blank\"]http://www.phpbuilder.com/columns/evert20000816.php3[/a] Lite...
  22. Might look here... [a href=\"http://www.phpfreaks.com/tutorials/5/0.php\" target=\"_blank\"]http://www.phpfreaks.com/tutorials/5/0.php[/a] Lite.. oops! too slow again.
  23. Answer may be here... [a href=\"http://us2.php.net/keyword.parent\" target=\"_blank\"]http://us2.php.net/keyword.parent[/a] Lite...
  24. Hi... Not sure if it is me or if others are experiencing the same thing, but for the past day and a half, I have been unable to post certain code ie using f open or f read specifically. Any ideas? Thanks, Lite...
  25. Not sure why its not displaying code for me, but one more try... --- note this proceedure IS case sensitive [code]<?PHP $file_name = "some_data.dat";// set data file name $needle = "John";// set search variable $fp = f open($file_name, 'r'); // open the data file // remove the space between f and open - for some reason the board will NOT let me post the code properly $haystack = f read($fp, filesize($file_name));// read the entire contents of the file into a string // remove the space between f and read - for some reason the board will NOT let me post the code properly $ntimes = substr_count($haystack, $needle);// count times $needle is in $haystack if ($ntimes > 3) {   // do something } ?>[/code] Lite...
×
×
  • 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.