Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. Is the > stored as its html entity - > It would display as a > in a browser and as > in the 'view source' of the output, and you would need to search for and replace it using - >
  2. What operating system? MS has limits on the number of concurrent tcp/ip connections for the non-pro/non-server versions of its operating systems.
  3. This is going to sound all negative, but you should not have columns in a database with names like - name_1, name_2, ... that store same meaning data. Doing so makes writing any query and code that manipulates that data, difficult. Which you have found to be the case with your UPDATE query. Same meaning data should be store as one row per data item. You can then easily write a query to find, store, or change just that one data item or any or all the related data items.
  4. You need to debug exactly where your code and data are doing what you expect and exactly at what point they are not to pin down the problem. Is the form submitting the expected $_POST data? Is the code where the query at even being executed? Is the query producing an error when it runs? Is the page blank (and if it is, what does the 'view source' in the browser show)? Are there any php detected errors in the error log? Do you have php's error_reporting set to E_ALL and display_errors set to ON or log_errors set to ON, so that all the php detected errors will be reported and displayed/logged?
  5. echo $this->db->error;
  6. Are you sure the problem is the size? It's more likely that your framework is outputting something before the headers, which prevents them from working, and the browser doesn't know what to do with the csv data. Do you have php's error_reporting set to E_ALL and display_errors set to ON, so that all the php detected errors will be reported and displayed?
  7. You can only download ONE file per download link. You would need to add a GET parameter (similar to pagination) to each download link that specifies which block of data it should output. Your code would then use that GET parameter to determine the correct rows that the database query should retrieve. The only way you could download multiple csv files at once, would be to create a .zip archive containing all the csv files. Why do you need to do this using multiple .csv files?
  8. Since we are bumping this (already solved) thread - a solution using mktime/date has already been posted and it's been pointed out that using mktime/date doesn't work for people born before 1970 or 1901 (depending on php version and 32/64 bit operating system.) Topic locked...
  9. Your first step would be to simplify and make the check____ function general purpose, so that it is passed everything it needs at runtime (generic parameter names, no hard-coded "status" id.) Then you can simply duplicate the logic, replacing the regex pattern so that it describes what you want the field to contain - <script type="text/javascript"> function checkEmail(value,status_id){ var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; document.getElementById(status_id).src = (reg.test(value) == false) ? "/images/bad.png" : "/images/ok.png"; } </script> <td>Email Address:</td><!--Has to be a valid email address format to display the 'ok' image --> <td><input type="text" id="email" name="email" onkeyup="checkEmail(this.value,'estatus');" onblur="checkEmail(this.value,'estatus');" maxlength="60" size="30"/></td> <td><img src="images/bad.png" alt="Status" id="estatus" style="margin-left:5px; vertical-align:middle;" /></td> <td> </td>
  10. The only things I can tell from this thread are - you managed to find the Php Coding Help section and you are most likely a real person. A large percentage of first posts that are in a non-main sub-forum section are by spammers/bot scripts as a test, and they never post again. Without (any) readable, formatted code, and an actual programming question about it or an error or a specific symptom you got when you run your code, there's nothing we can do to help you. So far all you have stated is what you want and that you expect a help forum will fix your code for you.
  11. No one is going to reply to your question in a hijacked thread, that has a title and content that's nothing to do with what you are trying to do. Start your own thread for your problem. Topic locked.
  12. You create the 'clean' URL by producing that URL in your code. Typically this is done by writing a function that takes the normal URL, produces the 'clean' URL based on the rules you have defined, and returns the clean URL to be output where needed - function _make_clean_url($url,$title){ $arr = parse_url($url); $arr['path'] = dirname($arr['path']); parse_str($arr['query'], $output); // $output['aid'] is the 123 value // produce the 'clean' url - $url = $arr['scheme'] .'://'. $arr['host'] . $arr['path'] .'/'. $output['aid'] . '-' . str_replace(' ','-',$title) . '/'; return $url; } // example usage $post_title = "title of current page"; $normal_url = "http://www.example.com/members/1/posts/page.php?aid=123"; // note: the use of htmlentities() in the following is for demo purposes and would not be used when outputting an actual url echo htmlentities(_make_clean_url($normal_url,$post_title)); And since this seems to be a duplicate thread, merging the two threads...
  13. You need to use the error reporting method/function of your database interface to find out why the query is failing. This is why Jessica asked what underlying database library you are using - mysql, mysqli, PDO?
  14. @Rahorku, When she stated the WE don't approve of that sort of thing, she was replying as a badged member of this forum. And since we don't help people break the terms of service of other sites, this thread is locked....
  15. Is the HTML of the form page valid? Check it at validator.w3.org What data is actually submitted to the server side code vs what is supposed to be submitted? What's missing or invalid in the data? What execution path does the form processing code take? Does the form/form processing page require someone to be logged in and perhaps the session id isn't being propagated by the browser? Is https involved for the form and form processing page? Beyond that, you would need to post at least the 'view source' of the form page for anyone here to be able to help.
  16. +1 for running one query to process all the data you need at once (both in the form and the form processing code), and for storing the id. This will also reduce the amount of code you have, which will make it easier to see what your code is or is not doing. The reason that the id for the [replacement] form field is being stored is because that's the value that your code is putting into the INSERT query - $items['replacement'] In fact, your original code doesn't even have any code to SELECT the value that corresponds to the submitted id from the replacement form field.
  17. You need to use the Advanced Search to find anything more than one year ago.
  18. The quickest way of doing something like inserting new rows/updating (replacing) existing rows for something like an inventory, is to use a multi-value REPLACE query - REPLACE tbl_name (col_name,...) VALUES (value,...),(...),...
  19. A) You didn't mention in your first post that this had anything to do with a pre-build application like phpbb. B) You need to trouble-shoot why you are getting the result you are, before you can fix it, otherwise you will just waste a bunch of time. C) Is that all your actual code inside of the while(){} loop? A next likely cause of the symptom you have indicated is you are overwriting the $result variable inside of the loop. It's also possible that something in the data you are outputting via the print_r is hiding the actual output inside of a html tag. What does the 'view source' in your browser show? D) I didn't see a num_rows() method mentioned in the phpbb database class. It would have been nice if they had provided a method of finding out how many rows a select query matched.
  20. It's likely that your ->sql_fetchrow() method is at fault. What's the code for it?
  21. You would need to post data from both tables that reproduces the problem and the actual query to get help. You are either joining on the wrong column or the data in the table isn't what you imply it is.
  22. @Love2c0de, The foreach() loop's purpose was to run the single print statement for all the <td>$field</td> values, followed by printing one </tr> tag. For a single statement, you don't need the {} and the code you posted would print the </tr> tag after every </td>$field</td> value.
  23. You would need to post the code that reproduces the problem for anyone here to be able to determine why it is behaving that way. There is not a ONE answer = ONE problem relationship in programming since there are multiple ways of accomplishing any task.
  24. If you set the second parameter in the json_decode statement to a true, the resulting array of data will be simpler to manipulate.
×
×
  • 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.