You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Adon Cook <ad...@barrodale.com> on 2002/04/24 19:10:09 UTC

javascript confusion

Hi.

I am wondering if someone could tell me or direct me to where i would find 
out EXACTLY what i have to do to apache 1.3.22 to get javascript to work

I have tired adding a            XBitHack ON           to my httpd.conf and 
have changed the files that has the javascript command to be executable.  I 
have also changed the tag within the html to be "text/javascript" instead 
of "javascript" (which did work on my xitami).  What else do i have to 
set?  The html source that i get when viewing the page shows that a IF ELSE 
javascript statement is not being evaluated, but rather it is being read as 
literal source...............


help!  =)

thanks,
adon


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: File upload limit on Win32

Posted by Octavian Rasnita <or...@home.ro>.
Here is a script for uploading files. It should work under Unix and Windows.
I've included it in the message because I don't know if this list accepts
attachments.

#!c:\perl\bin\perl.exe

# absolute path to folder files will be uploaded to.
# WINDOWS users, your path would like something like : images\\uploads
# UNIX    users, your path would like something like :
/home/www/images/uploads
# do not end the path with any slashes and if you're on a UNIX serv, make
sure
# you CHMOD each folder in the path to 777

#$dir = "/web/demo_uploads";
$dir = "c:\\Program Files\\Apache Group\\Apache\\images";

# absolute URL to folder files will be uploaded to
#$folder = "http://www.perlscriptsjavascripts.com/demo_uploads/";
$folder = "http://localhost/images";

# maximum file size allowed (kilo bytes)
$max = 1000;

# for security reasons, enter your domain name.
# this is so uploads may only occur from your domain
# enter any part of your domain name, or leave this
#  a single /  if you don't mind other web sites using your copy
#$domain = "perlscripts";
#$domain = "localhost";
$domain = "/";

# if a file is successfully uploaded, enter a URL to redirect to.
# leave this blank to have the default message printed
$redirect = "";

# if you would like to be notified of uploads, enter your email address
# between the SINGLE quotes. leave this blank if you would not like to be
notified
#$notify = 'demo_upload@perlscriptsjavascripts.com';
$notify = 'orasnita@home.ro';

# UNIX users, if you entered a value for $notify, you must also enter your
# server's sendmail path. It usually looks something like :
/usr/sbin/sendmail
$send_mail_path = "/usr/sbin/sendmail";

# WINDOWS users, if you entered a value for $notify, you must also enter
your
# server's SMTP path. It usually looks something like : mail.servername.com
$smtp_path = "127.0.0.1";

# set to 1 if you would like all files in the directory printed to the web
page
# after a successful upload (only printed if redirect is off). Set to 0 if
you
# do not want filenames printed to web page
$print_contents = 1;

# allow overwrites? 1 = yes, 0 = no (0 will rename file with a number on the
end, the
# highest number is the latest file)
$overwrite = 0;

# file types allowed, enter each type on a new line
@types = qw~

html
shtml
htm
shtm
cgi
pl
pm
js
cfm
php
asp
txt
doc
rtf
pdf
jpeg
jpg
gif
zip
arj
rar
tar.gz
mp3
avi
wav
mpg
mpeg
exe
com
bat


~;

#    END USER EDITS

$OS = $^O; # operating system name
if($OS =~ /win/i) { $isWIN = 1; }
else {$isUNIX = 1;}

if($isWIN){ $S{S} = "\\\\"; }
else { $S{S} = "/";} # seperator used in paths

$ScriptURL = "http://$ENV{'SERVER_NAME'}$ENV{'SCRIPT_NAME'}";

unless (-d "$dir"){
 mkdir ("$dir", 0777); # unless the dir exists, make it ( and chmod it on
UNIX )
 chmod(0777, "$dir");
}

unless (-d "$dir"){
 # if there still is no dir, the path entered by the user is wrong and the
upload will fail
 &PrintHead; #print the header

 # get the Win root
 $ENV{PATH_INFO} =~ s/\//$S{S}/gi;
 $ENV{PATH_TRANSLATED} =~ s/$ENV{PATH_INFO}//i;

 print qq~
 <table width="600">
 <tr>
 <td>

 <font face="Arial" size="2">
 <b>The path you entered is incorrect.</b> You entered : "$dir"
 <p>
 Your root path is (UNIX): $ENV{DOCUMENT_ROOT}
 <p>
 Your root path is (WINDOWS): $ENV{PATH_TRANSLATED}
 <p>
 Your path should contain your root path followed by a slash followed by the
 destination folder's name. If you are on a WINDOWS server, each slash
should
 be escaped. Eg. each seperator should look like this : \\\\
 <p>
 Sometimes, the root returned is not the full path to your web space. In
this case
 you should either check with your host  or if you are using an FTP client
such as
 CuteFTP, change to the folder you are trying to upload to and look at the
path you
 have taken. You can see this just above the list of files on your server.
 You must use the same path in the \$dir variable.
 </font>

 </td>
 </tr>
 </table>
 ~;

 &PrintFoot; # print the footer
 exit;
}

