dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: How can I tell what was entered?

  1. #1
    Join Date
    May 2010
    Posts
    6

    Question How can I tell what was entered?

    Question....
    How can I get php to tell me if a user types in the www part in their browser of if they just type in the domain mydomain.com

    Examples: Users type in..

    www.mydomain.com/this_directory/this_file.php

    mydomain.com/this_directory/this_file.php

    http://www.mydomain.com/this_directory/this_file.php

    www.mydomain.com

    mydomain.com


    ]I don't care about the http:// I also don't care about the /this_directory/this_file.php

    I ONLY want to know if the user typed in either www OR mydomain.com OR www.mydomain.com How can I get php to tell me this?

    Please help, please?

    -Thanks!

  2. #2
    Join Date
    Jul 2012
    Posts
    1
    Use the superglobal; $_SERVER['SERVER_NAME']

    Do you know how to use strpos or preg_match to find one string in another string?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles