torrentz Posted June 28, 2008 Report Share Posted June 28, 2008 Ir vēlme uztaisiit savas lapas smukākas ar mod_rewrite palīdzību. mod_rewrite kods: RewriteRule ^wapsite-statistics/([^/]*)/([^/]*)\.html$ /x5.php?act=$1&uid=$2 [L] PHP kods: <?php echo "blablabla"; if (empty($_GET['uid'])) exit; $uid=(int)$_GET['uid']; //tālāk notiek viss pārējais, ja ir dabūts tas uid... ?> un šeit PHP kods saka, ka $_GET['uid'] ir tukšs, lai gan tā nevajadzētu būt un skripts nobeidzas.... brauzerī rakstu kaut kā tā: wapsite-statistics/camera/5.html Link to comment Share on other sites More sharing options...
marcis Posted June 28, 2008 Report Share Posted June 28, 2008 RewriteRule ^wapsite-statistics/(.*)/(.*)\.html$ x5.php?act=$1&uid=$2 [L] Ja jāatļauj tikai cipari pie uid, liec attiecīgi ([0-9]+) Link to comment Share on other sites More sharing options...
torrentz Posted June 28, 2008 Author Report Share Posted June 28, 2008 (edited) Laikam problēma ir cittur. maz ko zinu par mod_rewrite, bet izmantoju http://www.mod-rewrite-wizard.com/ tagadējais rewrite kods: RewriteRule ^wapsite-statistics/([^/]*)/([0-9]+)\.html$ /x5.php?act=$1&uid=$2 [L] print_r($_GET); izvada itkā visu pareizi: Array ( [act] => camera [uid] => 5 ) skatīšos vai cittur skriptā kaut kas nav apslēpts... EDIT: Sorry, viss strādā pareizi- es nebiju izvēlējies pareizu UID. Vienigā ķēpa, ka tagad brauzeris uzskata, ka css stils atrodas wapsite-statistics/camera mapē, lai gan tāda neeksistē. Edited June 28, 2008 by torrentz Link to comment Share on other sites More sharing options...
marcis Posted June 28, 2008 Report Share Posted June 28, 2008 Iemācies pareizi inklūdot css failus un nebūs problēmu. Man tas parasti nak no /images/style.css Link to comment Share on other sites More sharing options...
Recommended Posts