Jump to content

litebearer

Members
  • Posts

    2,356
  • Joined

  • Last visited

Everything posted by litebearer

  1. rough idea... new html table column ACTION each cell in the column will have the words EDIT DELETE the words will link to an edit or delete script. the link will pass the ID value of the data use GET in the edit or delete scripts. then take the appropriate action
  2. what error(s) are you getting when using sessions? (show the code that is failing)
  3. Show us your form and your full script
  4. 1. what error are you receiving? 2. have you tried echoing $valuta?
  5. Untested... Put this right after $lines = file('file.txt'); $c = count($lines); if($c>30) { $lines = array_slice($lines, 0, 30); }
  6. My typo... this: if(strlen($temp_array1[0])>10){ $value = substr($dtemp_array1[0], -10) . $needle; }else{ $value = $temp_array1[0] . $needle; } if(strlen($temp_array1[1])>10){ $tail = substr($dtemp_array1[1], 0, 10); }else{ $tail = $temp_array1[1];} should be: if(strlen($temp_array1[0])>10){ $value = substr($temp_array1[0], -10) . $needle; }else{ $value = $temp_array1[0] . $needle; } if(strlen($temp_array1[1])>10){ $tail = substr($temp_array1[1], 0, 10); }else{ $tail = $temp_array1[1];} $tail will contain any text that follows your search up to 10 characters
  7. 1. presumes lines in file.txt terminate with \n 2. presumes $needle only appears once in a line <?php $needle = 'https:\/\/superman.com\/'; $lines = file('file.txt'); echo"<html><head><title>SEARCH RESULTS FOR: $needle</title></head><body>"; foreach($lines as $line){ if(stristr($line,$needle)){ $temp_array1 = explode($needle, $line); if(strlen($temp_array1[0])>10){ $value = substr($dtemp_array1[0], -10) . $needle; }else{ $value = $temp_array1[0] . $needle; } if(strlen($temp_array1[1])>10){ $tail = substr($dtemp_array1[1], 0, 10); }else{ $tail = $temp_array1[1];} echo "<font face='Arial'>" . $value . $tail . "</font><hr>"; } ?>
  8. Look at this tutorial... http://www.tizag.com/mysqlTutorial/mysqlfetcharray.php
  9. are you looping thru the results? your line 66 indicates you are only 'grabing' 1 row $row_rsVoucher = mysql_fetch_assoc($rsVoucher);
  10. ginerjm - The points are redemeenable at all S & H Green Stamp stores OP - people usually are very hesitant to download files from strangers. it is more appropriate to use the proper code tags and display your pertinent files. ALSO make sure you have NOT listed your username/password in the posted files
  11. as an illustration to Mac's response... what does $sql contain on its second iteration?
  12. presuming each line in your file terminates with a return, you might look here... http://www.php.net/manual/en/function.array-slice.php
  13. 1. check here - http://www.tizag.com/mysqlTutorial/mysqlwhere.php 2. show us what you have tried thus far, and tell us where you are experiencing the problems/errors
  14. http://www.tizag.com/phpT/fileupload.php
  15. Perhaps... if(isset($_POST)){ $needle = $_POST['customerId']; $new_line = $needle . "," . $_POST['name'] . "," . $_POST['email']; $lines = file("customers.csv"); $c = count($lines); $i = 0; while($i<$c) { $t_array = explode(",", $lines[$i]); if($t_array[0] == $needle) { $lines[$i] = $new_line; } $new_data = $new_data . $lines[$i] . "\n"; $i ++; } $file_handle = fopen("customers.csv", 'w'); fwrite($file_handle, $new_data); fclose($file_handle); }
  16. Also look into unique constraints for your table fields - http://dev.mysql.com/doc/refman/5.0/en/create-table.html
  17. hint... $orderID = $_GET['orderID'] and so on
  18. what have you done to find the problem.... 1. have you tested/verified the values of your variables? 2. have you tried sending just 1 email to yourself using set values for the appropriate variables?
  19. Show us your db connection sans username and password
  20. $query = "SELECT * FROM " . $myusername . "-mail ORDER BY date ASC"; echo $query;
  21. try echoing your query to make sure it contains what you expect it to contain
  22. $query = "SELECT manager FROM tablename WHERE manager='$manager'"; echo $query; exit();
  23. Did you echo your query to see if it contains what you expect it to contain?
×
×
  • 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.