|
|
|
|
![]() ![]() |
Feb 28 2006, 01:30 PM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 407 Joined: 13-December 04 Member No.: 2,696 |
From the environment variables, i get the domain of the referring site using SERVER_NAME. The includes www. and i have to remove that. I dont believe there is a variable in the environment that contains only the domain.
So I would need to replace each character in the char* string by "" until i hit a '.' then replace the dot with "" and get the remaining string. Here is the catch. I can't include big headers because i need the file to stay really small around 20-30kb. So ideally, would need to use functions in stdlib.h stdio.h or string.h to get this done. Thanks in advance |
|
|
|
Mar 2 2006, 10:44 AM
Post
#2
|
|
|
Newbie [Level 3] ![]() ![]() ![]() Group: Members Posts: 40 Joined: 29-January 06 Member No.: 17,841 |
Here is an easy solution for your problem.
CODE {servenv++;}while((*servenv)!='.'); //increment char* till next character to '.' //use servenv here. it points to next character of the first '.' |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 7th October 2008 - 03:32 PM |