Devils666 Posted March 21, 2010 Report Share Posted March 21, 2010 kā es varētu pārbaudīt, vai ierakstītais links ir pareizs? (man datubaze atevisks ieraksts) tas būtu jādara ar preg_match? es visādi mēģinaju, bet nezinu kā varētu linku pārbaudīt Quote Link to comment Share on other sites More sharing options...
waplet Posted March 21, 2010 Report Share Posted March 21, 2010 ar kādu linku tev vajag salīdzināt? Quote Link to comment Share on other sites More sharing options...
Devils666 Posted March 21, 2010 Author Report Share Posted March 21, 2010 (edited) nu, man vienkāŗsi vaig pārbādit, vai lietotāja ievadītais links ir pareizs peimēram: ja - tad ok http://www.draugiem.lv bet ja - sita draugiem.lv tad nav ok Edited March 21, 2010 by Devils666 Quote Link to comment Share on other sites More sharing options...
waplet Posted March 21, 2010 Report Share Posted March 21, 2010 preg_match("http://",$_POST['links'],$m); Quote Link to comment Share on other sites More sharing options...
Devils666 Posted March 21, 2010 Author Report Share Posted March 21, 2010 (edited) hmm, tā jau labāk, nevar vel kaut kā pievienot, tā lai beigās pārbauda vai ir, piem, .lv,.com,.net utt Edited March 21, 2010 by Devils666 Quote Link to comment Share on other sites More sharing options...
anonīms Posted March 21, 2010 Report Share Posted March 21, 2010 aha, un ee, lt, co.uk, fi, se, dk, Quote Link to comment Share on other sites More sharing options...
Devils666 Posted March 21, 2010 Author Report Share Posted March 21, 2010 ēpastam izmatoju šādu: preg_match("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $masiivs) bet kā tml varētu uztaisīt linku pārbaudīšanai? Quote Link to comment Share on other sites More sharing options...
briedis Posted March 21, 2010 Report Share Posted March 21, 2010 ēpastam izmatoju šādu: preg_match("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $masiivs) bet kā tml varētu uztaisīt linku pārbaudīšanai? varbūt pameklē gūglē? Quote Link to comment Share on other sites More sharing options...
Kaklz Posted March 21, 2010 Report Share Posted March 21, 2010 Vari skatīties uz http://lv.php.net/parse_url. Tur gan ir piezīme, ka tā funkcija nav paredzēta url validācijai, tomēr ar to varētu būt gana vienkārši pārbaudīt nepieciešamo komponentu eksistenci vai iztrūkumu. Tāpat var skatīties uz http://lv.php.net/filter_var, kurai ir FILTER_VALIDATE_URL parametrs: http://lv.php.net/manual/en/filter.filters.php Quote Link to comment Share on other sites More sharing options...
Devils666 Posted March 21, 2010 Author Report Share Posted March 21, 2010 varbūt pameklē gūglē? varbūt gūglē es skatos no paša sakuma? pirms prasu un, hmm, jāpaskatās kā ar to parse_url īsti ir Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.