Search Results

Search found 3 results on 1 pages for '1001001'.

Page 1/1 | 1 

  • .htaccess mod_rewrite URL query

    - by 1001001
    I was hoping someone could help me out. I'm building a CRM application and need help modifying the .htaccess file to clean up the URLs. I've read every post regarding .htaccess and mod_rewrite and I've even tried using http://www.generateit.net/mod-rewrite/ to obtain the results with no success. Here is what I am attempting to do. Let's call the base URL www.domain.com We are using php with a mysql back-end and some jQuery and javascript In that "root" folder is my .htaccess file. I'm not sure if I need a .htaccess file in each subdirectory or if one in the root is enough. We have several actual directories of files including "crm", "sales", "finance", etc. First off we want to strip off all the ".php" extensions which I am able to do myself thanks to these posts. However, the querying of the company and contact IDs are where I am stuck. Right now if I load www.domain.com/crm/companies.php it displays all the companies in a list. If I click on one of the companies it uses javascript to call a "goto_company(x)" jQuery script that writes a form and submit that form based on the ID (x) of the company. This works fine and keeps the links clean as all the end user sees is www.domain.com/crm/company.php. However you can't navigate directly to a company. So we added a few lines in PHP to see if the POST is null and try a GET instead allowing us to do www.domain.com/crm/company.php?companyID=40 which displays company #40 out of the database. I need to rewrite this link, and all other associated links to www.domain.com/crm/company/40 I've tried everything and nothing seems to work. Keep in mind that I need to do this for "contacts" and also on the sales portion of the app will need to do something for "deals". To summarize here's what I am looking to do: Change www.domain.com/crm/dash.php to www.domain.com/crm/dash Change www.domain.com/crm/company.php?companyID=40 to www.domain.com/crm/company/40 Change www.domain.com/crm/contact.php?contactID=27 to www.domain.com/crm/contact/27 Change www.domain.com/sales/dash.php to www.domain.com/sales/dash Change www.domain.com/sales/deal.php?dealID=6 to www.domain.com/sales/deal/6 (40, 27, and 6 are just arbitrary numbers as examples) Just for reference, when I used the generateit.net/mod-rewrite site using www.domain.com/crm/company.php?companyID=40 as an example, here is what it told me to put in my .htaccess file: Options +FollowSymLinks RewriteEngine On RewriteRule ^crm/company/([^/]*)$ /crm/company.php?companyID=$1 [L] Needless to say that didn't work.

    Read the article

  • Passing a template func. as a func. ptr to an overloaded func. - is there a way to compile this code

    - by LoudNPossiblyRight
    Just a general c++ curiosity: This code below shouldn't compile because it's impossible to know which to instantiate: temp(const int&) or temp(const string&) when calling func(temp) - this part i know. What i would like to know is if there is anything i can do to the line marked PASSINGLINE to get the compiler to deduce that i want FPTR1 called and not FPTR2 ? #include<iostream> using std::cout; using std::endl; /*FPTR1*/ void func(void(*fptr)(const int&)){ fptr(1001001);} /*FPTR2*/ void func(void(*fptr)(const string&)){ fptr("1001001"); } template <typename T> void temp(const T &t){ cout << t << endl; } int main(){ /*PASSINGLINE*/ func(temp); return 0; } Thank you.

    Read the article

  • selecting a range of verses from a database

    - by Noam Smadja
    i have a database, with verses from the bible, with those fields: book (book number), chapter (chapter number), verse (verse number), text (the verse) example: 1 1 1 In the beginning God created the heaven and the earth. first 1 is for Genesis, second 1 is for chapter 1, third 1 is for verse 1 user gives me something like 1 1:1 - 1 1:4 which means he wants to show Genesis 1:1-4. what i want to do is something like SELECT book*100000+chapter*1000+verse AS index FROM bible WHERE index >= 1001001 AND index <=1001004 or WHERE book*100000+chapter*1000+verse >= 1001001 AND book*100000+chapter*1000+verse <= 1001004

    Read the article

1