Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing parameters from *HTML to linux system

Status
Not open for further replies.

mckarl

Programmer
May 5, 1999
147
GB
hello there, <br><br>I am wondering if anyone could help, i was wondering how parrameters would be passed from html to a linux system, would iot be with the FORM command in HTML, or something??<br><br>and how could i pass back the details from linux to html?<br><br>Thankyou in advance for any suggestions, or even the answer...&nbsp;&nbsp;Karl. <p> Karl<br><a href=mailto:mc_karl@yahoo.com>mc_karl@yahoo.com</a><br><a href= > </a><br> ~ ~ ~ ~<br>
K A R L<br>
~ ~ ~ ~
 
Dear Karl,<br><br>Are you working with the Apache Web server on Linux? If so you send the parameters to a server side script or process running on the Web server using the HTML &lt;form&gt; tag.<br><br>Well, actually... hehe um, this is how it works on all web servers on all platforms.<br><br>Hope this helps<br>-pete
 
Thank you for replying pete,<br>How would i use the form tag to do this? and how would i use linux to read the data passed? how would i be able to resend the data back to a webpage?<br><br>i hope to do something simple, along the lines that you enter your name in the browser, and it searches through a file in unix for that name, and prints out in the browser an answer of yes you do exist, or no, you dont exist.<br><br>Any syntactical or freeform posts on this subject would be most helpful, thank you in advance.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-- KARL<br><br> <p> Karl<br><a href=mailto:mc_karl@yahoo.com>mc_karl@yahoo.com</a><br><a href= > </a><br> ~ ~ ~ ~<br>
K A R L<br>
~ ~ ~ ~
 
Using form tag will allow you to send data to a web server on the Unix system.&nbsp;&nbsp;You'll have to write a cgi program to read the data,&nbsp;&nbsp;do the database lookup, and generate a web page with the results.&nbsp;&nbsp;None of this is automatic.&nbsp;&nbsp;You need to do the programming yourself.<br><br>Sending the data via a form is the easy part. <p>nick bulka<br><a href=mailto: > </a><br><a href= > </a><br>
 
Dear Karl,<br><br>Well to supply a complete answer to your question with code examples would take several chapters of a book.<br><br>An overview:<br>Web Browsers connect to Web Servers and request resources. This has nothing to do with 'Linux' per se. Linux merely provides an environment for the web server to run in. <br><br>Depending on which version of Linux you have installed you may already have a web server installed and ready to run. If you do it is most likely 'Apache'. <br><br>Apache provides a CGI interface (Common Gateway Interface) to server side applications for web development. You can also obtain scripting engines that are compatible with Apache as well, like Perl. I don't know any of those scripting languages.<br><br>Under Apache you could write a C program with the resulting file name of 'findfile'. Then your HTML form would point to the program as it's action property:<br><br>&lt;form action=&quot;<A HREF=" TARGET="_new"> method=&quot;post&quot;&gt;<br><br>Then inside your form you would have an input tag for the user to enter the file name:<br><br>&lt;input type=&quot;text&quot; name=&quot;filename&quot;&gt;<br><br>The browser will send the contents of the editbox as a named parameter 'filename' to the web server which will make the parameter available to the C program through the stdin pipe.<br><br>Your FindFile program must know how to retrieve the parameter from the stdin pipe. Then it could examine the disk for the 'filename'. Then it must know how to return appropriate HTTP headers and an HTML file to the browser through the stdout pipe.<br><br>If you use a scripting engine such as 'Perl' then you must know the same answers to: How do I get my parameter? How do I search the disk? How do I send back my response?<br><br>So really, you should go out and buy yourself a Web Developoment book. Go to Amazon.com and see what's available. Back in 1995 when I started doing web development there where several good books available.<br><br>Also there are many other web server options available to you, for instance, the Java Web Server runs on linux I believe.<br><br>Hope this helps<br>-pete<br>
 
Thankyou very much all of you, i guess i will go get me a book on all this :)<br><br>Not easy.... hhmmmm....<br><br>Thankyou all ... karl.<br> <p> Karl<br><a href=mailto:mc_karl@yahoo.com>mc_karl@yahoo.com</a><br><a href= > </a><br> ~ ~ ~ ~<br>
K A R L<br>
~ ~ ~ ~
 
Hang in there, Karl, it's not really that hard.&nbsp;&nbsp;Once you understand the basics,&nbsp;&nbsp;you'll be surprised how easy it gets.&nbsp;&nbsp;And you can always come here for help when you get stuck. :) <p>nick bulka<br><a href=mailto: > </a><br><a href= > </a><br>
 
hehee, thanks nick for the support, well, guess it's back to the book place... i'll be here soon asking away... 'why wont it work?!' moan moan moan, hehehe....<br><br>Oki, thanks again all ... HAVE FUN!<br><br>KaRl <p> Karl<br><a href=mailto:mc_karl@yahoo.com>mc_karl@yahoo.com</a><br><a href= > </a><br> ~ ~ ~ ~<br>
K A R L<br>
~ ~ ~ ~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top