forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


HTTP - Webserver

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Jun 26, 2002 5:04 pm    Post subject: HTTP - Webserver Reply with quote

Hello,

I've made a HTTP - server with the use of Tommy's vdsinet.dll

Here is the source:

Code:

external vdsinet.dll,Public Freeware Key|90257236
NET SOCKET,PORT,80
NET SOCKET,SERVER
NET SOCKET,VDSEVENTS

  DIALOG CREATE,New Dialog,-1,0,568,160
  DIALOG ADD,EDIT,EDIT1,16,25,,,EDIT1
  DIALOG ADD,EDIT,EDIT2,45,40,,,@path(%0)
  DIALOG ADD,EDIT,EDIT3,83,42,,,EDIT3
  DIALOG ADD,BUTTON,BUTTON1,118,38,64,24,BUTTON1
  DIALOG ADD,LIST,LIST1,8,248,296,144
  DIALOG SHOW


:evloop
%%event = @event()
if @equal(%%event,)
goto next-evloop
else
goto %%event
end

:next-evloop
%%socketdata = @net(socket,data)
%%socketevent = @net(socket,event)
%%socketsenderid = @net(socket,senderid)
if @not(@null(%%socketdata))
  list add,list1,%%socketdata - %%socketsenderid
  option fieldsep,@chr(32)
  parse "%%var1;%%var2;%%var3;%%var4;%%var5",%%socketdata
    %%command = @substr(%%socketdata,1,3)
     if @equal(%%command,GET)
       goto sendhtmlfile
      end
  end
if @not(@null(%%socketevent))
  list add,list1,%%socketevent - %%socketsenderid
  end
goto evloop

:sendhtmlfile
%%htmlfile = %%var2
%%htmlfile = @substr(%%htmlfile,2,@len(%%htmlfile))
option fieldsep,@chr(63)
parse "%%htmlfile;%%parameters",%%htmlfile
list create,1
list loadfile,1,@dlgtext(edit2)%%htmlfile
net socket,sendid,%%socketsenderid,@text(1)
net socket,closecid,%%socketsenderid
list close,1
goto evloop

:button1button
net socket,sendall,@dlgtext(edit1)
list add,list1,@dlgtext(edit1)
goto evloop

:Close
exit


If you have some suggestions, please post a repley
Back to top
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Wed Jun 26, 2002 7:43 pm    Post subject: Reply with quote

Hi skit3000,
Your code is very interesting but how do you make it work? What goes in the Edit boxes and what is the button for?
Question Question Question

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Jun 27, 2002 5:26 pm    Post subject: Reply with quote

If you wanna know what's the use of the editboxes, just check the source... Very Happy

Oh well, I'll just say it:

EDIT1 - Text or code to send to the client (with the use of BUTTON1)
EDIT2 - Path to the html file(s)
EDIT3 - Nothing

I always add some edit boxes to my scripts, for checking things out, like error-code's and events and stuff....

Hope I helped you...

Sjoerd
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group