Jump to content
php.lv forumi

Kur problēma?


kalabox

Recommended Posts

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??

Link to comment
Share on other sites

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 by briedis
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...