» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > PHP Programming and Tips

PHP Programming and Tips Discuss about PHP programming and Share Tips. Ask questions about Scripting and Errors.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-03-2006, 05:40 PM
pifer pifer is offline
Junior Member
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
pifer is on a distinguished road
Default pattern matching problem

Hello

Correct this code please

Here's the code ::
//----------------------------------------------------------
$temps = array('.com','.biz','.info','.net','.org','.us', '.name','.in','.co','.in','.tv','.cc','http');
$name = "site .com";
foreach ($temps as $index => $nilai){
if (ereg($nilai,$name,$regs)){
$err = "no url please in name";
}
}if ($err!=""){die("you can't insert url in name field");}
//----------------------------------------------------------
why when I change the value of $name into "site com", the result is same(.com is still find in variable name)? I want only the ".com" that should be forbidden and show that message. Please help me, I need it urgent.

Thanks a lot -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-03-2006, 05:42 PM
bachel bachel is offline
Junior Member
 
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
bachel is on a distinguished road
Default

In regular expression, the dot character mean "any character" if you want to refer to the dot character itself, you need to escape it using \ -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem ! please help! shahbaz419 Domain Names Forum 0 02-17-2007 05:48 AM
problem with stored procedures?? Vanis MySQL Forums 1 10-23-2006 05:48 AM
Backspace key problem in MSN chat only! rozntom General Talk 1 09-04-2006 05:54 AM
Export to CSV problem Export to CSV problem walsh MySQL Forums 1 08-29-2006 03:20 PM
mailing list problem jolly PHP Programming and Tips 1 08-12-2006 11:36 AM


All times are GMT. The time now is 11:12 PM.