Jump to content

anupamsaha

Members
  • Posts

    251
  • Joined

  • Last visited

    Never

Everything posted by anupamsaha

  1. Try this: foreach($result->response as $response) { echo $response->ListID . "\n"; }
  2. If you are using PHP5, please try the following: class validate { function __construct() {} function check_input($name) { $data = trim($name); $data = stripslashes($name); $data = htmlspecialchars($name); return $name; } } Thanks!
  3. @MrGeezer: Can you tell us what error you see from the line?
  4. Put the following at the top of your PHP code and see what errors are you getting: error_reporting(E_ALL); ini_set("display_errors", 1); Thanks!
  5. Or, 1. take the errors array into a session 2. show the errors in the target page from the session 3. unset the session variable in the target page after the errors are displayed Thanks!
  6. Please mark the topic as "solved" if you have a solution or satisfied with the answer provided. Thanks!
  7. Can you provide your code here or some URL to check the actions? Thanks!
  8. You can check this out: http://phpexcel.codeplex.com/ Also, search in http://www.phpclasses.org/ for the class that handles excel files. Thanks!
  9. And also, put MySQL field names in backquote operators, so that it never conflicts with MySQL reserve word. E.g. "password" is a MySQL reserve word. Try this: $user = mysql_real_escape_string($_POST['user_name']); $pass = mysql_real_escape_string($_POST['password']); $query = "SELECT * FROM `users` WHERE `user_name` = '$user' AND `password` = 'pass'"; $user_name_check = mysql_query($query); Thanks!
  10. Try this: $IPArray = array("123.456.58.451", "123.126.456.10", "123.126.456.10"); if (in_array($IPaddress, $IPArray)) { // If found the IP from the array, do whatever you like to do } else { // If not found the IP from the array, do whatever you like to do } .... Thanks!
  11. $result has to be freed up from the memory. Even you have closed the MySQL connection, but the resultset object is still available in the memory and that is nothing to do with the MySQL connection. Try the following: $result=mysql_query($result); mysql_close($con); // DB connection closed mysql_free_result($result); // Free resultset from memory Hope this helps. Thanks!
  12. If you have the access to php.ini file, you should be able to do this using disable_functions(). Thanks!
  13. See parse_url() and reconstruct the URL in whatever way you want. Thanks!
  14. Put session_start() at the top (below <?php) tag and see how it works. Thanks!
  15. In your show.php file, put session_start() before require_once(). It will work. Thanks!
  16. As a thumb rule, file permission should be 644 and folder permission should be 755. Thanks!
  17. In your Ajax construct, add dataType: 'json'. This will enable jQuery to understand the data type that coming from the script. Or you can use $.getJSON instead of $.ajax. See http://api.jquery.com/jQuery.getJSON/ for more help. Then, you can get the data like: data.0 data.1 and so on. Thanks!
  18. Please mark the topic as "solved" if you are satisfied with the answer. Thanks!
  19. If you need browser to access the files, then put 644 as permission. If PHP is running as CGI, you can set 700. Thanks!
  20. Go for strstr() or stristr() to get your job done. Read more from here: http://php.net/manual/en/function.strstr.php Hope it helps. Thanks!
  21. I don't think that it would impact negatively. Thanks!
  22. Regarding the password, you can use .htpasswd for this. You will find lots of article towards .htpasswd. And, regarding the file permission, you can set 640 (i.e. Owner will have read+write, group will have read-only and rest of the world can do nothing). Hope this helps. Thanks!
  23. Please change "return" to "echo" or "print". Example: echo jeson_encode($test); Thanks!
  24. You can have the file in web root, but, with extra care through .htaccess file. You can protect file(s) from reading through browser in .htaccess file. Here is an article to give you an idea: http://www.techiecorner.com/1245/how-to-block-access-to-certain-file-types-using-htaccess/ Try it and let us know if it works or not. Thanks!
  25. Two possible ways are ther: 1. Create the option list inside a DIV with an unique ID and make it non-visible (style="display:none") when you render the page. Then define a click event on the image and through JavaScript show the DIV (style="display:block") 2. Create a blank DIV. And on click event for the image in JavaScript, call a script through AJAX that will generate the list and pass back to the Ajax calling point. Then after Ajax success, you can set the "innerHTML" of the DIV with the returned HTML from Ajax. Hope this helps. Thanks! Anupam
×
×
  • 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.