webserver plugin for beginners

If you have a question or need help, this is the place to be.
Post Reply
Drabert
Posts: 19
Joined: Wed Feb 18, 2009 8:30 am

webserver plugin for beginners

Post by Drabert » Tue Apr 28, 2009 4:27 am

can someone please help me out with an example of the webserver plugin? I tried one that is on the net someplace but the buttons only work the first time they are clicked. If i delete my internet history they work again, but i need to get them to work everytime i click the button (obviously). Can someone help me out with the code to thier webpage so i can make it work for my system?

I really appreciate it!

User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: webserver plugin for beginners

Post by jinxdone » Tue Apr 28, 2009 6:50 am

The webserver works so that if you get a page with HTTP GET parameters, for example: "http://localhost:80/?something" it will generate an event HTTP.something that you can use just like any other event in EG.

You can tailor your Webserver main page to have buttons, forms, text fields or anything really that will make a query to the webserver using HTTP GET, but it's not mandatory.

Drabert
Posts: 19
Joined: Wed Feb 18, 2009 8:30 am

Re: webserver plugin for beginners

Post by Drabert » Tue Apr 28, 2009 7:17 am

i tried using this line of code and it does work, but it only works one time... i dont know how to make it work every time the link is clicked

Code: Select all

 <td width="30"><a href="eventghost1.html?Example-Device_ON"><img border="0" src="lamp-on.png"></a></td>
the name of the webpage is eventghost1.html so when you click on the button it passes "Example-Device_ON" but it only works one time.

i am ok at programming in C but i really suck at html so an example would really help.

Thanks for the guidance... i will start looking at how to write pages that use "get"

User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: webserver plugin for beginners

Post by jinxdone » Tue Apr 28, 2009 7:22 am

The issue with that normal a href link is caused by your browser since it won't follow that link more than once as you already are on that page.

You could put a form on your page? Some examples:

Code: Select all

<form method="get">
<input type="hidden" name="something" value="else"></input>
<input type="submit" value="Submit"></input>
</form>
<form method="get">
<input type="text" name="another"></input>
<input type="submit" value="Submit"></input>
</form>
<form method="get">
<input type="checkbox" name="box" value="checked">
<input type="submit" value="Submit"></input>
</form>
Another option is to put some fancy javascript on the page that will make the query.

I'd recommend w3schools.com for learning html though.

Drabert
Posts: 19
Joined: Wed Feb 18, 2009 8:30 am

Re: webserver plugin for beginners

Post by Drabert » Tue Apr 28, 2009 7:31 am

I just copy and pasted your code in my page and it works wonderfully... im not sure if that is a word, but it should be... I will start working through the w3 school to help get my html skills up to snuff.

Thanks again for the first step... i appreciate it!

Eric Drabert

holyspidoo
Posts: 14
Joined: Wed Apr 08, 2009 5:18 pm

Re: webserver plugin for beginners

Post by holyspidoo » Fri May 01, 2009 11:13 pm

Is there some example code to GET something from eventghost and display it on the webpage (example, current song that is playing in an app)?

dan Edens
Experienced User
Posts: 110
Joined: Mon Sep 24, 2018 7:57 pm

Re: webserver plugin for beginners

Post by dan Edens » Mon Sep 23, 2019 5:21 pm

holyspidoo wrote:
Fri May 01, 2009 11:13 pm
Is there some example code to GET something from eventghost and display it on the webpage (example, current song that is playing in an app)?
question bump^

Post Reply