use CGI; # load the CGI.pm module
my $GET = new CGI; # create a new object
my @VAL = $GET->param; #get all form field names

foreach(@VAL){
 $FORM{$_} = $GET->param($_); # put all fields and values in hash
}

my @files;
foreach(keys %FORM){
 if($_ =~ /^FILE/){
  push(@files, $_); # place the field NAME in an array
 }
}

if(!$VAL[0]){
 # no form fields
 &PrintHead; #print the header

 print qq~
 <table width="760">
 <tr>
 <td>

 <font face="Arial" size="2">
 This script must be called using a form. Your form should point to this
script. Your form tag must contain the following attributes :
 <p>
 &lt;form <font color="#FF0000">action</font>="$ScriptURL" <font
color="#FF0000">method</font>="post" <font
color="#FF0000">enctype</font>="multipart/form-data">
 <p>
 The <font color="#FF0000">method</font> must equal <font
color="#FF0000">post</font> and the <font color="#FF0000">enctype</font>
must equal <font color="#FF0000">multipart/form-data</font>. The <font
color="#FF0000">action</font> has to point to this script (on your server).
If you are reading this, copy and paste the example above. It has the
correct values.
 </font>

 </td>
 </tr>
 </table>
 ~;

 &PrintFoot; # print the footer
 exit;
}

# check domain
if($ENV{HTTP_REFERER} !~ /$domain/i){
 &PrintHead; #print the header

 print qq~
 <table width="600">
 <tr>
 <td>

 <font face="Arial" size="2">
 Invalid referrer.
 </font>

 </td>
 </tr>
 </table>
 ~;

 &PrintFoot; # print the footer
 exit;
}

my $failed; # results string = false

####################################################################

####################################################################

foreach (@files){
 # upload each file, pass the form field NAME if it has a value
 if($GET->param($_)){

  # if the form field contains a file name &psjs_upload subroutine
  # the file's name and path are passed to the subroutine
  $returned = &psjs_upload($_);

  if($returned =~ /^Success/i){
   # if the $returned message begins with "Success" the upload was
successful
   # remove the word "Success" and any spaces and we're left with the
filename
   $returned =~ s/^Success\s+//;
   push(@success, $returned);
  } else {
   # else if the word "success" is not returned, the message is the error
encountered.
   # add the error to the $failed scalar
   $failed .= $returned;
  }
 }
}

# if no error message is return ed, the upload was successful

my ($fNames, $aa, $bb, @current, @currentfiles );

