LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-08-2005, 02:51 PM   #1
@ngelot
Member
 
Registered: Oct 2004
Posts: 84

Rep: Reputation: 15
Include ssi in a form?


I would like to include a ssi-file in a form so that I only need to build one file and then copy it x times...

Something like:
Code:
<input type="text" name="T1" size="20"><!--#include virtual="T1.txt"-->
or
Code:
<textarea name="T1" cols="20" rows="1"><!--#include virtual="T1.txt"--></textarea>
If this is a part of my index-file I can copy the file to sevral directories where T1.txt contains different information....

Ex. /my-site/index.html include /my-site/T1.txt and /more/index.html includes /more/T1.txt while the index-file are actually the same - just copied to different directories...

How can I write the input/textarea-tag to include the info in the txt-file?

The reason to do this is to avoid making sevral index-files, but also to give the user the opportunity to change the input/textarea info and mail it to me with the form/post command...

Thanks!
 
Old 05-09-2005, 12:57 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Just as you've done it.

If you want the text to be the value of the input field then:
<input type="text" name="T1" size="20" value="<!--#include virtual="T1.txt"-->">
 
Old 05-11-2005, 03:42 AM   #3
@ngelot
Member
 
Registered: Oct 2004
Posts: 84

Original Poster
Rep: Reputation: 15
Yepp!

My fault - I forgot a minute that this is a SERVER side command...

No wonder it wouldn't work in FrontPage....

Thanks!

You would not know how to get a single file printet out?

Something like:
Code:
<!--#include file="file.txt#line2" -->
so that only line 2 in file.txt is included on my page?

@ngelot
 
Old 05-11-2005, 03:42 AM   #4
@ngelot
Member
 
Registered: Oct 2004
Posts: 84

Original Poster
Rep: Reputation: 15
...a single LINE in a file....
 
Old 05-11-2005, 07:39 AM   #5
@ngelot
Member
 
Registered: Oct 2004
Posts: 84

Original Poster
Rep: Reputation: 15
Got help from another guy:
Code:
<!--#exec cmd="grep name text.txt | sed 's/name\ //g'" -->
This prints the line beginning with "name" in text.txt without printing "name" in the beginning of the output...

Works fine :-D

@ngelot
 
  


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
CGI works from SSI exec, but not from include. SkipHuffman Linux - Software 2 08-25-2005 10:15 PM
SSI works from #exec, but not from #include. SkipHuffman Linux - General 4 08-25-2005 07:16 AM
SSI include line from text-file? @ngelot Programming 4 05-11-2005 06:43 AM
shell script works form command line but not form crontab saifee General 1 10-14-2004 10:27 AM
how do I copy a whoel folder form one directory to another form the command line? zwyrbla Linux - Newbie 8 08-24-2004 06:40 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:33 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
Open Source Consulting | Domain Registration