kalabox Posted February 18, 2011 Report Share Posted February 18, 2011 Sveiki, nesaprotu, kur ir problēma?? lūk ereg funkcija !ereg ("^http://www\..*", $_REQUEST["site_url"]) Un reku met kljudu aaraa Warning: ereg() [function.ereg]: REG_EMPTY in /home/iepazist/public_html/banner/insertcampaign.php on line 18 NOTE: Domain name must start with "http://www." and allowed extensions are: com, net, org, lv, ru, . Pie bannera es ievadu http://www.tratra.lv Nesaprotu?? Quote Link to comment Share on other sites More sharing options...
marrtins Posted February 18, 2011 Report Share Posted February 18, 2011 (edited) Drošivien vajag \/\/ Pēdējo .* var arī atmest. Un vispār, domēnam ne obligāti ir jāsākas ar www. Edited February 18, 2011 by marrtins Quote Link to comment Share on other sites More sharing options...
kalabox Posted February 18, 2011 Author Report Share Posted February 18, 2011 Nee, nekas nemainaas.. :( Hmm vesela 18 rinda if ( !ereg ("^http://www.", $_REQUEST["site_url"]) || !ereg ("\.(" . $rs["domains_allowed"] . ")" , $_REQUEST["site_url"] ) ) Quote Link to comment Share on other sites More sharing options...
briedis Posted February 18, 2011 Report Share Posted February 18, 2011 (edited) Pamēģini labāk lietot preg_match, ereg ir deprecated, ja nemaldos. Ja tu gribi validēt saiti, ieteiktu lietot jau iebūvētos rīkus: http://php.net/manual/en/function.filter-var.php var_dump(filter_var('example.com', FILTER_VALIDATE_URL)); Edited February 18, 2011 by briedis Quote Link to comment Share on other sites More sharing options...
kalabox Posted February 18, 2011 Author Report Share Posted February 18, 2011 Paldies Briedi ;) luuk pareizs kods if ( !preg_match ("^http://www\.^", $_REQUEST["site_url"]) || !preg_match ("/.(" . $rs["domains_allowed"] . ")/" , Quote Link to comment Share on other sites More sharing options...
briedis Posted February 18, 2011 Report Share Posted February 18, 2011 Ko tu centies panākt? Validēt saiti? ja tā, tad izmanto filter_var(). 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.