neo Posted May 7, 2004 Report Share Posted May 7, 2004 Kaa var saiisinaat URL lapai no piemeeram: www.example.lv/?id=3&catid=6&kautkas=&rrr=................... uz vienkaarshi www.example.lv Vai to var izdariit ar php paliidziibu vai kaut kaadaa citaa veidaa? Link to comment Share on other sites More sharing options...
sviesc Posted May 7, 2004 Report Share Posted May 7, 2004 var, bet jēga visu infu glabāt sesijās vai kūkas nau nekāda :D Link to comment Share on other sites More sharing options...
bubu Posted May 7, 2004 Report Share Posted May 7, 2004 2 sviesc: prichom te kautkaadas sessijas vai kookiji? cilveeks grib vienkaarshi servera nosaukumu dabuut. 2 neo: panjem vienkaarshi izgreiz tekstu liidz pirmajam / tikai ieveero, ka saakumaa var buut arii http:// vai ftp:// Link to comment Share on other sites More sharing options...
rnc Posted May 7, 2004 Report Share Posted May 7, 2004 <?php $adrese = "http://jeehaaaa.lalala.com.bum.rum/?ir=nav&buus=nebus"; $adrese = explode ("/",$adrese); $real = $adrese[2]; echo $real; ?> Bet nu ar šī skripta palīdzību tiek izgriezta ši daļa: jeehaaaa.lalala.com.bum.rum Link to comment Share on other sites More sharing options...
Gacha Posted May 7, 2004 Report Share Posted May 7, 2004 Nu un te bus ar parbaudi ftp, http, www : $data = "http://lapa.lv/index.php?bla=89"; $id = substr("$data", 0,3); $x = explode("/", $data); if ($id == 'htt' || $id == 'ftp'){ $url = $x[2]; }else{ $url = $x[0]; } echo $url; Link to comment Share on other sites More sharing options...
bubu Posted May 7, 2004 Report Share Posted May 7, 2004 Nu un te bus ar parbaudi ftp, http, www : $data = "http://lapa.lv/index.php?bla=89"; $id = substr("$data", 0,3); $x = explode("/", $data); if ($id == 'htt' || $id == 'ftp'){ $url = $x[2]; }else{ $url = $x[0]; } echo $url; nav labi taa, jo eksistee citi ne tikai http un ftp protokoli! vislabaak to jau dariit buutu ar regexpu, bet nu ja shie rezultaati apmierina tad jau viss ok Link to comment Share on other sites More sharing options...
Gacha Posted May 7, 2004 Report Share Posted May 7, 2004 (edited) Nu es pats zinu http, https(nezinu ko shis dara, bet sakars ar ssl) un ftp. kadi vel ir? Ps. Man tas regex galigi nepatik - tur tie simboli vairak neka vajag Edited May 7, 2004 by Gacha Link to comment Share on other sites More sharing options...
rnc Posted May 7, 2004 Report Share Posted May 7, 2004 (edited) <?php $pre = array ( 'http:', 'ftp:', 'https:' ); $adrese = "https://www.bumba.downloaads.jeah.lv/shit"; $ad = explode ("/",$adrese); if (in_array($ad[0],$pre)) $real = $ad[2]; else $real = $ad[0]; echo $real; ?> Masīvā var ievadīt vajadzīgo "prefixus". Ievērojiet, ka aiz tā ir jāliek divpunkte, tb aiz katra "prefixa" :-) Edited May 7, 2004 by rnc Link to comment Share on other sites More sharing options...
Gacha Posted May 7, 2004 Report Share Posted May 7, 2004 Nu no mana scripta man šķiet nebija nekāda atšķirība, jo izmantoju tikai pirmos 3 simbolus ftp htt (http, https - shiem ir vienadi). Bet tavs man patik labak, jo tur man ir shis tas jauns B) Link to comment Share on other sites More sharing options...
rnc Posted May 8, 2004 Report Share Posted May 8, 2004 Mans kods no tava atšķirās tikai ar to, ka ir ļoti viegli papildināms ar jauniem prefixiem (btw, kā viņus pareizi sauc? prefixi? nez no kurienes man viņus gribas saukt par prefixiem ;-)) Link to comment Share on other sites More sharing options...
Aleksejs Posted May 8, 2004 Report Share Posted May 8, 2004 Nu prefikss, nozīmē priedēklis - tātad zināmā mērā varētu viņu tā saukt. Link to comment Share on other sites More sharing options...
bubu Posted May 8, 2004 Report Share Posted May 8, 2004 (edited) protokols tas ir tb protokols kaa semantiskaa noziimee bet priedeeklis tas ir kaa stringa sastaavdalja, tb sintaktiskaa nozimee (vismaz taa es domaaju :) Edited May 8, 2004 by bubu Link to comment Share on other sites More sharing options...
rnc Posted May 8, 2004 Report Share Posted May 8, 2004 Okej, sauksim par priedēkli :-) Link to comment Share on other sites More sharing options...
Robis Posted May 8, 2004 Report Share Posted May 8, 2004 Vai tik to visu nevar panaakt ieliekot lapu freimaa un visur kur staigaasi pa lapu augshaa tik raadiisies tavs www.example.lv, bet reaalie urli buus visaadi, vienk. vinji neraadiisies address baaraa! Nu, taa nevar??? Link to comment Share on other sites More sharing options...
Gacha Posted May 8, 2004 Report Share Posted May 8, 2004 Man liekas tas butu tizli un tas nestradatu, jo referis jau tev shakata bus tads kads tas ir nevis visu laiku www.lapa.lv, bet gan ar visiem ?id=shit&no=bla utt ;) Un topica autors manliekas gribeja iegut to www.lapa.lv , kaa $mainigo, lai pectam apstradatu. Link to comment Share on other sites More sharing options...
Recommended Posts