Jump to content

girish.kc

Members
  • Posts

    45
  • Joined

  • Last visited

Everything posted by girish.kc

  1. Hi, I have developer a PHP application which works fine in root directory [document_root]. No I have a situation that needs the application to work from any directory by changing few config parameters. I have used the root-relative links in allover the application. Is there any easy way to accomplish this? If not I have to change all the pages having the links. Please advice. Girish
  2. Yes . I tried without [L]. Same result.
  3. No.. It is creating the problem. When a POST request is sent, this 301 will redirect the request and the POST request becomes GET. So the POST value will be lost..
  4. Yes. I have the index.php in DirectoryIndex, But for the request "https://api.xyz.com/folder" I am getting the following response
  5. Hi, Is there a way to modify the incoming URL request with rewrite? In my case, I have an external application calling mine with the URL I want this to be rewritten as I tried the following .htaccess to do that. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^folder$ /folder/index.php [L] </IfModule> But the problem here is, this is a POST request and because of rewrite server is sending back the '301 Moved Permanently' status back to the requester. Is there any way I can skip sending 301 and redirect without loosing the POST data? Thanks, Girish
  6. Hi, In my application I have not used any folders to define the hierarchy. All file s are in a single folder. What is the easy way of creating the Breadcrumb. I am rewriting the URL from www.mysite.com/main.php/page=pagename&id=10 to www.mysite.com/main/pagename/id/10 Is it possible to use the re-written URL to create the breadcrumb? If yes I can define hierarchy in the URL and use the same to create breadcrumb.
  7. Thanks for the quick replay. I figured a way... I'll give the list of users to the Super Admin. Super User can select and click on 'Login AS' button which will reset the existing session and create a new session using the SELECTED user's credentials. Thanks
  8. My application has 3 user types. Admin , User and Super Admin. Users can register as either Admin or User. Each user type has different UI and functionality. The problem: If a particular type of user reports a problem/bug in his/her login, it is difficult to pin point to the exact problem. So if I could able to login as that user, then it will be very easy to point out the bug/problem. So I'm looking for some kind of master password. Using any username and the master password I should be able to login AS that user. Any suggestions..?
  9. Hi, I'm working on an application which interacts with an embedded device. Here I'm sending the time in EDT. The following code is used to send the time: $time = date_format(date_create(null, timezone_open("EDT")), "s,i,H,d,m,Y,w"); Here 'm' is from 01 to 12. But at the receiving end the firmware expects the month to be in the range 0-11 (C-style). Yes I can explode the "$time" and subtract 1 from month. But is there any better way to do that..? Thanks, Girish
  10. Sorry.. By mistake I posted the wrong code. Yes I know how mysql_pconnect() works. I am not using _pconnect.. I was just testing with it. Here is the actual code I'm using: /* establish connection, select database */ if (0 == $this->Link_ID) { $this->Link_ID = mysql_connect($Host, $User, $Password); if (!$this->Link_ID) { $this->halt("connect($Host, $User, \$Password) failed."); return 0; } } if (!@mysql_select_db($Database, $this->Link_ID)) { $this->halt("cannot use database " . $this->Database); return 0; }
  11. Hi I am using a php class to connect to the MySQL database, which uses the following code snippet. /* establish connection, select database */ if (0 == $this->Link_ID) { $this->Link_ID = mysql_pconnect($Host, $User, $Password); if (!$this->Link_ID) { $this->halt("pconnect($Host, $User, \$Password) failed."); return 0; } } if (!@mysql_select_db($Database, $this->Link_ID)) { $this->halt("cannot use database " . $this->Database); return 0; } Now I'm facing the mysql idle connections problem. The number of idle connection is growing rapidly even the max_used_connection is very less. I tried to set the variable wait_timeout and interactive_timeout to as low as 5. But there is no improvement. Need some help. Girish
  12. Hi, I am using web safe fonts in my application but still in Linux Firefox the font looks very thick. In windows it is perfectly fine. Here is my css code: font: bold 18px Trebuchet MS, Helvetica, sans-serif seems to be problem with only the bold. Need some advice. Thanks, Girish
  13. Hi silkfire, Very quick replay.. Thanks a lot.
  14. I am working on a report generation. Here I need to count the number of months involved in the selected date range. I need to apply the monthly charges accordingly. Example: If the user selects 25-08-2011 to 03-10-2011, it should return 3 as the number of months. Yes, the number of days are less than 60 but still the date range is spread across 3 months. Any solution.. Please. Girish
  15. Hi, Have a application which receives the status update every 3 mins from external device through http request. All these status are inserted into a table with date/time as gmdate(). Recently we were doing the server fail-over test. Which is basically switch the dns if primary server fails. While doing so, we found that there was an entry in the table with the 'server time' not with the gmdate(). Is there any chance of getting wrong date/time while gmdate() fetching it? Help needed. Thanks:) Girish
  16. @monkeytooth: Thanks for the quick replay. I already have firebug installed for firefox. I will try to combine multiple requests. Right now the application is working fine [say 99%], but some times I'm facing the response delay problem. Anyway it is better to look into this, because it may fail at any time. Thanks again for the suggestion. Girish
  17. Hi, In my application, I'm using AJAX extensively. In some cases the page needs more than 2 ajax calls to get the required data. And some case, response from one call will be the input for other call. I'm facing some delay problem wile dong the ajax call. If one response is delayed, the other will fail. Any idea how to resolve this? Is it a good idea to spun multiple AJAX calls one after other or combine them in a single call? which will be faster? Thanks, Girish
  18. Hello, I am new to payment gateway. I am trying to implement http://www.firstdata.com as the payment gateway in my application. I found that the address Validation System(AVS) will work only after the approval of the transactions. This is strange!!. So I planed to do an pre-auth to check the address, and then do the actual transaction. But if the address validation is failed, I need to release the amount reserved by the pre-auth request. How can I do that. I don't find any way to do that. Void will cancel the completed transaction and not the pre-auth. I tried to post - auth with 0.00 amount, but still it does the ticket only transaction for the full amount reserved by the pre - auth request. Please help me. Girish
  19. Thanks, I'm using the following : phone_number like '%1%2%3%4%' to search for the phone number.
  20. Hello, I have a Phone number lookup in my website. The number in table may be in different formats like (123) 456 - 789 OR 123-456-789 OR 123456789 OR 123 456 789 etc.. But now how to search the numbers from the table. If the user enters 123456789 it should select the record with this number in any format. Please help. Girish
  21. The first option looks very complicated and may not be practical in my case. Because every source will send it's status every 3 mins. Triggers.. Yes I can try this. Thanks again.
  22. @gizmola: Thanks for the info. I'm not throwing away the insert, but don't want to try 'Insert on Duplicate Update' Because. I am working on an application which gets the status update from many ( in 100's now and may be 1000's later) sources. I just want to store the latest status of each source in a table for the report generating purpose. So I'm updating ONLY the status field of the table. If the update fails [non-existing record], I have to fetch the other info related to the source from another table and insert it. So for handling few non-existing records I can't do one more query to build the record. The flow is as follows: Receive the status from the source update the status field 'Status' table for the source. if not exists Get the source details from 'Source' table Insert into 'Status' table along with the new status
  23. Thanks for the replay. @Zyx: I don't want to insert the record if not exists. So can't use 'Insert on Duplicate' @requinix: I am settled for that now. But I'm trying to avoid the 'Select' before running the 'Update'. The reason is load. I have to update few hundred records every 3 mins. There may be [may not be also] few non-existing records. So the 'Select' will be an unnecessary burden on the db server.
  24. Hi, I am trying to update the status of the record. I don't want to insert the record if not exists. I just want to know the update is success or not. I tried using affected_rows but it returns 0 if the existing status is same as the new status or if no record exists. Please help.
  25. Hi, I am creating a temporary table. I need to check if the table already exists or not. If exists, I have to use the existing data else have to create a new temporary table. I can use 'Create If Not Exists'. How practical is this query? any issues with the performance? If the table exists it will be a huge data, I don't want to loose that data because recreating is an un-necessary load on the database.
×
×
  • 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.