LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 01: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, 01:38 AM   #2
Harju
LQ Newbie
 
Registered: Sep 2008
Location: Gothenburg, Sweden
Posts: 26

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, 01:54 AM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,063

Rep: Reputation: Disabled
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, 01: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, 01:57 AM   #5
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,063

Rep: Reputation: Disabled
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, 01:59 AM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,063

Rep: Reputation: Disabled
But as someone already told you in another thread you could use PHP instead.
 
Old 04-04-2011, 02: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 02:11 AM.
 
Old 04-04-2011, 02: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 02:11 AM.
 
Old 04-04-2011, 02:13 AM   #9
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,063

Rep: Reputation: Disabled
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, 02: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, 02: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, 02:31 AM   #12
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,063

Rep: Reputation: Disabled
This code should be put on a webpage read by Apache. See an Apache tutorial for that.
 
Old 04-04-2011, 02: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 02:36 AM.
 
Old 04-04-2011, 02:38 AM   #14
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,063

Rep: Reputation: Disabled
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 02:39 AM.
 
Old 04-04-2011, 02: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



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 04:06 PM
Repeated "input: AT Translated Set 2 keyboard as /class/input/input" messages AcerKev Mandriva 2 09-16-2007 08:35 AM
HELP connecting MIC Input/Line Input with Jack and Qsynth animehair Linux - Software 0 07-28-2006 07:47 AM
Ctrl+Shift Unicode input gone, after installing Japanese Input Methodes polemon Linux - Newbie 1 09-20-2005 05:17 PM
Sendmail: timeout waiting for input from local during Draining Input andrewstr Linux - Software 0 07-14-2004 01:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:07 AM.

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
Open Source Consulting | Domain Registration