Jump to content

poe

Members
  • Posts

    143
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

poe's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. i am trying to do a rewrite on 2 different types of urls.. the first configuration can be 1 of 3 ways... http://localhost/site/index.php?type=top&pg=2 http://localhost/site/index.php?type=new&pg=3 http://localhost/site/index.php?type=fav&pg=1 etc... i want to rewrite so it shows as http://localhost/site/top/2/ http://localhost/site/new/3/ http://localhost/site/fav/ notice how the third sample (pg 1) doesnt need to show fav/1/ in the url, but instead show as /fav/ so far i have : RewriteEngine On RewriteRule ^top/([a-zA-Z0-9]+)[/]?(.*)$ index.php?type=top&pg=$1 RewriteRule ^new/([a-zA-Z0-9]+)[/]?(.*)$ index.php?type=new&pg=$1 RewriteRule ^fav/([a-zA-Z0-9]+)[/]?(.*)$ index.php?type=fav&pg=$1 ... but i am missing how i can leave off the last part of the url if it is page 1 the second configuration is similar to the first except it is done by an infinite number of categories, which i would like to avoid listing each rule out seperatley per category. the url will look like this... http://localhost/site/index.php?cat=apparel&pg=2 http://localhost/site/index.php?cat=toys&pg=1 http://localhost/site/index.php?cat=footwear&pg=6 etc.... (can have unlimited number of categories) and again my goal is to have the url look like : http://localhost/site/apparel/2/ http://localhost/site/toys/ http://localhost/site/footwear/6/ and just like the first configuration, if on page 1, i wish to leave the pg out of the url. so far i am trying to work with something like this : RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)[/]?(.*)$ index.php?cat=$1&pg=$2 it fails when i try a url with no page defined (page 1) thanks chris
  2. i think this seems to work.. $html = preg_replace('#Hm0_([0-9]+).js#', 'Hm0_\1.xx', $html); thanks chris
  3. i need to replace all text references that have vbHmo characters from : this -> that: vbHm0_156.js -> vbHm0_156.xx vbHm0_1409.js -> vbHm0_1409.xx vbHm0_1267.js -> vbHm0_1267.xx the # after the _ is a random number and can be either 1 to 5 digits inlength.. so basically all i am fdoing is changing the .js to .xx
  4. i am reading an html file... i do not have the string.. i am trying to find it... so the string i am looking for is "basePath":"\/" so i need to find the string in the page and change to "basePath":"www.mypage.com\/" ie. here is part of the full string i am searching
  5. i have this string "basePath":"\/" how do i do a preg_replace to this "basePath":"www.mypage.com\/" i tried this, but doesnt work $repWhat = "/\"basePath\":\"\/\"/i"; $toWhat = "\"basePath\":\"www.mypage.com\/\""; $html = preg_replace($repWhat, $toWhat, $html); thanks
  6. i have 2 arrays... first array of lastnames, second array of firstnames lastAry = array('smith', 'jones', 'reed', 'chan') firstAry = array('mary', 'chris', 'kim', joe', 'sara', 'tim', 'amy', 'fred') how do i loop through each lastnames and turn into a string with firstname so it looks like : smith | mary | chris jones | kim | joe reed | sara | tim chan | amy | fred
  7. 204 no content error : If you click a link which has no target URL, this response is elicited by the server. It's silent and doesn't warn the user about anything. what exactly does this mean... i search everywhere for 204 error, and every page i find gives the same definition but do not give example of what it means ! if i wanted to intentionally create this error how would i do it ?
  8. poe

    password protect

    if i have 5 folders in my directory /vacation /house /friends /pets /sports how do i password protect each folder, with each folder having a different userID & password ? thanks chris
  9. i have this in access: SELECT INVENTORY.WHSE AS I_WHSE, INVENTORY.CODE AS I_PART_NO, INVENTORY.INV_DESCRIPTION AS I_DESCRIPTION, ck_brand.MASK AS b, ck_deal.MASK AS d FROM INVENTORY inner JOIN ck_brand ON (INVENTORY.WHSE=ck_brand.I_WHSE) AND (INVENTORY.CODE=ck_brand.I_PART_NO) inner JOIN ck_deal ON (INVENTORY.WHSE=ck_deal.I_WHSE) AND (INVENTORY.CODE=ck_deal.I_PART_NO); i get this error : syntax error (missing operator) in query expression if i go : SELECT INVENTORY.WHSE AS I_WHSE, INVENTORY.CODE AS I_PART_NO, INVENTORY.INV_DESCRIPTION AS I_DESCRIPTION, ck_brand.MASK AS b FROM INVENTORY inner JOIN ck_brand ON (INVENTORY.WHSE=ck_brand.I_WHSE) AND (INVENTORY.CODE=ck_brand.I_PART_NO); everything is ok. problem is i need it to pull from 2 inner join tables (ck_brand AND ck_deal) !
×
×
  • 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.