jovato
asked on
Help needed with hidden fields and current date
I am trying to use a hidden field in a form, but I am trying to get it to automaticly generate the date. I am using the following line:
<FORM METHOD="POST" ACTION="/cgi-bin/tester.pl ">
<b><font face="Verdana" size="2">KBID</font></b>:< /P>
<BLOCKQUOTE>
<P>
<INPUT TYPE="hidden" NAME="kbid" value="%Y%m%d">
I have used value= 'date + "%y%m%d"'> as well but nothing works. I use the above in a cgi in the follwoing manner:
<b><font face="Verdana" size="2">KBID</font></b>: </P>$param{kbid}</font></P >
But it just prints either date + --or-- %y%m%d.... Can I use year month day in a hidden field? Please let me know how I can get the above done.
Thanks!
<FORM METHOD="POST" ACTION="/cgi-bin/tester.pl
<b><font face="Verdana" size="2">KBID</font></b>:<
<BLOCKQUOTE>
<P>
<INPUT TYPE="hidden" NAME="kbid" value="%Y%m%d">
I have used value= 'date + "%y%m%d"'> as well but nothing works. I use the above in a cgi in the follwoing manner:
<b><font face="Verdana" size="2">KBID</font></b>: </P>$param{kbid}</font></P
But it just prints either date + --or-- %y%m%d.... Can I use year month day in a hidden field? Please let me know how I can get the above done.
Thanks!
BassTeQ.
$year=$year+1900 if ($year >= 100);
No need for the if test.
$year+=1900;
will *always* be accurate for any dates >= 1900
Also no need to set a whole bunch of variables that aren't used in:
($sec,$min,$hour,$mday,$mo n,$year,$w day,$yday, $isdst) = localtime;
better to do:
($mday,$mon,$year) = (localtime)[3,4,5];
And a neater way of doing the whole lot is:
use POSIX;
$date = strftime("%Y/%m/%d",localt ime);
jovato.
In order to get the form to put in the date, you will need to use javascript, unless you are automatically generating the form with a language such as Perl.
$year=$year+1900 if ($year >= 100);
No need for the if test.
$year+=1900;
will *always* be accurate for any dates >= 1900
Also no need to set a whole bunch of variables that aren't used in:
($sec,$min,$hour,$mday,$mo
better to do:
($mday,$mon,$year) = (localtime)[3,4,5];
And a neater way of doing the whole lot is:
use POSIX;
$date = strftime("%Y/%m/%d",localt
jovato.
In order to get the form to put in the date, you will need to use javascript, unless you are automatically generating the form with a language such as Perl.
A few good points there tintin, thats just the standard code I use for all my date/time functions, thats why I declare everything, never know when you're going to need it :)
Cheers
Cheers
$param{kbid}= '<INPUT TYPE="hidden" NAME="kbid" value="'
. `date +"%Y%m%d"` . '">';
. `date +"%Y%m%d"` . '">';
You can change your .html to .shtml to utilize the "server side includes" and use the following code.
<!--#config timefmt="%Y%m%d" -->
<INPUT TYPE="hidden" NAME="kbid"
value='<!--#echo var="DATE_LOCAL" -->'>
<!--#config timefmt="%Y%m%d" -->
<INPUT TYPE="hidden" NAME="kbid"
value='<!--#echo var="DATE_LOCAL" -->'>
ASKER
I have tried the above comments and none work. Let me add a little more:
I am bouncing this form off of a perl script. This is for a knowledgebase. All I am tring to do is automaticly make a knowledgebase number for the html document that the perl script kicks out. For example: A user enters all of the relevent data into the fields and hits submit. At that time the script takes the current date and the script uses it to create a name for the page. So when a user hits submit, the parameter kbid should be like 022320030845.html. (month day year hour minute). I just need a way to configure this either on the form itself (as a hidden field) or within the script.
I am bouncing this form off of a perl script. This is for a knowledgebase. All I am tring to do is automaticly make a knowledgebase number for the html document that the perl script kicks out. For example: A user enters all of the relevent data into the fields and hits submit. At that time the script takes the current date and the script uses it to create a name for the page. So when a user hits submit, the parameter kbid should be like 022320030845.html. (month day year hour minute). I just need a way to configure this either on the form itself (as a hidden field) or within the script.
> At that time the script takes the current date
does this mean that the time should be created at client side?
If so, you need JavaScript(or any anyother active scripting language).
Are you aware that such a solution might create multiple identical timestamps?
does this mean that the time should be created at client side?
If so, you need JavaScript(or any anyother active scripting language).
Are you aware that such a solution might create multiple identical timestamps?
ASKER
Good point. I would rather see the time be server side. Seems like it would be easier as well.
ASKER
Here is the perl script:
sh-2.05$ more tester.pl
#!/usr/bin/perl
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $q = new CGI;
print $q->header;
my %param = $q->Vars;
my $template = <<"EOF";
<html>
<head>
<title>cpconfig.com KB: $param{issue}</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#FF0000" vlink="#FF0000" alink="#FF
0000">
<center>
<table width="600" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="600" height="550" valign="top">
<div align="center">
<p><b><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#999999"><br>
</font><font face="Fixedsys" size="6" color="#000000">cpconfig</ font></b>< /p>
</div>
<div align="center">
<b><font face="Fixedsys" size="2">KnowledgeBase</fo nt></b></d iv>
<blockquote>
<div align="center">
<hr>
<font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#999999"> |
<a href="#">cpconfig forum</a> | <a href="#">Home</a>
| <a href="#">Documentation</a> |
<a href="#">FAQ</a> | <a href="#">Links</a> | <a href="#">KB Help</a> |</font><div align="left">
<hr>
<p>
<b><font face="Verdana" size="2">KBID</font></b>: </P>$param{kbid}</font></P >
<font face="Verdana" size="2"><b>Issue:</b></fo nt>
<p><font face="Verdana" size="2">$param{issue}</fo nt></P>
<p><font face="Verdana" size="2"><b>Version:</b></ font></P>
<p><font face="Verdana" size="2">$param{version}</ font></P>
<font face="Verdana" size="2"><b>Platform:</b>< /font>
<p><font face="Verdana" size="2">$param{platform}< /font></P>
<p><font face="Verdana" size="2"><b>Abstract:</b>< /font></P>
<p><font face="Verdana" size="2">$param{abstract}< /font></P>
<font face="Verdana" size="2"><b>Solution:</b>< /font>
<p><font face="Verdana" size="2">$param{solution}< /font></P>
<p><font face="Verdana" size="2"><b>Links/Sources: </b></font ></P>
<p><font face="Verdana" size="2">$param{links}</fo nt></P>
<font face="Verdana" size="2"><b>Submitted By:</b></font>
<p><font face="Verdana" size="2">$param{submitted} </font></P >
<p> </p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" color="#999999" size="1"><i>
DISCLAIMER: The
following information is believed to be accurate. If you find
anything wrong with any of the documentation, please e-mail us at
<a href="mailto:docs\@cpconfi g.com?subj ect=Knowle dgeBase problems">kb\@cpconfig.com </a> and let us know. We take n
o responsibility for
the accuracy or completeness of the documentation here. As always,
please test everything in a lab environment and not in production.</i></font></p>
<p> </p>
</div>
</div>
</blockquote>
</td>
</tr>
</table></center>
</body>
</html>
EOF
open (FILE, ">/usr/local/apache/htdocs /knowledge base/$para m{kbid}.ht ml") or die "Can not open $param{kbid}.html $!\n";
print FILE $template;
close (FILE);
print "<h1>Created File</h1>";
exit;
sh-2.05$
sh-2.05$ more tester.pl
#!/usr/bin/perl
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $q = new CGI;
print $q->header;
my %param = $q->Vars;
my $template = <<"EOF";
<html>
<head>
<title>cpconfig.com KB: $param{issue}</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#FF0000" vlink="#FF0000" alink="#FF
0000">
<center>
<table width="600" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="600" height="550" valign="top">
<div align="center">
<p><b><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#999999"><br>
</font><font face="Fixedsys" size="6" color="#000000">cpconfig</
</div>
<div align="center">
<b><font face="Fixedsys" size="2">KnowledgeBase</fo
<blockquote>
<div align="center">
<hr>
<font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#999999"> |
<a href="#">cpconfig forum</a> | <a href="#">Home</a>
| <a href="#">Documentation</a>
<a href="#">FAQ</a> | <a href="#">Links</a> | <a href="#">KB Help</a> |</font><div align="left">
<hr>
<p>
<b><font face="Verdana" size="2">KBID</font></b>: </P>$param{kbid}</font></P
<font face="Verdana" size="2"><b>Issue:</b></fo
<p><font face="Verdana" size="2">$param{issue}</fo
<p><font face="Verdana" size="2"><b>Version:</b></
<p><font face="Verdana" size="2">$param{version}</
<font face="Verdana" size="2"><b>Platform:</b><
<p><font face="Verdana" size="2">$param{platform}<
<p><font face="Verdana" size="2"><b>Abstract:</b><
<p><font face="Verdana" size="2">$param{abstract}<
<font face="Verdana" size="2"><b>Solution:</b><
<p><font face="Verdana" size="2">$param{solution}<
<p><font face="Verdana" size="2"><b>Links/Sources:
<p><font face="Verdana" size="2">$param{links}</fo
<font face="Verdana" size="2"><b>Submitted By:</b></font>
<p><font face="Verdana" size="2">$param{submitted}
<p> </p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" color="#999999" size="1"><i>
DISCLAIMER: The
following information is believed to be accurate. If you find
anything wrong with any of the documentation, please e-mail us at
<a href="mailto:docs\@cpconfi
o responsibility for
the accuracy or completeness of the documentation here. As always,
please test everything in a lab environment and not in production.</i></font></p>
<p> </p>
</div>
</div>
</blockquote>
</td>
</tr>
</table></center>
</body>
</html>
EOF
open (FILE, ">/usr/local/apache/htdocs
print FILE $template;
close (FILE);
print "<h1>Created File</h1>";
exit;
sh-2.05$
ASKER
And here is the form:
sh-2.05$ more blank_kb.htm
<html>
<head>
<title>Template</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--#config timefmt="%Y%m%d" -->
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#FF0000" vlink="#FF0000" alink="#FF
0000">
<center>
<table width="600" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="600" height="550" valign="top">
<div align="center">
<p><b><font face="Verdana, Arial, Helvetica, sans-serif" size="4" colo
r="#999999"><br>
</font><font face="Fixedsys" size="6" color="#000000">cpconfig</ font><
/b></p>
</div>
<div align="center">
<b><font face="Fixedsys" size="2">KnowledgeBase</fo nt></b></d iv>
<blockquote>
<div align="center">
<hr>
<font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#999999"> |
<a href="/forums/index.php">c pconfig forum</a> | <a href="/">Home</a>
| <a href="/kbhelp.htm">Documen tation</a> |
<a href="/faq.htm">FAQ</a> | <a href="/links.htm">Links</a > | <a href="#">KB Help</a> |</font><div align="left">
<hr>
<P>
<FORM METHOD="POST" ACTION="/cgi-bin/tester.pl ">
<b><font face="Verdana" size="2">KBID</font></b>:< /P>
<BLOCKQUOTE>
<P>
<INPUT TYPE="hidden" NAME="kbid" value='<!--#echo var="DATE_LOCAL" -->'>
<BR>
</P>
</BLOCKQUOTE>
<P>
<b><font face="Verdana" size="2">Issue</font></b>: </P>
<BLOCKQUOTE>
<P>
<TEXTAREA NAME="issue" ROWS=5 COLS=43></TEXTAREA>
<BR>
</P>
</BLOCKQUOTE>
<P>
<font face="Verdana" size="2"><b>Version</b></f ont>:</P>
<BLOCKQUOTE>
<P>
<INPUT TYPE=TEXT NAME="version" SIZE=51>
<BR>
</P>
</BLOCKQUOTE>
<P>
<b><font face="Verdana" size="2">Platform:</font>< /b></P>
<BLOCKQUOTE>
<P>
<INPUT TYPE=TEXT NAME="platform" SIZE=51>
<BR>
</P>
</BLOCKQUOTE>
<P>
<b><font face="Verdana" size="2">Abstract:</font>< /b></P>
<BLOCKQUOTE>
<P>
<TEXTAREA NAME="abstract" ROWS=5 COLS=44></TEXTAREA>
<BR>
</P>
</BLOCKQUOTE>
<P>
<b><font size="2" face="Verdana">Solution:</ font></b>< /P>
<BLOCKQUOTE>
<P>
<TEXTAREA NAME="solution" ROWS=5 COLS=44></TEXTAREA>
<BR>
</P>
</BLOCKQUOTE>
<P>
<b><font size="2" face="Verdana">Links/Sourc es:</font> </b></P>
<BLOCKQUOTE>
<P>
<TEXTAREA NAME="links" ROWS=5 COLS=44></TEXTAREA>
<BR>
</P>
</BLOCKQUOTE>
<P>
<b><font size="2" face="Verdana">Submitted By:</font></b></P>
<BLOCKQUOTE>
<P>
<INPUT TYPE=TEXT NAME="submitted" SIZE=53>
<BR>
</P>
</BLOCKQUOTE>
<p>
<INPUT TYPE=SUBMIT VALUE="Submit Form">
<INPUT TYPE=RESET VALUE="Reset Form"> </p>
</FORM>
<p> </p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" color="#999999" size="1"><i>
DISCLAIMER: The
following information is believed to be accurate. If you find
anything wrong with any of the documentation, please e-mail us at
<a href="mailto:docs@cpconfig .com?subje ct=Knowled geBase problems">kb@cpconfig.com< /a> and let us know. We take n
o responsibility for
the accuracy or completeness of the documentation here. As always,
please test everything in a lab environment and not in production.</i></font></p>
<p> </p>
</div>
</div>
</blockquote>
</td>
</tr>
</table></center>
</body>
</html>
sh-2.05$ more blank_kb.htm
<html>
<head>
<title>Template</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--#config timefmt="%Y%m%d" -->
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#FF0000" vlink="#FF0000" alink="#FF
0000">
<center>
<table width="600" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="600" height="550" valign="top">
<div align="center">
<p><b><font face="Verdana, Arial, Helvetica, sans-serif" size="4" colo
r="#999999"><br>
</font><font face="Fixedsys" size="6" color="#000000">cpconfig</
/b></p>
</div>
<div align="center">
<b><font face="Fixedsys" size="2">KnowledgeBase</fo
<blockquote>
<div align="center">
<hr>
<font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#999999"> |
<a href="/forums/index.php">c
| <a href="/kbhelp.htm">Documen
<a href="/faq.htm">FAQ</a> | <a href="/links.htm">Links</a
<hr>
<P>
<FORM METHOD="POST" ACTION="/cgi-bin/tester.pl
<b><font face="Verdana" size="2">KBID</font></b>:<
<BLOCKQUOTE>
<P>
<INPUT TYPE="hidden" NAME="kbid" value='<!--#echo var="DATE_LOCAL" -->'>
<BR>
</P>
</BLOCKQUOTE>
<P>
<b><font face="Verdana" size="2">Issue</font></b>:
<BLOCKQUOTE>
<P>
<TEXTAREA NAME="issue" ROWS=5 COLS=43></TEXTAREA>
<BR>
</P>
</BLOCKQUOTE>
<P>
<font face="Verdana" size="2"><b>Version</b></f
<BLOCKQUOTE>
<P>
<INPUT TYPE=TEXT NAME="version" SIZE=51>
<BR>
</P>
</BLOCKQUOTE>
<P>
<b><font face="Verdana" size="2">Platform:</font><
<BLOCKQUOTE>
<P>
<INPUT TYPE=TEXT NAME="platform" SIZE=51>
<BR>
</P>
</BLOCKQUOTE>
<P>
<b><font face="Verdana" size="2">Abstract:</font><
<BLOCKQUOTE>
<P>
<TEXTAREA NAME="abstract" ROWS=5 COLS=44></TEXTAREA>
<BR>
</P>
</BLOCKQUOTE>
<P>
<b><font size="2" face="Verdana">Solution:</
<BLOCKQUOTE>
<P>
<TEXTAREA NAME="solution" ROWS=5 COLS=44></TEXTAREA>
<BR>
</P>
</BLOCKQUOTE>
<P>
<b><font size="2" face="Verdana">Links/Sourc
<BLOCKQUOTE>
<P>
<TEXTAREA NAME="links" ROWS=5 COLS=44></TEXTAREA>
<BR>
</P>
</BLOCKQUOTE>
<P>
<b><font size="2" face="Verdana">Submitted By:</font></b></P>
<BLOCKQUOTE>
<P>
<INPUT TYPE=TEXT NAME="submitted" SIZE=53>
<BR>
</P>
</BLOCKQUOTE>
<p>
<INPUT TYPE=SUBMIT VALUE="Submit Form">
<INPUT TYPE=RESET VALUE="Reset Form"> </p>
</FORM>
<p> </p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" color="#999999" size="1"><i>
DISCLAIMER: The
following information is believed to be accurate. If you find
anything wrong with any of the documentation, please e-mail us at
<a href="mailto:docs@cpconfig
o responsibility for
the accuracy or completeness of the documentation here. As always,
please test everything in a lab environment and not in production.</i></font></p>
<p> </p>
</div>
</div>
</blockquote>
</td>
</tr>
</table></center>
</body>
</html>
Change your perl script to be.
You can chage the date stuff with the suggestions Tintin made if you wish.
#!/usr/bin/perl
use CGI;
use CGI::Carp qw(fatalsToBrowser);
#date stuff
($sec,$min,$hour,$mday,$mo n,$year,$w day,$yday, $isdst) = localtime;
$mon=$mon+1;
$year=$year+1900 if ($year >= 100);
$currdate="$mon"."$mday"." $year"."$h our"."$min ";
my $q = new CGI;
print $q->header;
my %param = $q->Vars;
my $template = <<"EOF";
<html>
<head>
<title>cpconfig.com KB: $param{issue}</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#FF0000" vlink="#FF0000" alink="#FF
0000">
<center>
<table width="600" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="600" height="550" valign="top">
<div align="center">
<p><b><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#999999"><br>
</font><font face="Fixedsys" size="6" color="#000000">cpconfig</ font></b>< /p>
</div>
<div align="center">
<b><font face="Fixedsys" size="2">KnowledgeBase</fo nt></b></d iv>
<blockquote>
<div align="center">
<hr>
<font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#999999"> |
<a href="#">cpconfig forum</a> | <a href="#">Home</a>
| <a href="#">Documentation</a> |
<a href="#">FAQ</a> | <a href="#">Links</a> | <a href="#">KB Help</a> |</font><div align="left">
<hr>
<p>
<b><font face="Verdana" size="2">KBID</font></b>: </P>$param{kbid}</font></P >
<font face="Verdana" size="2"><b>Issue:</b></fo nt>
<p><font face="Verdana" size="2">$param{issue}</fo nt></P>
<p><font face="Verdana" size="2"><b>Version:</b></ font></P>
<p><font face="Verdana" size="2">$param{version}</ font></P>
<font face="Verdana" size="2"><b>Platform:</b>< /font>
<p><font face="Verdana" size="2">$param{platform}< /font></P>
<p><font face="Verdana" size="2"><b>Abstract:</b>< /font></P>
<p><font face="Verdana" size="2">$param{abstract}< /font></P>
<font face="Verdana" size="2"><b>Solution:</b>< /font>
<p><font face="Verdana" size="2">$param{solution}< /font></P>
<p><font face="Verdana" size="2"><b>Links/Sources: </b></font ></P>
<p><font face="Verdana" size="2">$param{links}</fo nt></P>
<font face="Verdana" size="2"><b>Submitted By:</b></font>
<p><font face="Verdana" size="2">$param{submitted} </font></P >
<p> </p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" color="#999999" size="1"><i>
DISCLAIMER: The
following information is believed to be accurate. If you find
anything wrong with any of the documentation, please e-mail us at
<a href="mailto:docs\@cpconfi g.com?subj ect=Knowle dgeBase problems">kb\@cpconfig.com </a> and let us know. We take n
o responsibility for
the accuracy or completeness of the documentation here. As always,
please test everything in a lab environment and not in production.</i></font></p>
<p> </p>
</div>
</div>
</blockquote>
</td>
</tr>
</table></center>
</body>
</html>
EOF
open (FILE, ">/usr/local/apache/htdocs /knowledge base/$curr date.html" ) or die "Can not open $currdate.html $!\n";
print FILE $template;
close (FILE);
print "<h1>Created File</h1>";
exit;
You can chage the date stuff with the suggestions Tintin made if you wish.
#!/usr/bin/perl
use CGI;
use CGI::Carp qw(fatalsToBrowser);
#date stuff
($sec,$min,$hour,$mday,$mo
$mon=$mon+1;
$year=$year+1900 if ($year >= 100);
$currdate="$mon"."$mday"."
my $q = new CGI;
print $q->header;
my %param = $q->Vars;
my $template = <<"EOF";
<html>
<head>
<title>cpconfig.com KB: $param{issue}</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#FF0000" vlink="#FF0000" alink="#FF
0000">
<center>
<table width="600" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="600" height="550" valign="top">
<div align="center">
<p><b><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#999999"><br>
</font><font face="Fixedsys" size="6" color="#000000">cpconfig</
</div>
<div align="center">
<b><font face="Fixedsys" size="2">KnowledgeBase</fo
<blockquote>
<div align="center">
<hr>
<font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#999999"> |
<a href="#">cpconfig forum</a> | <a href="#">Home</a>
| <a href="#">Documentation</a>
<a href="#">FAQ</a> | <a href="#">Links</a> | <a href="#">KB Help</a> |</font><div align="left">
<hr>
<p>
<b><font face="Verdana" size="2">KBID</font></b>: </P>$param{kbid}</font></P
<font face="Verdana" size="2"><b>Issue:</b></fo
<p><font face="Verdana" size="2">$param{issue}</fo
<p><font face="Verdana" size="2"><b>Version:</b></
<p><font face="Verdana" size="2">$param{version}</
<font face="Verdana" size="2"><b>Platform:</b><
<p><font face="Verdana" size="2">$param{platform}<
<p><font face="Verdana" size="2"><b>Abstract:</b><
<p><font face="Verdana" size="2">$param{abstract}<
<font face="Verdana" size="2"><b>Solution:</b><
<p><font face="Verdana" size="2">$param{solution}<
<p><font face="Verdana" size="2"><b>Links/Sources:
<p><font face="Verdana" size="2">$param{links}</fo
<font face="Verdana" size="2"><b>Submitted By:</b></font>
<p><font face="Verdana" size="2">$param{submitted}
<p> </p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" color="#999999" size="1"><i>
DISCLAIMER: The
following information is believed to be accurate. If you find
anything wrong with any of the documentation, please e-mail us at
<a href="mailto:docs\@cpconfi
o responsibility for
the accuracy or completeness of the documentation here. As always,
please test everything in a lab environment and not in production.</i></font></p>
<p> </p>
</div>
</div>
</blockquote>
</td>
</tr>
</table></center>
</body>
</html>
EOF
open (FILE, ">/usr/local/apache/htdocs
print FILE $template;
close (FILE);
print "<h1>Created File</h1>";
exit;
ASKER
BassTeQ,
I made the changes above, but the files are being saved as $currdate.html. The script modifiactions are exactly as you specified. Can you think of any reason this wouldn't work?
I made the changes above, but the files are being saved as $currdate.html. The script modifiactions are exactly as you specified. Can you think of any reason this wouldn't work?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That was the ticket.
#date stuff
($sec,$min,$hour,$mday,$mo
$mon=$mon+1;
$year=$year+1900 if ($year >= 100);
$currdate="$mday/$mon/$yea
Then change this line
<INPUT TYPE="hidden" NAME="kbid" value="%Y%m%d">
to this
<INPUT TYPE="hidden" NAME="kbid" value="$currdate">
You can change the $currdate variable to display the date format you require.
eg
$currdate="$mday-$mon-$yea
$currdate="$mday"."$mon"."
etc ...
Hope this helps!