LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-04-2011, 02:16 AM   #1
athrin
Member
 
Registered: Mar 2011
Posts: 135

Rep: Reputation: 1
asking for input in linux


regards,

i want in the website they ask to enter some input.
Code:
echo -e "<p>Please Enter Year : \c</p> "
read  Year
if i use this command it will ask the user to enter year in command. but what i want is they ask the user to enter year in web browser.

thanks
 
Old 04-04-2011, 02:38 AM   #2
Harju
LQ Newbie
 
Registered: Sep 2008
Location: Gothenburg, Sweden
Posts: 25

Rep: Reputation: 1
I assume you have the page coded in HTML. You should look at the usage of <input>. It will create a small textbox that you can use. I can also recommend that you make a dropdown curtain menu where the used can select year. Instead of typing whatever they want, you can't ever imagine what people might put in that box.
 
Old 04-04-2011, 02:54 AM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2 on Lenovo Thinkpad W520
Posts: 7,100

Rep: Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244
Hi Athrin

I have read your other posts.

You should first get some basic understanding of the communication mechanisms between a user and a website.

For that you can read books and/or find this kind of information on the Internet. Try 'http', "web server', 'html' as search strings in a search engine or in Wikipedia for instance.
 
Old 04-04-2011, 02:54 AM   #4
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Harju View Post
I assume you have the page coded in HTML. You should look at the usage of <input>. It will create a small textbox that you can use. I can also recommend that you make a dropdown curtain menu where the used can select year. Instead of typing whatever they want, you can't ever imagine what people might put in that box.
you mean like this?
[code]
<form>
echo -e "<p>Please Enter Year : \c<input type="text" name="Year" /></p> "
read Year
</form>
[code]
 
Old 04-04-2011, 02:57 AM   #5
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2 on Lenovo Thinkpad W520
Posts: 7,100

Rep: Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244
No. You cant mix html code with bash code, because the Apache server do not include a bash interpreter, thus it won't know what to do with the 'echo' command.
 
Old 04-04-2011, 02:59 AM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2 on Lenovo Thinkpad W520
Posts: 7,100

Rep: Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244
But as someone already told you in another thread you could use PHP instead.
 
Old 04-04-2011, 03:06 AM   #7
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Didier Spaier View Post
But as someone already told you in another thread you could use PHP instead.
give me an example
i already know basic html

Last edited by athrin; 04-04-2011 at 03:11 AM.
 
Old 04-04-2011, 03:10 AM   #8
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
Quote:
Originally Posted by athrin View Post
give me an example
please...



this is a code for the input box

Code:
<input type="text" name="thebox" value="Your Name">
here is also a tutorial for creating forms with inputboxes, pls READ it first !!
LINK YOU NEED TO READ FIRST

Last edited by brownie_cookie; 04-04-2011 at 03:11 AM.
 
Old 04-04-2011, 03:13 AM   #9
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2 on Lenovo Thinkpad W520
Posts: 7,100

Rep: Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244
http://www.tizag.com/phpT/examples/formex.php

Just you use your favorite search engine you'll find plenty of other examples and tutorials.
 
Old 04-04-2011, 03:24 AM   #10
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Didier Spaier View Post
http://www.tizag.com/phpT/examples/formex.php

Just you use your favorite search engine you'll find plenty of other examples and tutorials.
= =!
how to put this code into linux?
 
Old 04-04-2011, 03:29 AM   #11
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
like

Code:
if [ var1 != var2 ]; then
code
fi
if that's what you mean
 
Old 04-04-2011, 03:31 AM   #12
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2 on Lenovo Thinkpad W520
Posts: 7,100

Rep: Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244
This code should be put on a webpage read by Apache. See an Apache tutorial for that.
 
Old 04-04-2011, 03:33 AM   #13
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
i want this command

Code:
echo -e "Please Enter Year : \c"
read  Year

echo -e "Enter Location"\ " : \c"
read Locat
to be able to display in webpage.. if basic php or html i already know..
what i want is. when i type the addrs it suddenly ask for year and location. after entered the year and location. it will display the output.

Last edited by athrin; 04-04-2011 at 03:36 AM.
 
Old 04-04-2011, 03:38 AM   #14
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2 on Lenovo Thinkpad W520
Posts: 7,100

Rep: Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244Reputation: 2244
How many times should we repeat that THIS IS NOT POSSIBLE because THE WEB SERVER DO NOT INCLUDE A BASH INTERPRETER?

'echo' and 'read' are bash commands.

Last edited by Didier Spaier; 04-04-2011 at 03:39 AM.
 
Old 04-04-2011, 03:40 AM   #15
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
you can do this IF you make a webpage in HTML or PHP, but maybe you can open that webpage with a script?
i'm not sure, but it's maybe a suggestion....?!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HAL vs Xserver (/dev/input/mice?): convincing X to *not* use a given input device? stuartnlevy Linux - Desktop 6 01-24-2012 05:06 PM
Repeated "input: AT Translated Set 2 keyboard as /class/input/input" messages AcerKev Mandriva 2 09-16-2007 09:35 AM
HELP connecting MIC Input/Line Input with Jack and Qsynth animehair Linux - Software 0 07-28-2006 08:47 AM
Ctrl+Shift Unicode input gone, after installing Japanese Input Methodes polemon Linux - Newbie 1 09-20-2005 06:17 PM
Sendmail: timeout waiting for input from local during Draining Input andrewstr Linux - Software 0 07-14-2004 02:43 PM


All times are GMT -5. The time now is 01:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration