Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Apr 2009 14:58:01 -0600
From:      Modulok <modulok@gmail.com>
To:        Charles Howse <chowse@charter.net>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: /usr/bin/calendar in cgi script
Message-ID:  <64c038660904121358r4f2e7282nc2bc09af7b94a7f9@mail.gmail.com>
In-Reply-To: <845EB734-909E-4B97-9ABD-8ABBADFA291B@charter.net>
References:  <251E39DC-2EEE-4E43-9B4C-3F273B19AD09@charter.net> <18912.60033.242203.912434@jerusalem.litteratus.org> <845EB734-909E-4B97-9ABD-8ABBADFA291B@charter.net>

next in thread | previous in thread | raw e-mail | index | archive | help
I don't know what program you're using for your CGI stuff, but
basically all that is needed is the '<pre></pre>' tags. Here is an
example which uses PHP to call the system 'calendar' command:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<title>Modulore Training Media</title>
<body>
<p>
Hello world. Calling UNIX calendar program via PHP:
<p>
<pre>
<?php
system("calendar -f calendar.history");
?>
</pre>
</body>
</html>

On 4/11/09, Charles Howse <chowse@charter.net> wrote:
>
> On Apr 11, 2009, at 2:07 PM, Robert Huff wrote:
>
>>
>> Charles Howse writes:
>>
>>> Now, when I run that script in a terminal, the output is perfectly
>>> formatted, multiple lines (if there are multiple events on this
>>> date),
>>> date first, event, year.  Just right.
>>>
>>> But, when I put that in an "include" statement in a webpage, the
>>> output is a single line, regardless of whether there are multiple
>>> events.
>>> You can see a bad example here:
>>>
>>> <http://bubbabbq.homeunix.net/history_cgi.shtml>;
>>>
>>> How can I make multiple events show on separate lines, like it
>>> does in terminal?
>>
>> 	Would I be correct in believing you're unfamiliar with html?
>
> You would most certainly NOT BE CORRECT.  I've had my own server
> running Apache for years.
>
> I don't think this is something that can be solved with html tags, but
> I will try Brad's suggestions.
> Read man calendar about how it uses cpp, and how the calendar.* files
> are formatted.
> If I recall, I used this same technique years ago and had a simple,
> elegant way of solving it using some default tool like col, though
> that doesn't seem to work now.
>
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?64c038660904121358r4f2e7282nc2bc09af7b94a7f9>