473,321 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Help with syntax - if domain name exists

I am pretty new to php. Can anyone tell me what the proper syntax is
for checking a particular domain from a web form? For instance, I am
looking for an if statement that accomplishes this:

if ($domain=*.mydomain.com)

For some reason, can't get the proper syntax so that sciprt will take.
Thoughts?

Oct 1 '06 #1
3 1283
C.

af**********@gmail.com wrote:
I am pretty new to php. Can anyone tell me what the proper syntax is
for checking a particular domain from a web form? For instance, I am
looking for an if statement that accomplishes this:

if ($domain=*.mydomain.com)

For some reason, can't get the proper syntax so that sciprt will take.
try:

if (fnmatch("*,mydomain.com", $domain)) {

C.

Oct 1 '06 #2
C. wrote:
af**********@gmail.com wrote:
>I am pretty new to php. Can anyone tell me what the proper syntax is
for checking a particular domain from a web form? For instance, I am
looking for an if statement that accomplishes this:

if ($domain=*.mydomain.com)

For some reason, can't get the proper syntax so that sciprt will take.

try:

if (fnmatch("*,mydomain.com", $domain)) {

C.
That should read

if (fnmatch("*.mydomain.com", $domain)) {
Note that php.net says:

"For now this function is not available on Windows or other non-POSIX
compliant systems."

so if you're on such a system, you may need a more general solution:

if (preg_match('/\.mydomain.com$/', $domain)) {

which will match any string ending ".mydomain.com".

Colin

Oct 1 '06 #3
Colin Fine wrote:
if (fnmatch("*.mydomain.com", $domain)) {
That worked. 5 star rating for your post!

Thanks again!

Oct 2 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John | last post by:
What is the best function to check if a domain name exists. I had read somewhere that checkdnsrr() can do the job, but unfortunately it is not giving correct result all the time. For example it...
23
by: Carter Smith | last post by:
http://www.icarusindie.com/Literature/ebooks/ Rather than advocating wasting money on expensive books for beginners, here's my collection of ebooks that have been made freely available on-line...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
33
by: Todd | last post by:
OK, I created a .htm page within a new Web solution: -------------------------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head>...
2
by: Scott M. Lyon | last post by:
I'm having some strange problems with a VB.NET application that I support. The application currently uses SystemInformation.UserName() and SystemInformation.UserDomainName() to determine who is...
1
by: Sandesh | last post by:
Hello All, Me saying " has any body come across such error would be underestimating". Well I am getting a very peculiar and unique error "Line 1: Incorrect syntax near 'Actions'." ...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
4
by: Brad Isaacs | last post by:
I am working with ASP.NET 2.0 and using an SQL Server 2000 database. I am using Visual Studio 2005 and developing on my Local machine. I am working with Login controls ASP.Configuration, I...
7
by: Ray Dillinger | last post by:
Hi. I'm having a problem and I really want to understand it. Here's the situation: I have an array of pointers, and each pointer is the head of a linked list of structs. The structs are...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.