kent. Guest
|
Posted: Mon Jan 13, 2003 8:06 am Post subject: having a hard time tonight |
|
|
Im trying to piece together another section to my ftp script but seem to be having problems, if you think you can help me out please try to...
but only if you know what your talking about,
I am trying to add checkboxes that will allow a user to pick a specific template that will automaticly add the templates html coding into a text area for them to edit to adjust to the feel of their website, the only issues is when I wrote the code it didnt work see what Im talking about You may know the fix, th problem is that the 'Onclick' portion of the code doesnt pop into the text area it just overlaps onto the pre-written html inside my .cgi file
I know this is a programming issue and not a webserver issue, but I really need the help I appreciate it greatly.
Code: | # Begin Edit Text File Procedure:
#
my ($directory, $filename, $working_dir, $url) = @_;
my ($lines, $fullfile, $full_url);
# Check to make sure a file name was entered.
(!$filename) and return "Edit File: No filename was entered!";
# Build full file name and full url.
($directory =~ m,/$,) ? ($fullfile = "$directory$filename") : ($fullfile = "$directory/$filename");
$full_url = "$url/$filename";
# Either load the contents from a file..
if (&exists($fullfile)) {
open (DATA, "<$fullfile") or &cgierr ("Can't open '$fullfile'\nReason: $!");
$lines = join ("", <DATA>);
$lines =~ s/<\/TEXTAREA/<\/TEXT-AREA/ig;
close DATA;
print qq!<p>Modify <a href="$full_url"><B>$filename</B></A> as needed:</p>!;
}
else {
# Or use the following as a template.
$lines = qq~
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF">
</BODY>
</HTML>
~;
print "<p>This is a new file. Input your HTML below:</p>";
}
# Print out the editing and saving options.
print qq~
<p><blockquote>
After editing, select "Save Document" to save <B>$filename</B> and return to
the main menu.
</blockquote></p><br><br>Choose a template below to edit for your page<br><br>
[color=red]<form method=post action="$config{'script_url'}"><input type="checkbox" onClick="form.data.value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Template by Eugene Pal Eugenepal@hotmail.com</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2800.1126" name=GENERATOR>
<STYLE>A {
TEXT-DECORATION: underline
}
A:link {
COLOR: 000000
}
A:active {
COLOR: 000000
}
A:visited {
COLOR: 000000
}
A:hover {
COLOR: CF9204; TEXT-DECORATION: underline
}
</STYLE>
<SCRIPT language=JavaScript1.2>
var bookmarkurl="http://yourdomain.com "
var bookmarktitle="yourdomain.com"
function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
</SCRIPT>
</HEAD>
<BODY text=#000000 vLink=#ff0000 link=#0000ff bgColor=#ffffff>
<DIV
style="LEFT: 0px; WIDTH: 800px; POSITION: absolute; TOP: 0px; HEIGHT: 773px">
<DIV
style="LEFT: 434px; WIDTH: 344px; POSITION: absolute; TOP: 116px; HEIGHT: 7px">
<TABLE height=7 cellSpacing=0 cellPadding=0 width=344 border=0>
<TBODY>
<TR vAlign=top>
<TD><IMG height=7 src="op2/lines2.gif" width=330
border=0></TD></TR></TBODY></TABLE></DIV>
<DIV
style="LEFT: 532px; WIDTH: 251px; POSITION: absolute; TOP: 127px; HEIGHT: 233px">
<TABLE height=233 cellSpacing=0 cellPadding=0 width=251 border=0>
<TBODY>
<TR vAlign=top>
<TD><IMG height=233 src="op2/box.gif" width=241
border=0></TD></TR></TBODY></TABLE></DIV>
<DIV
style="LEFT: 109px; WIDTH: 7px; POSITION: absolute; TOP: 64px; HEIGHT: 344px">
<TABLE height=344 cellSpacing=0 cellPadding=0 width=7 border=0>
<TBODY>
<TR vAlign=top>
<TD><IMG height=344 src="op2/lines1.gif" width=7
border=0></TD></TR></TBODY></TABLE></DIV>
<DIV
style="LEFT: 109px; WIDTH: 7px; POSITION: absolute; TOP: 411px; HEIGHT: 344px">
<TABLE height=344 cellSpacing=0 cellPadding=0 width=7 border=0>
<TBODY>
<TR vAlign=top>
<TD><IMG height=344 src="op2/lines1.gif" width=7
border=0></TD></TR></TBODY></TABLE></DIV>
<DIV
style="LEFT: 0px; WIDTH: 344px; POSITION: absolute; TOP: 754px; HEIGHT: 7px">
<TABLE height=7 cellSpacing=0 cellPadding=0 width=344 border=0>
<TBODY>
<TR vAlign=top>
<TD><IMG height=7 src="op2/lines2.gif" width=344
border=0></TD></TR></TBODY></TABLE><a href="mailto:eugenepal@hotmail.com">Templates by Eugene</a></DIV>
<DIV
style="LEFT: 314px; WIDTH: 344px; POSITION: absolute; TOP: 754px; HEIGHT: 7px">
<TABLE height=7 cellSpacing=0 cellPadding=0 width=344 border=0>
<TBODY>
<TR vAlign=top>
<TD><IMG height=7 src="op2/lines2.gif" width=344
border=0></TD></TR></TBODY></TABLE></DIV>
<DIV
style="LEFT: 0px; WIDTH: 773px; POSITION: absolute; TOP: 0px; HEIGHT: 70px">
<TABLE height=70 cellSpacing=0 cellPadding=0 width=773 border=0>
<TBODY>
<TR vAlign=top>
<TD><IMG height=70 src="op2/tophead.gif" width=773
border=0></TD></TR></TBODY></TABLE></DIV>
<DIV
style="LEFT: 434px; WIDTH: 344px; POSITION: absolute; TOP: 754px; HEIGHT: 7px">
<TABLE height=7 cellSpacing=0 cellPadding=0 width=344 border=0>
<TBODY>
<TR vAlign=top>
<TD><IMG height=7 src="op2/lines2.gif" width=344
border=0></TD></TR></TBODY></TABLE></DIV>
<DIV
style="LEFT: 27px; WIDTH: 61px; POSITION: absolute; TOP: 90px; HEIGHT: 22px">
<TABLE height=22 cellSpacing=0 cellPadding=0 width=61 border=0>
<TBODY>
<TR vAlign=top>
<TD><U><SPAN style="FONT-SIZE: 14px">Site
links</SPAN></U></TD></TR></TBODY></TABLE></DIV>
<DIV
style="LEFT: 11px; WIDTH: 99px; POSITION: absolute; TOP: 126px; HEIGHT: 121px">
<TABLE height=121 cellSpacing=0 cellPadding=0 width=99 border=0>
<TBODY>
<TR vAlign=top>
<TD><A href="http://none/"><SPAN style="FONT-SIZE: 14px">Company
info</SPAN></A><SPAN style="FONT-SIZE: 14px"><BR><BR></SPAN><A
href="http://none/"><SPAN style="FONT-SIZE: 14px">Contact
us</SPAN></A><SPAN style="FONT-SIZE: 14px"><BR><BR></SPAN><A
href="http://none/"><SPAN style="FONT-SIZE: 14px">Products</SPAN></A><SPAN
style="FONT-SIZE: 14px"><BR><BR></SPAN><A href="http://none/"><SPAN
style="FONT-SIZE: 14px">Portfolio</SPAN></A><BR><br></SPAN><a href="javascript:addbookmark()"><SPAN
style="FONT-SIZE: 14px">Bookmark us</SPAN></A></TD></TR></TBODY></TABLE></DIV>
<DIV
style="LEFT: 544px; WIDTH: 240px; POSITION: absolute; TOP: 135px; HEIGHT: 22px">
<TABLE height=22 cellSpacing=0 cellPadding=0 width=240 border=0>
<TBODY>
<TR vAlign=top>
<TD><SPAN style="FONT-SIZE: 14px">News box
title</SPAN></TD></TR></TBODY></TABLE></DIV>
<DIV
style="LEFT: 543px; WIDTH: 226px; POSITION: absolute; TOP: 163px; HEIGHT: 64px">
<TABLE height=64 cellSpacing=0 cellPadding=0 width=226 border=0>
<TBODY>
<TR vAlign=top>
<TD><SPAN style="FONT-SIZE: 14px">This box is an optional area for you to
place local news events or national news events that concern the area of
business you specialize in.</SPAN></TD></TR></TBODY></TABLE></DIV>
<DIV
style="LEFT: 129px; WIDTH: 240px; POSITION: absolute; TOP: 82px; HEIGHT: 29px">
<TABLE height=29 cellSpacing=0 cellPadding=0 width=240 border=0>
<TBODY>
<TR vAlign=top>
<TD><B><U><FONT face=Arial size=+2><SPAN
style="FONT-SIZE: 24px">Description</SPAN></FONT></B></U></TD></TR></TBODY></TABLE></DIV>
<DIV
style="LEFT: 117px; WIDTH: 344px; POSITION: absolute; TOP: 116px; HEIGHT: 7px">
<TABLE height=7 cellSpacing=0 cellPadding=0 width=344 border=0>
<TBODY>
<TR vAlign=top>
<TD><IMG height=7 src="op2/lines2.gif" width=330
border=0></TD></TR></TBODY></TABLE></DIV>
<DIV
style="LEFT: 129px; WIDTH: 396px; POSITION: absolute; TOP: 138px; HEIGHT: 64px">
<TABLE height=64 cellSpacing=0 cellPadding=0 width=396 border=0>
<TBODY>
<TR vAlign=top>
<TD><SPAN style="FONT-SIZE: 14px">Describe what it is that you do what you
are able to offer to your site visitors and maybe a paragraph on why the
visitor should choose your services. Keep adding text to accomidate your
website.<br><Br><a href="op2brown.zip">Download this template</a></SPAN></TD></TR></TBODY></TABLE></DIV>
<DIV
style="LEFT: 530px; WIDTH: 253px; POSITION: absolute; TOP: 78px; HEIGHT: 18px">
<TABLE height=18 cellSpacing=0 cellPadding=0 width=253 border=0>
<TBODY>
<TR vAlign=top>
<TD><A href="http://none/"><SPAN style="FONT-SIZE: 14px">Optional
links</SPAN></A><SPAN style="FONT-SIZE: 14px"> </SPAN><A
href="http://none/"><SPAN style="FONT-SIZE: 14px">Optional
links</SPAN></A><SPAN style="FONT-SIZE: 14px"> </SPAN><A
href="http://none/"><SPAN style="FONT-SIZE: 14px">Optional
links</SPAN></A></TD></TR></TBODY></TABLE></DIV></DIV>
</BODY></HTML>
<!-THIS LINE MUST STAY HERE FOR AUTHOR CREDITS-!>
<!-THIS TEMPLATE WAS CREATED BY EUGENE PAL EUGENEPAL@HOTMAIL.COM-!>';">
<br>
<textarea name="data" rows=40 cols=60 wrap=virtual>$lines</textarea>[/color]
<p>Alternate Filename:
<input type=text name="fn" value="$filename"><br>
(entering an alternate filename will leave <B>$filename</B>
untouched and will place the text above into a file with the
alternate name. Note that if a file already exists with the alternate
filename, you will overwrite it completely.)<P>
<input type=hidden name="action" value="write">
<input type=hidden name="wd" value="$working_dir">
<input type=submit value="Save Document">
</form>
</p>
~;
}
| [/quote] |
|