PDA

View Full Version : Adding my logo


stevan
10-27-2002, 02:54 AM
WHat i would like to do is add my logo to the following script in place of the word return.

Thxs Steve
Beginner





#!/usr/bin/perl

###################################################################
# Variables - Change these to match your site.
###################################################################
$home = 'http://www.Cruisewarehouse.cc';
$title = 'Cruisewarehouse.cc Links';
$body = 'BGCOLOR=FFFFFF TEXT=000000 LINK=000000 VLINK=000000 ALINK=000000 topmargin=0 leftmargin=0';

###################################################################
# Do not touch these this part of the script.
###################################################################

if ($ENV{'REQUEST_METHOD'} eq 'GET') {
$buffer = $ENV{'QUERY_STRING'};
}
else {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
}



@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}

if ($FORM{'source'}) { $source = $FORM{'source'}; }
if ($FORM{'target'}) { $target = $FORM{'target'}; }

print "Content-type: text/html\n\n";
&ReadParse;

#####################################################################
# This is the frame part, be careful if you want to change anything.
#####################################################################

if ($in{'action'} eq '') {
$in{'action'} = "main";
} # End if

if ($in{'action'} eq 'main') {

print "<HTML><HEAD><TITLE>$title - Visiting a link</TITLE></HEAD>\n";
print "<FRAMESET rows=\"65,*\" marginwidth=0 marginheight=0 framespacing=0 frameborder=no border=0>\n";
print "<FRAME marginwidth=0 marginheight=0 src=\"$home/cgi-bin/main.cgi?action=top&source=$source&target=$target\" scrollbars=no scrolling=no framespacing=0 frameborder=no border=0>\n";
print "<FRAME marginwidth=0 marginheight=0 src=\"http://$target\" framespacing=0 frameborder=no border=0>\n";
print "</FRAMESET>\n";
print "<NOFRAMES>\n";
print "<h1 align=center>Ops!</h1>\n";
print "This document is designed to be viewed using
Frame features. If you are seeing this message, please consider
upgrading to a frames-compatible browser.";
print "</NOFRAMES></HTML>\n";
}

#####################################################################
# This is the top part, be careful if you want to change anything.
#####################################################################

elsif ($in{'action'} eq 'top') {

print "<HTML><HEAD><TITLE>$title - Visiting a link</TITLE></HEAD>\n";
print "<body $body>\n";
print "<br>\n";
print "<center><a href=\"$home/$source\" target=\"_top\"><font size=2 face=\"Arial, Helvetica, sans-serif\">Back</font></a>\n";
print " || <a href=\"http://$target\" target=\"_top\"><font size=2 face=\"Arial, Helvetica, sans-serif\">Remove This Frame</font></a>\n";
print "</center>\n";
print "</body></html>\n";
}

###############################################
# READPARSE FUNCTION DO NOT TOUCH
###############################################
sub ReadParse { local (*in) = @_ if @_;
local ($i, $key, $val); if ( $ENV{'REQUEST_METHOD'} eq "GET" )
{
$in = $ENV{'QUERY_STRING'};
}
elsif ($ENV{'REQUEST_METHOD'} eq "POST")
{
read(STDIN,$in,$ENV{'CONTENT_LENGTH'});
}
else
{
# Added for command line debugging
# Supply name/value form data as a command line argument
# Format: name1=value1\&name2=value2\&...
# (need to escape & for shell)
# Find the first argument that's not a switch (-)

$in = ( grep( !/^-/, @ARGV )) [0];
$in =~ s/\\&/&/g; } @in = split(/&/,$in);

foreach $i (0 .. $#in) {
# Convert plus's to spaces

$in[$i] =~ s/\+/ /g;
# Split into key and value.
($key, $val) = split(/=/,$in[$i],2);
# splits on the first =.
# Convert %XX from hex numbers to alphanumeric
$key =~ s/%(..)/pack("c",hex($1))/ge;
$val =~ s/%(..)/pack("c",hex($1))/ge;

# Associate key and value. \0 is the multiple separator
$in{$key} .= "\0" if (defined($in{$key}));
$in{$key} .= $val; } return length($in); }

ACJavascript
10-27-2002, 07:49 PM
There are two things that i got from your question.. so please help me to undestand:D:D

1. DO you mean this: A person types in the work " return " and as it is submitted the word return is replaced by your logo..

2. D you mean this: somewhere in the script is the word return and you want to replace it with your logo.

stevan
10-27-2002, 08:25 PM
I want to put my logo where it says back below



elsif ($in{'action'} eq 'top') {

print "<HTML><HEAD><TITLE>$title - Visiting a link</TITLE></HEAD>\n";
print "<body $body>\n";
print "<br>\n";
print "<center><a href=\"$home/$source\" target=\"_top\"><font size=2 face=\"Arial, Helvetica, sans-serif\">Back</font></a>\n";
print " || <a href=\"http://$target\" target=\"_top\"><font size=2 face=\"Arial, Helvetica, sans-serif\">Remove This Frame</font></a>\n";
print "</center>\n";
print "</body></html>\n";
}


target=\"_top\"><font size=2 face=\"Arial, Helvetica, sans-serif\">Back</font></a>\n";



Thxs STeve

chrisvmarle
10-27-2002, 08:55 PM
simply replace "Back" with an image HTML-code:

<IMG SRC="/path-to/your/image.jpg" WIDTH="100" HEIGHT="80" ALT="A text to show when mouse is over image (optional)">

That's it

Mzzl, Chris