Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. Actually you could do this in the query by using msyql CONCAT() to get the `salt` column and the entered $_POST['password'] and then use mysql SHA1() function and compare the result with the `password` column.
  2. Use full opening php tags (always) - <?php phpinfo(); ?>
  3. The file that dynamically outputs the headers, followed by the file contents CANNOT do anything else. It simply won't work. If you want to do anything on the page where the download link was at, you need to do it on that page, not in the download code. See the following topic for a possible way you can both trigger a download and do something on the originating page - http://www.phpfreaks.com/forums/php-coding-help/form-reload-problem/msg1516679/#msg1516679
  4. That's doesn't sound like you want to remove duplicates. It sounds like you want to group same brand data together and process it in a specific way. Do you have an example of the final result you are trying to produce?
  5. SELECT source, COUNT(*) as cnt FROM your_table GROUP BY source
  6. $brands = array(); foreach($results['data'] as $arr){ $brands[] = $arr['brand']; // get list off all brand values } $brands = array_unique($brands); // unique list of brand names
  7. If the change was actually made to the source code in the file, then someone had sufficient access to the server to be able to read, change, and write the file. You should get and check the server log files to find out all the information you can about who, what, when, and from where your file got written to. You should also download a copy of all your files, taking card to NOT overwrite any existing backup copy of your files, and then use comparison tool, like WinMerge - http://winmerge.org/ to find all the differences between your last backup copy and the current files, including any new files that are not part of your web page.
  8. That best way of accomplishing that would be to not pass the information through the URL in the first place. Can you pass this same information between pages using $_SESSION variable(s)? There is no magic in programming. zip/gz compression looks for sequences and patterns in the data and makes a table. It then replaces those patterns in the data with a token/value that represents the corresponding entry in the table. The table and the 'tokenized' data must then be transfered, in binary, which would itself require something like base64 encoding to get it all into a URL. You reverse the process when you uncompress the data.
  9. If the To: and From: email address are at gmail, like you show in your post, are you sending this email using a gmail mail server? If not, gmail will discard your email because it knows that the actual sending mail server is not a gmail mail server. You must put an email address that at least has a domain that corresponds to your sending mail server into the From: address header.
  10. Assuming there is repetitive data and data patterns, you could compress/uncompress the data using zip or gz compression. If the data is not repetitive or is fairly short, the result will still be longer than the original and you will have also wasted the processing time needed to compress/uncompress the data. What exactly are you trying to accomplish?
  11. Since you are just now getting around to processing that data, there's no point to NOT fixing the format, assuming you are dynamically producing this large amount of data forms using php code. You haven't hard coded these by writing out the HTML for each each one have you? If your select field names are already stored some where (array, flat-file, database) using the id portion of the name, you can save yourself a lot of work by having php produce your forms, using the suggested arrays.
  12. You are missing the semi-colon ; on the statement immediately before the line with the }else{
  13. For the problem with the split() statement - If you have other errors you need help with, you would need to post the error and the code that produces the error.
  14. You are apparently using mysql_real_escape_string() on the WHOLE query statement, not just on the individual string data values being put into the query. Someone already asked that you post the code that is building the query.
  15. trim() and nothing in the code you posted removes anything from a number. You have something else wrong in your code that is causing that symptom.
  16. See this link - mysql_insert_id Yes it would be a problem if two or more rows were inserted at the same time. Using mysql_insert_id avoids this problem since the value returned is per connection and it will return the id of the row that was just inserted in the current invocation of your script.
  17. FROM (the point in the query that is being called out in the error message) is a reserved mysql keyword, as in SELECT * FROM table_name. You either need to rename your column to something else or you must enclose the column `FROM` in back-ticks every time you use it in a query.
  18. That code is an implementation of choice #2 on the list of possible ways to do this. Can you not look at that code and step through what it is doing and see that it is setting $separator to an empty string before the first pass through the loop so that nothing will be echoed before the first value. It then sets $separator to the actual separator value after the first value has been echoed so that the remainder of the values will have the ', ' separator.
  19. Your delete form has got one opening <form> tag (before the start of the foreach(){} loop), but you are closing that </form> inside of the foreach(){} loop, over and over, thereby making the HTML invalid. Start by making sure the 'view source' of your form is what you want.
  20. The error means that the query failed due to an error. It does not mean that the query matched zero rows. One of the possible errors would be a sql syntax error if $myArray[$i][6] is empty or non-existent. You should form your query string in a variable, such as $query, and then echo the query so that you can see what it actually contains. You should not nest mysql_fetch_row(mysql_query()) functions as that prevents you from testing if the query executed without errors before you attempt to fetch data from a non-existent result resource (a query that matches zero rows returns a result resource that contains zero rows.) You would then also be able to use mysql_num_rows() to determine how many rows the query returns when it actually executes without errors. Edit: Using some error checking and error reporting logic on the query, would have pointed out where in the query to look.
  21. 5) Concatenate the values into a string, putting the ', ' before each value, except on the first pass through the loop.
  22. There are several different ways you could do this - 1) Use GROUP_CONCAT() in your query to return the list of values the way you want, 2) Echo the ', ' before each value, except on the first pass through the loop, 3) Put the values into an array and use implode() to form the list of values, 4) Concatenate the values into a string and then trim the extra ', ' off of the end of the string.
  23. You code is missing the code it would need to work. You are not assigning the value that mysql_query() returns into a variable. It would be a result resource if the query executes without any errors. You are also not fetching a row from that result resource, so the $row variable doesn't exist.
  24. You cannot write to a file using the http protocol. The php.net fopen documentation page contains a link to a List of Supported Protocols/Wrappers that shows what you can and cannot do for each possible protocol.
  25. It's more likely that your code that is generating the form is putting the wrong value in the 'PImgRef' field and $_POST['PImgRef'] doesn't contain what you expect. This has nothing to do with the back-ticks and your table name. Have you done a 'view source' in your bowser of your form page so that you know it is correct?
×
×
  • 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.