if($failed){

 &PrintHead;

 print qq~
 <table align="center" width="600">
 <tr>
 <td><font face="Arial" size="2">

 The file upload <font color="#ff0000">failed</font>. The reasons returned
are:
 <p>

 $failed

 </font></td>
 </tr>
 </table>
 ~;

 &PrintFoot;

} else {
 # upload was successful

 # add a link to the file
 $folder =~ s/(\/|\\)$//ig;

 # send email if valid email was entered
 if(check_email($notify)){

  # enter the message you would like to receive
  my $message = qq~
  The following files were uploaded to your server :
  ~;

  foreach(@success){
   $message .= qq~
   $folder/$_
   ~;
  }

  if($isUNIX){
   $CONFIG{mailprogram} = $send_mail_path;
   # enter your e-mail name here if you like
   # from e-mail, from name, to e-mail, to name, subject, body
   &send_mail($notify, 'Demo Upload', $notify, 'Demo Upload', 'Upload
Notification', $message);

  } else {
   $CONFIG{smtppath} = $smtp_path;
   &send_mail_NT($notify, 'Your Name', $notify, 'Your Name', 'Upload
Notification', $message);
  }
 }

 if($redirect){
  # redirect user
  print qq~Location: $redirect\n\n~;
 } else {
  # print success page

  &PrintHead;

  print qq~
  <table align="center" width="500">
  <tr>
  <th><font face="Arial" size="2"><font
color="#ff0000">Success</font></font></th>
  </tr>
  <tr>
  <td><font face="Arial" size="2">The following files were successfully
uploaded :
  <p>
  ~;

  foreach(@success){
   print qq~
   $_<p>~;
  }

  print qq~
  </font></td>
  </tr>
  </table>
  <br>
  ~;

  if($print_contents){
   print qq~
   <table align="center" width="500">
   <tr><td><font face="Arial" size="2"><b>Current files in
folder</b></td></tr>
   <tr>
   <td valign="top">
   <font face="Arial" size="2">
   ~;

   opendir(DIR, "$dir");
   @current = readdir(DIR);
   closedir(DIR);

   foreach(@current){
    unless($_ eq '.' || $_ eq '..'){
     push(@currentfiles, $_);
    }
   }

   @currentfiles = sort { uc($a) cmp uc($b) } @currentfiles;

   for($aa = 0; $aa <= int($#currentfiles / 2); $aa++){
    print qq~
    <font color="#ff0000"><b>&#149;</b>
    <a href="$folder/$currentfiles[$aa]"
target="_blank">$currentfiles[$aa]</a></font><br>
    ~;
   }

   print qq~</font></td><td valign="top"><font face="Arial" size="2">~;

   for($bb = $aa; $bb < @currentfiles; $bb++){
    print qq~
    <font color="#ff0000"><b>&#149;</b>
    <a href="$folder/$currentfiles[$bb]"
target="_blank">$currentfiles[$bb]</a></font><br>
    ~;
   }


   print qq~
   </font></td>
   </tr>
   </table>~;
  }

  print qq~
<br>
<center><font face="Arial" size="2">
<a href="http://www.perlscriptsjavascripts.com/?ul">&copy;
PerlScriptsJavaScripts.com</a>
&nbsp; &nbsp;
<a
href="http://www.perlscriptsjavascripts.com/psjs_faqs/index.html?ul">F.A.Q.<
/a>
&nbsp; &nbsp;
<a
href="http://www.perlscriptsjavascripts.com/perl/upload_lite/users_guide.htm
l?ul">Users Guide</a>
</font></center>
~;

  &PrintFoot;

 }
}

####################################################################

####################################################################

sub psjs_upload {

 my ( $type_ok, $file_contents, $buffer, $destination ); # declare some vars

 my $file = $GET->param($_[0]); # get the FILE name. $_[0] is the arg passed

 # if the destination form field exists, use that as the folder to upload
to.
 my $destination = $GET->param("destination");

 # if theres a value in $destination, use it, else use the $dir specified
 # $destination or equals $dir;
 $destination ||= $dir;

 my $limit = $max;
 $limit *= 1024; # convert limit from bytes to kilobytes

 # create another instance of the $file var. This will allow the script to
play
 # with the new instance, without effecting the first instance. This was a
major
 # flaw I found in the psupload script. The author was replacing spaces in
the path
 # with underscores, so the script could not find a file to upload. He
blammed the
 # error on browser problems.
 my $fileName    = $file;

 # get the extension
 my @file_type   = split(/\./, $fileName);
 # we can assume everything after the last . found is the extension
 my $file_type   = $file_type[$#file_type];

 # get the file name, this removes everything up to and including the
 # last slash found ( be it a forward or back slash )
 $fileName =~ s/^.*(\\|\/)//;

 # remove all spaces from new instance of filename var
 $fileName =~ s/\s+//ig;

 # check for any any non alpha numeric characters in filename (allow dots
and dahses)
 $fileName =~ s/\./PsJsDoT/g;
 $fileName =~ s/\-/PsJsDaSh/g;
 if($fileName =~ /\W/){
  $fileName =~ s/\W/n/ig; # replace any bad chars with the letter "n"
 }
 $fileName =~ s/PsJsDoT/\./g;
 $fileName =~ s/PsJsDaSh/\-/g;

 # if $file_type matchs one of the types specified, make the $type_ok var
true
 for($b = 0; $b < @types; $b++){
  if($file_type =~ /^$types[$b]$/i){
   $type_ok++;
  }
 }

 # if ok, check if overwrite is allowed
 if($type_ok){
  if(!$overwrite){ # if $overwite = 0 or flase, rename file using the
checkex sub
   $fileName = check_existence($destination,$fileName);
  }
  # create a new file on the server using the formatted ( new instance )
filename
  if(open(NEW, ">$destination$S{S}$fileName")) {
   if($isWIN){binmode NEW;} # if it's a WIN server, switch to binary mode
   # start reading users HD 1 kb at a time.
   while (read($file, $buffer, 1024)) {
    # print each kb to the new file on the server
    print NEW $buffer;
   }
   # close the new file on the server and we're done
   close NEW;
  } else {
   # return the server's error message if the new file could not be created
   return qq~Error: Could not open new file on server. $!~;
  }

  # check limit hasn't just been overshot
  if(-s "$destination$S{S}$fileName" > $limit){ # -s is the file size
   unlink("$destination$S{S}$fileName"); # delete it if it's over the
specified limit
   return qq~File exceeded limitations : $fileName~;
  }
 } else {
  return qq~Bad file type : $file_type~;
 }

 # check if file has actually been uploaded, by checking the file has a size
 if(-s "$destination$S{S}$fileName"){
  return qq~Success $fileName~; #success
 } else {
  return qq~Upload failed : No data in $fileName. No size on server's copy
of file.~;
 }
}

####################################################################

####################################################################

sub check_existence {
 # $dir,$filename,$newnum are the args passed to this sub
 my ($dir,$filename,$newnum) = @_;

 my (@file_type, $file_type, $exists, $bareName);
 # declare some vars we will use later on in this sub always use paranthesis
 # when declaring more than one var! Some novice programmers will tell you
 # this is not necessary. Tell them to learn how to program.

 if(!$newnum){$newnum = "0";} # new num is empty in first call, so set it to
0

 # read dir and put all files in an array (list)
 opendir(DIR, "$dir");
 @existing_files =  readdir(DIR);
 closedir(DIR);

 # if the filename passed exists, set $exists to true or 1
 foreach(@existing_files){
  if($_ eq $filename){
   $exists = 1;
  }
 }

 # if it exists, we need to rename the file being uploaded and then recheck
it to
 # make sure the new name does not exist
 if($exists){
  $newnum++; # increment new number (add 1)

  # get the extension
  @file_type   = split(/\./, $filename); # split the dots and add inbetweens
to a list
  # put the first element in the $barename var
  $bareName    = $file_type[0];
  # we can assume everything after the last . found is the extension
  $file_type   = $file_type[$#file_type];
  # $#file_type is the last element (note the pound or hash is used)

  # remove all numbers from the end of the $bareName
  $bareName =~ s/\d+$//ig;

  # concatenate a new name using the barename + newnum + extension
  $filename = $bareName . $newnum . '.' . $file_type;

  # reset $exists to 0 because the new file name is now being checked
  $exists = 0;

  # recall this subroutine
  &check_existence($dir,$filename,$newnum);
 } else {
  # the $filename, whether the first or one hundreth call, now does not
exist
  # so return the name to be used
  return ($filename);
 }
}

####################################################################

####################################################################

sub send_mail {
 my ($from_email, $from_name, $to_email, $to_name, $subject, $message ) =
@_;

 if(open(MAIL, "|$CONFIG{mailprogram} -t")) {
  print MAIL "From: $from_email ($from_name)\n";
  print MAIL "To: $to_email ($to_name)\n";
  print MAIL "Subject: $subject\n";
  print MAIL "$message";
  close MAIL;
  return(1);
 } else {
  return;
 }
}

####################################################################

####################################################################

sub send_mail_NT {

 my ($from_email, $from_name, $to_email, $to_name, $subject, $message ) =
@_;

 my ($SMTP_SERVER, $WEB_SERVER, $status, $err_message);
 use Socket;
    $SMTP_SERVER = "$CONFIG{smtppath}";

 # correct format for "\n"
    local($CRLF) = "\015\012";
    local($SMTP_SERVER_PORT) = 25;
    local($AF_INET) = ($] > 5 ? AF_INET : 2);
    local($SOCK_STREAM) = ($] > 5 ? SOCK_STREAM : 1);
    local(@bad_addresses) = ();
    $, = ', ';
    $" = ', ';

    $WEB_SERVER = "$CONFIG{smtppath}\n";
    chop ($WEB_SERVER);

    local($local_address) = (gethostbyname($WEB_SERVER))[4];
    local($local_socket_address) = pack('S n a4 x8', $AF_INET, 0,
$local_address);

    local($server_address) = (gethostbyname($SMTP_SERVER))[4];
    local($server_socket_address) = pack('S n a4 x8', $AF_INET,
$SMTP_SERVER_PORT, $server_address);

    # Translate protocol name to corresponding number
    local($protocol) = (getprotobyname('tcp'))[2];

    # Make the socket filehandle
    if (!socket(SMTP, $AF_INET, $SOCK_STREAM, $protocol)) {
        return;
    }

 # Give the socket an address
 bind(SMTP, $local_socket_address);

 # Connect to the server
 if (!(connect(SMTP, $server_socket_address))) {
  return;
 }

 # Set the socket to be line buffered
 local($old_selected) = select(SMTP);
 $| = 1;
 select($old_selected);

 # Set regex to handle multiple line strings
 $* = 1;

    # Read first response from server (wait for .75 seconds first)
    select(undef, undef, undef, .75);
    sysread(SMTP, $_, 1024);
 #print "<P>1:$_";

    print SMTP "HELO $WEB_SERVER$CRLF";
    sysread(SMTP, $_, 1024);
 #print "<P>2:$_";

 while (/(^|(\r?\n))[^0-9]*((\d\d\d).*)$/g) { $status = $4; $err_message =
$3}
 if ($status != 250) {
  return;
 }

 print SMTP "MAIL FROM:<$from_email>$CRLF";

 sysread(SMTP, $_, 1024);
 #print "<P>3:$_";
 if (!/[^0-9]*250/) {
  return;
 }

    # Tell the server where we're sending to
 print SMTP "RCPT TO:<$to_email>$CRLF";
 sysread(SMTP, $_, 1024);
 #print "<P>4:$_";
 /[^0-9]*(\d\d\d)/;

 # Give the server the message header
 print SMTP "DATA$CRLF";
 sysread(SMTP, $_, 1024);
 #print "<P>5:$_";
 if (!/[^0-9]*354/) {
  return;
 }

 print SMTP qq~From: $from_email ($from_name)$CRLF~;
 print SMTP qq~To: $to_email ($to_name)$CRLF~;
 if($cc){
  print SMTP "CC: $cc ($cc_name)\n";
 }
 print SMTP qq~Subject: $subject$CRLF$CRLF~;
 print SMTP qq~$message~;

 print SMTP "$CRLF.$CRLF";
 sysread(SMTP, $_, 1024);
 #print "<P>6:$_";
 if (!/[^0-9]*250/) {
  return;
 } else {
  return(1);
 }

 if (!shutdown(SMTP, 2)) {
  return;
    }
}

####################################################################

####################################################################

sub PrintHead {
 print qq~Content-type: text/html\n\n~;
 print qq~
 <html>
 <title>PerlScriptsJavascript.com Free upload utility</title>
 <body bgcolor="#ffffff">
 ~;
}

####################################################################

####################################################################

sub PrintFoot {
 print qq~
 </body>
 </html>
 ~;
}

####################################################################

####################################################################

sub check_email {
 my($fe_email) = $_[0];
 if($fe_email) {
  if(($fe_email =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)|(\.$)/) ||
  ($fe_email !~ /^.+@\[?(\w|[-.])+\.[a-zA-Z]{2,3}|[0-9]{1,3}\]?$/)) {
   return;
  } else { return(1) }
 } else {
  return;
 }
}

#End of file

Teddy,
orasnita@home.ro

----- Original Message -----
From: "Yakov Sudeikin" <ya...@exebook.com>
To: <us...@httpd.apache.org>
Sent: Wednesday, April 24, 2002 8:52 PM
Subject: File upload limit on Win32


Hello,

My CGI program uploads images to the website. I have the same program
working under Sambar Server on Windows and under Apache on FreeBSd and under
Apache on Linux. But it will not work on Win32. I tried Apache 1.3 and 2.0.
The problem is that files over 8000 bytes are not processed correctly by the
server. I assume it is some limit set in apache config to accept Form Data
Content not larger than 8K. I found few variables in the documentation for
httpd.conf.
LimitRequestBody
LimitRequestFields
LimitRequestFieldsize
Documentation says that two latter cannot be increased to larger values than
the default 8K. Is that it? Apache just cannot accept large files in
content?

I am using Multipart Form Data stuff on the webpage. The program is writen
in pascal (FreePascal, Delphi, Kylix depemding on the platform).

I tried to set them to many variables with no luck :(
In Sambar Server setting MaxContentLength does the trick. In Apache nothing
seem to help.

At the moment I am stuck and cannot continue the development. I have to
either switch to Sambar Server or wait until someone enlightens me. Please
help.

Yakov Sudeikin
Exebook.com


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


File upload limit on Win32

Posted by Yakov Sudeikin <ya...@exebook.com>.
Hello,

My CGI program uploads images to the website. I have the same program
working under Sambar Server on Windows and under Apache on FreeBSd and under
Apache on Linux. But it will not work on Win32. I tried Apache 1.3 and 2.0.
The problem is that files over 8000 bytes are not processed correctly by the
server. I assume it is some limit set in apache config to accept Form Data
Content not larger than 8K. I found few variables in the documentation for
httpd.conf.
LimitRequestBody
LimitRequestFields
LimitRequestFieldsize
Documentation says that two latter cannot be increased to larger values than
the default 8K. Is that it? Apache just cannot accept large files in
content?

I am using Multipart Form Data stuff on the webpage. The program is writen
in pascal (FreePascal, Delphi, Kylix depemding on the platform).

I tried to set them to many variables with no luck :(
In Sambar Server setting MaxContentLength does the trick. In Apache nothing
seem to help.

At the moment I am stuck and cannot continue the development. I have to
either switch to Sambar Server or wait until someone enlightens me. Please
help.

Yakov Sudeikin
Exebook.com


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: javascript confusion

Posted by jlwpc1 <jl...@mail.earthlink.net>.
From: "Svein Olav Bjerkeset" <sv...@online.no>

> Hi,
>
> As far as I know Javascript is client-side only and has nothing to
do with
> the
> web server (Apache in this case).

This is another of the many Apache fables.

Web servers also use server-side javascript!

A web site designer, can use in her web 
server and in her web sites, as well as 
admin her web server, all in the same 
language - javascript, as used in her 
browser, if she desires too!

Sure cuts down, what she has to learn!

JLW




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: javascript confusion

Posted by Svein Olav Bjerkeset <sv...@online.no>.
Hi,

As far as I know Javascript is client-side only and has nothing to do with
the
web server (Apache in this case). You will have to look into the
configuration
on your browser to enable Javascript.

Svein Olav Bjerkeset

----- Original Message -----
From: "Adon Cook" <ad...@barrodale.com>
To: <us...@httpd.apache.org>
Sent: Wednesday, April 24, 2002 7:10 PM
Subject: javascript confusion


> Hi.
>
> I am wondering if someone could tell me or direct me to where i would find
> out EXACTLY what i have to do to apache 1.3.22 to get javascript to work
>
> I have tired adding a            XBitHack ON           to my httpd.conf
and
> have changed the files that has the javascript command to be executable.
I
> have also changed the tag within the html to be "text/javascript" instead
> of "javascript" (which did work on my xitami).  What else do i have to
> set?  The html source that i get when viewing the page shows that a IF
ELSE
> javascript statement is not being evaluated, but rather it is being read
as
> literal source...............
>
>
> help!  =)
>
> thanks,
> adon
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: javascript confusion

Posted by Daniel Zwink <da...@zwink.de>.
Hi Adon,

On 24.04 10:10, Adon Cook wrote:
>
> I am wondering if someone could tell me or direct me to where i would find 
> out EXACTLY what i have to do to apache 1.3.22 to get javascript to work
> [...]

Javascript is a client-side script language and has nothing to do with the
web server. Furthermore it has nothing to do with Java apart from its name.

Seems to be a problem with your browser.


Daniel
-- 
Auf Gott hoffen wir,
er werde uns auch hinfort erretten.
2. Korinther 1,10

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: making .js javascript files work on apache 2.0.35

Posted by Lee Fellows <lf...@4lane.com>.
Alexander,

  Thank you for the references.  The problem I was seeing, however,
was that language="text/JavaScript" in the <SCRIPT> tag, which is
never proper.

On Thu, 2002-05-02 at 16:51, Alexander Skwar wrote:
> Lee Fellows sagte am 2002-05-01 um 14:44:01 -0400:
> >   My guess, and I admit this is a guess, is that the browser is not
> > recognizing the JavaScript because "text/JavaScript" is not a legitimate
> > scripting language.  I do not have my HTML reference materials with me,
> 
> That's wrong. <script language="JavaScriptn.n"> is a valid tag,  but the
> language attibute of script is deprecated in favor of the type
> attribute.  So, the only correct way to specify JavaScript sections, is
> to use <script type="text/javascript">.  But note that this is case
> sensitive!  So text/JavaScript is not the same as text/javascript.  You
> may use language="whatever", but type is required.
> 
> > but that would be the first place I would look.
> 
> http://www.htmlhelp.com/reference/html40/special/script.html
> http://www.w3.org/TR/1999/REC-html401-19991224/interact/scripts.html#adef-t ype-SCRIPT
> 
> Alexander Skwar
> -- 
> How to quote:	http://learn.to/quote (german) http://quote.6x.to (english)
> Homepage:	http://www.iso-top.de      |    Jabber: askwar@a-message.de
>    iso-top.de - Die günstige Art an Linux Distributionen zu kommen
>                        Uptime: 2 hours 43 minutes
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: making .js javascript files work on apache 2.0.35

Posted by Alexander Skwar <li...@DigitalProjects.com>.
Lee Fellows sagte am 2002-05-01 um 14:44:01 -0400:
>   My guess, and I admit this is a guess, is that the browser is not
> recognizing the JavaScript because "text/JavaScript" is not a legitimate
> scripting language.  I do not have my HTML reference materials with me,

That's wrong. <script language="JavaScriptn.n"> is a valid tag,  but the
language attibute of script is deprecated in favor of the type
attribute.  So, the only correct way to specify JavaScript sections, is
to use <script type="text/javascript">.  But note that this is case
sensitive!  So text/JavaScript is not the same as text/javascript.  You
may use language="whatever", but type is required.

> but that would be the first place I would look.

http://www.htmlhelp.com/reference/html40/special/script.html
http://www.w3.org/TR/1999/REC-html401-19991224/interact/scripts.html#adef-t ype-SCRIPT

Alexander Skwar
-- 
How to quote:	http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:	http://www.iso-top.de      |    Jabber: askwar@a-message.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                       Uptime: 2 hours 43 minutes

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: making .js javascript files work on apache 2.0.35

Posted by Lee Fellows <lf...@4lane.com>.
Adon,

  Like Joshua, I am not a JavaScript expert.  But the last time I used
JavaScript, I had to write the script tag like:
	<SCRIPT language="JavaScript1.1">.

  My guess, and I admit this is a guess, is that the browser is not
recognizing the JavaScript because "text/JavaScript" is not a legitimate
scripting language.  I do not have my HTML reference materials with me,
but that would be the first place I would look.

  What is definitely happening is that the browser does not recognize
the Script, hence it does not execute it.  I tested this with Netscape
4.7 in which I have javascript enabled.  

HTH 

On Wed, 2002-05-01 at 13:39, Adon Cook wrote:
> Lee,
> 
> here is my situation.
> 
> take a look at
> 
> www.barrodale.com/webdev  (xitami)
> 
> which is how i wish things to look
> 
> but
> 
> orchid.barrodale.com   (apache)
> 
> does not display the correct menu on the right hand side!!
> 
> If you look at the source files for each the one from the first link(on the 
> apache), is executing the IF statement and writing the appropriate 
> menu.  The second link above reads right through the whole IF and never 
> displays the menu.
> 
> This is what made me belive that i need to have jserv.  But i'm totally lost.
> 
> thanks,
> adon
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: making .js javascript files work on apache 2.0.35

Posted by R'twick Niceorgaw <rt...@niceorgaw.com>.
Do you have the menu_static.js in proper place in the second link
(orchid.barrodale.com) ? To me it looks like the .js file is not there.

It looks for /webdav/menu_static.js  ( in case of IE ) and other cases in
/menu_static.js which translates to
orchid.barrodale.com/webdav/menu_static.js and
orchid.barrodale.com/menu_static.js

check if you have the file in both these places.

HTH
R'twick

----- Original Message -----
From: "Adon Cook" <ad...@barrodale.com>
To: <us...@httpd.apache.org>
Sent: Wednesday, May 01, 2002 1:39 PM
Subject: Re: making .js javascript files work on apache 2.0.35


> Lee,
>
> here is my situation.
>
> take a look at
>
> www.barrodale.com/webdev  (xitami)
>
> which is how i wish things to look
>
> but
>
> orchid.barrodale.com   (apache)
>
> does not display the correct menu on the right hand side!!
>
> If you look at the source files for each the one from the first link(on
the
> apache), is executing the IF statement and writing the appropriate
> menu.  The second link above reads right through the whole IF and never
> displays the menu.
>
> This is what made me belive that i need to have jserv.  But i'm totally
lost.
>
> thanks,
> adon
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: making .js javascript files work on apache 2.0.35

Posted by Adon Cook <ad...@barrodale.com>.
Lee,

here is my situation.

take a look at

www.barrodale.com/webdev  (xitami)

which is how i wish things to look

but

orchid.barrodale.com   (apache)

does not display the correct menu on the right hand side!!

If you look at the source files for each the one from the first link(on the 
apache), is executing the IF statement and writing the appropriate 
menu.  The second link above reads right through the whole IF and never 
displays the menu.

This is what made me belive that i need to have jserv.  But i'm totally lost.

thanks,
adon


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: making .js javascript files work on apache 2.0.35

Posted by Lee Fellows <lf...@4lane.com>.
Adon,

  The script sample you show is client side, not server-side js.  It is
up to the browser to render this.  What is not working?




On Wed, 2002-05-01 at 13:25, Adon Cook wrote:
> okay everyone I am a total newbie need HELP.  I am changing webservers from 
> a Xitami to apache.  Currently i have some .js files that are utilized by 
> my webpages to display a dynamic(i belive serverside javascript?!?) menu on 
> all pages.
> 
> I have a bare-bones linux 7.1 OS.  What do i need to install.  Do i need 
> Tomcat?  Jserv?  JDK?
> 
> help!  =)
> 
> adon
> 
> sample html that i am using:
> 
> <script language="javascript"><!--
> if ((navigator.appName == "Microsoft Internet Explorer") && 
> (parseInt(navigator.appVersion) >= 4)){ document.write('<SCRIPT 
> language="javascript" src="/menu_dynamic.js"></script>
> </head>
> 
> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" 
> bgcolor="#FFFFFF"
> background="/images/template_background.gif"
> onLoad="toggle('homeMenu'); highlight('index')">
> 
> <p>')} else {document.write('<script language="javascript" 
> src="/menu_static.js"></script>')}
> //--&gt;<!--webbot bot="HTMLMarkup" startspan --></SCRIPT><!--webbot 
> bot="HTMLMarkup" endspan
> --> </p>
> 
> <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
>    <tr>
>      <td width="250" height="80"><img src="/images/template_topleft_nologo.gif"
>      width="250" height="80" border="0" hspace="0" vspace="0"></td>
>      <td width="100%" height="80" valign="top" align="left"><img
>      src="/images/template_top.gif" width="100" height="80" hspace="0" 
> vspace="0"></td>
>    </tr>
>    <tr>
>      <td width="250" height="100%" valign="top" align="left"><img
>      src="/images/template_left.gif" width="250" height="150" hspace="0" 
> vspace="0"><br>
>      <script language="javascript"><!--
> writemenu();
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: making .js javascript files work on apache 2.0.35

Posted by Owen Boyle <ob...@bourse.ch>.
jlwpc1 wrote:
> 
> You see the web developer of today, can
> learn only one language, if she wants too,
> for both the browser and the server!
> 
> You need to find your OS "engine" that
> runs "javascript" server-side - like ScriptEase,
> for one that runs on almost any OS.

Errr.. This is a support list for the apache webserver. I don't come on
plugging Python, Ruby, Parrot, C++ or whatever, so why should you be
proselytising one-size-fits-all JavaScript. 

Rgds,

Owen Boyle.

PS Perl will whup your JS any day....

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: making .js javascript files work on apache 2.0.35

Posted by jlwpc1 <jl...@mail.earthlink.net>.
From: "Joshua Slive"

> I'm no javascript expert, but that looks like client-side javascript
to
> me.  In that case, the web server doesn't need anything at all.
What
> makes you think the javascript is server-side?
>

What the OP posted, I believe is client
side too ( I for one did not bother to check )
but _yes_, "javascript" is and can
be server-side ran in _most_ servers,
regardless of OS.

You see the web developer of today, can
learn only one language, if she wants too,
for both the browser and the server!

You need to find your OS "engine" that
runs "javascript" server-side - like ScriptEase,
for one that runs on almost any OS.

Also the Windows OS comes with a built-in
"engine" for all Windows OS versions, called
( Windows Script Host WSH 5.6 ).

Most Windows versions have this installed
already. Best to be on the current version
5.6.

On the command line, try to find your version:

"cscript.exe //logo"    without the quotes

or

cscript.exe /?

HOWTO: Use Windows Script Host Scripts as CGI Scripts
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q221081

Windows Script Documentation
http://download.microsoft.com/download/winscript56/Install/5.6/W982KMe
XP/EN-US/scrdoc56en.exe

Windows Script Host  ( WSH )
http://msdn.microsoft.com/scripting/

Good IE information (script info)
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtmlrefs.as
p

JLW








---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: making .js javascript files work on apache 2.0.35

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, 1 May 2002, Adon Cook wrote:

> okay everyone I am a total newbie need HELP.  I am changing webservers from
> a Xitami to apache.  Currently i have some .js files that are utilized by
> my webpages to display a dynamic(i belive serverside javascript?!?) menu on
> all pages.
>
> I have a bare-bones linux 7.1 OS.  What do i need to install.  Do i need
> Tomcat?  Jserv?  JDK?

I'm no javascript expert, but that looks like client-side javascript to
me.  In that case, the web server doesn't need anything at all.  What
makes you think the javascript is server-side?

Joshua.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


making .js javascript files work on apache 2.0.35

Posted by Adon Cook <ad...@barrodale.com>.
okay everyone I am a total newbie need HELP.  I am changing webservers from 
a Xitami to apache.  Currently i have some .js files that are utilized by 
my webpages to display a dynamic(i belive serverside javascript?!?) menu on 
all pages.

I have a bare-bones linux 7.1 OS.  What do i need to install.  Do i need 
Tomcat?  Jserv?  JDK?

help!  =)

adon

sample html that i am using:

<script language="javascript"><!--
if ((navigator.appName == "Microsoft Internet Explorer") && 
(parseInt(navigator.appVersion) >= 4)){ document.write('<SCRIPT 
language="javascript" src="/menu_dynamic.js"></script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" 
bgcolor="#FFFFFF"
background="/images/template_background.gif"
onLoad="toggle('homeMenu'); highlight('index')">

<p>')} else {document.write('<script language="javascript" 
src="/menu_static.js"></script>')}
//--&gt;<!--webbot bot="HTMLMarkup" startspan --></SCRIPT><!--webbot 
bot="HTMLMarkup" endspan
--> </p>

<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
     <td width="250" height="80"><img src="/images/template_topleft_nologo.gif"
     width="250" height="80" border="0" hspace="0" vspace="0"></td>
     <td width="100%" height="80" valign="top" align="left"><img
     src="/images/template_top.gif" width="100" height="80" hspace="0" 
vspace="0"></td>
   </tr>
   <tr>
     <td width="250" height="100%" valign="top" align="left"><img
     src="/images/template_left.gif" width="250" height="150" hspace="0" 
vspace="0"><br>
     <script language="javascript"><!--
writemenu();


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org