Home  >  Support  >  Support Forum  >  How to use a cgi function ?
Notice! We've recently migrated to using a new forum, we hope you enjoy it. If you are an existing member and this is your first time visiting our new forum, please reset your password to be able to sign in.
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

How to use a cgi function ?

0 votes
Hi,

I'm a french student on programming school and I'm training at the moment in a small company where I'm programming on Dynamic C language (Dynamic C Dist 9.62 version). I'm a begginer in this language.

I must create a HTTP server with a rabbit 3365.

Currently, I succed to read Dynamic C variables in HTML document with #web in dynamic C code and <?z echo($my_var)?> in html code.

I would like to trigger a Dynamic C function from the web page. Therefore I read pdf documentation about tcp/ip in rabbit but I don't found what I search.

I tried cgi function like this:
- in dynamic C code I created a cgi function with HttpState* as an input and I included it in SSPEC_RESOURCETABLE_START .
- in HTML code succed to trigger this function from a link like this: <A HREF="/function1.cgi">text</a>.

This works, I can trigger the cgi function (just printf() at the moment) from this link but the web browser redirect me on "x.x.x.x/cgiFunctionName" (normal for a link). Therefore I can't do any other action after the cgi function triggering.

I would like to have a solution to trigger the same cgi function but from a button (or a link) without redirection.
If there is an other solution (without cgi), I also take it !


Thank you in advance for people who help me !
asked Jun 26, 2013 in Rabbit by edvin New to the Community (1 point)
retagged Jun 27, 2013 by edvin

Please log in or register to answer this question.

2 Answers

0 votes
Hello Edvin,

Under Dynamic C 9.62, there are some examples related to web server at the below path
C:\DCRABBIT_9.62\Samples\tcpip\rabbitweb

Go through those apps. It may help you.

And also check below document
http://ftp1.digi.com/support/documentation/019-0144_G.pdf
answered Jun 27, 2013 by cpigilam Veteran of the Digi Community (496 points)
0 votes
Thank you cpigilam,

It's works with cgi_redirectto(state,REDIRECTTO) =)
answered Jun 28, 2013 by edvin New to the Community (1 point)
Contact a Digi expert and get started today! CONTACT US
...