summaryrefslogtreecommitdiff
path: root/src/webserver/doc/API.txt
blob: 92f88c5e3980672bae944674c0ff6a28ee665851 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Here's the webserver API, so you can work on the webserver.

My personal goal is to make this interface simple, so that coding it
will be like coding in some scripting language...



char *get_param(char in_string[500], char swhat[500]);

This function simply returns various data from the query string.
	*Pass get_param NOTHING longer than 500 in length!

	What do I pass where in_string is?
		The query string.

	What do I pass where swhat is?
		One of two things...
		Either 0 for the path of the 'page'
		or you can pass it the param you wish to lookup. 






char *get_query(char *inquery);

This function simply returns a query string from the raw server request.
This is used once in main, I doubt you'll need it.





void web_send(int sockin, char *in_data);

Super easy way of sending data to a webpage!
Simply put in the socket name and then the data.

	Ex:
		web_send(socket, "I like cheese!\n");




char *html_header(char* title);
Easy way to print the eAthena header for the server.

	Ex:
		web_send(sockethere, html_header("About"));