Re: [WebDNA] Need some PHP help

This WebDNA talk-list message is from

2009


It keeps the original formatting.
numero = 103526
interpreted = N
texte = --Apple-Mail-112-880466170 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit This is a good starting place: http://www.php.net/manual/en/ On Sep 2, 2009, at 11:45 AM, Dan Strong wrote: > This is great. Where can I sign up for your php-as-a-second-language > course? ;) > -Dan > > > On Wed, 2 Sep 2009 10:16:20 -0500 > Clint Davis wrote: >> Translated into English. I'm not sure where some of the variables >> are coming from - may be in the JS or SWF files. >> On Aug 31, 2009, at 4:17 PM, Patrick McCormick wrote: >>> >> if (!empty($_FILES)) { >> If the $_FILES variable is not empty... >>> $tempFile = $_FILES['Filedata']['tmp_name']; >> create a $tempFile variable equal to a temporary file name >>> $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . >>> '/'; >> create a $targetPath variable equal to the document root directory >> under which the current script is executing plus the designated path >>> $targetFile = str_replace('//','/',$targetPath) . >>> $_FILES['Filedata']['name']; >> create a $targetFile variable equal to the path (with // converted >> to /) plus the file name >>> // $fileTypes = str_replace('*.','',$_REQUEST['fileext']); >> create a $fileTypes variable equal to the $fileext form variable >> (with *. converted to blank) >>> // $fileTypes = str_replace(';','|',$fileTypes); >> update the $fileTypes variable with ; replaced by | >>> // $typesArray = split('\|',$fileTypes); >> create an array name $typesArray by splitting the $fileTypes >> variable using a | delimiter >>> // $fileParts = pathinfo($_FILES['Filedata']['name']); >> create an array named $fileParts by splitting the upload path >> variable using a / delimiter >> this includes the directory name, base name, file extension, and >> file name >>> // if (in_array($fileParts['extension'],$typesArray)) { >> if the extension of the uploaded file is found in the $typesArray... >>> // Uncomment the following line if you want to make the >>> directory if it doesn't exist >>> // mkdir(str_replace('//','/',$targetPath), 0755, true); >> create a directory based on the $targetPath variable (with // >> replaced by /) and set permissions to 755 >>> move_uploaded_file($tempFile,$targetFile); >> move (or rename) the uploaded file from the $tempFile name to the >> $targetFile name >>> echo "1"; >> display '1' on the page >>> // } else { >> if the extension of the uploaded file is NOT found in the >> $typesArray... >>> // echo 'Invalid file type.'; >> display 'Invalid file type.' on the page >>> // } >>> } >>> ?> --Apple-Mail-112-880466170 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable This is a good starting = place: http://www.php.net/manual/en/

On Sep 2, 2009, at 11:45 AM, Dan Strong = wrote:

This is great. Where can I sign up for your = php-as-a-second-language course? ;)
-Dan


On Wed, 2 Sep = 2009 10:16:20 -0500
Clint Davis <cdavis@grayloon.com> = wrote:
Translated into English. I'm not = sure where some of the variables are  coming from - may be in the = JS or SWF files.
On Aug 31, = 2009, at 4:17 PM, Patrick McCormick wrote:
<?php
if (!empty($_FILES)) = {
If the $_FILES = variable is not empty...
$tempFile =3D = $_FILES['Filedata']['tmp_name'];
create a $tempFile variable equal to a temporary file = name
= $targetPath =3D $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . = '/';
create a = $targetPath variable equal to the document root directory  under = which the current script is executing plus the designated = path
= $targetFile =3D  str_replace('//','/',$targetPath) . =  $_FILES['Filedata']['name'];
create a $targetFile variable equal to the path (with // = converted  to /) plus the file name
// $fileTypes  =3D = str_replace('*.','',$_REQUEST['fileext']);
create a $fileTypes variable equal to the = $fileext form variable (with  *. converted to = blank)
= // $fileTypes  =3D = str_replace(';','|',$fileTypes);
update the $fileTypes variable with ; replaced by = |
= // $typesArray =3D = split('\|',$fileTypes);
create an array name $typesArray by splitting the = $fileTypes variable  using a | = delimiter
= // $fileParts  =3D = pathinfo($_FILES['Filedata']['name']);
create an array named $fileParts by splitting the = upload path variable  using a / = delimiter
this includes the = directory name, base name, file extension, and file =  name
= // if (in_array($fileParts['extension'],$typesArray)) = {
if the = extension of the uploaded file is found in the = $typesArray...
= = // Uncomment the following line if you want to make the directory =  if it doesn't exist
// = mkdir(str_replace('//','/',$targetPath), 0755, = true);
create a = directory based on the $targetPath variable (with // replaced  by = /) and set permissions to 755
= move_uploaded_file($tempFile,$targetFile);
move (or rename) the uploaded file from = the $tempFile name to the  $targetFile = name
= = echo "1";
display '1' on the page
// } else = {
if the = extension of the uploaded file is NOT found in the = $typesArray...
= // = echo 'Invalid file = type.';
display = 'Invalid file type.' on the page
// = }
}
?>
=

=

= --Apple-Mail-112-880466170-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Need some PHP help ("Dan Strong" 2009)
  2. Re: [WebDNA] Need some PHP help (Clint Davis 2009)
  3. Re: [WebDNA] Need some PHP help ("Dan Strong" 2009)
  4. Re: [WebDNA] Need some PHP help (Clint Davis 2009)
  5. Re: [WebDNA] Need some PHP help (Patrick McCormick 2009)
  6. Re: [WebDNA] Need some PHP help (Steve Craig 2009)
  7. Re: [WebDNA] Need some PHP help (Govinda 2009)
  8. [WebDNA] Need some PHP help (Patrick McCormick 2009)
--Apple-Mail-112-880466170 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit This is a good starting place: http://www.php.net/manual/en/ On Sep 2, 2009, at 11:45 AM, Dan Strong wrote: > This is great. Where can I sign up for your php-as-a-second-language > course? ;) > -Dan > > > On Wed, 2 Sep 2009 10:16:20 -0500 > Clint Davis wrote: >> Translated into English. I'm not sure where some of the variables >> are coming from - may be in the JS or SWF files. >> On Aug 31, 2009, at 4:17 PM, Patrick McCormick wrote: >>> >> if (!empty($_FILES)) { >> If the $_FILES variable is not empty... >>> $tempFile = $_FILES['Filedata']['tmp_name']; >> create a $tempFile variable equal to a temporary file name >>> $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . >>> '/'; >> create a $targetPath variable equal to the document root directory >> under which the current script is executing plus the designated path >>> $targetFile = str_replace('//','/',$targetPath) . >>> $_FILES['Filedata']['name']; >> create a $targetFile variable equal to the path (with // converted >> to /) plus the file name >>> // $fileTypes = str_replace('*.','',$_REQUEST['fileext']); >> create a $fileTypes variable equal to the $fileext form variable >> (with *. converted to blank) >>> // $fileTypes = str_replace(';','|',$fileTypes); >> update the $fileTypes variable with ; replaced by | >>> // $typesArray = split('\|',$fileTypes); >> create an array name $typesArray by splitting the $fileTypes >> variable using a | delimiter >>> // $fileParts = pathinfo($_FILES['Filedata']['name']); >> create an array named $fileParts by splitting the upload path >> variable using a / delimiter >> this includes the directory name, base name, file extension, and >> file name >>> // if (in_array($fileParts['extension'],$typesArray)) { >> if the extension of the uploaded file is found in the $typesArray... >>> // Uncomment the following line if you want to make the >>> directory if it doesn't exist >>> // mkdir(str_replace('//','/',$targetPath), 0755, true); >> create a directory based on the $targetPath variable (with // >> replaced by /) and set permissions to 755 >>> move_uploaded_file($tempFile,$targetFile); >> move (or rename) the uploaded file from the $tempFile name to the >> $targetFile name >>> echo "1"; >> display '1' on the page >>> // } else { >> if the extension of the uploaded file is NOT found in the >> $typesArray... >>> // echo 'Invalid file type.'; >> display 'Invalid file type.' on the page >>> // } >>> } >>> ?> --Apple-Mail-112-880466170 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable This is a good starting = place: http://www.php.net/manual/en/

On Sep 2, 2009, at 11:45 AM, Dan Strong = wrote:

This is great. Where can I sign up for your = php-as-a-second-language course? ;)
-Dan


On Wed, 2 Sep = 2009 10:16:20 -0500
Clint Davis <cdavis@grayloon.com> = wrote:
Translated into English. I'm not = sure where some of the variables are  coming from - may be in the = JS or SWF files.
On Aug 31, = 2009, at 4:17 PM, Patrick McCormick wrote:
<?php
if (!empty($_FILES)) = {
If the $_FILES = variable is not empty...
$tempFile =3D = $_FILES['Filedata']['tmp_name'];
create a $tempFile variable equal to a temporary file = name
= $targetPath =3D $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . = '/';
create a = $targetPath variable equal to the document root directory  under = which the current script is executing plus the designated = path
= $targetFile =3D  str_replace('//','/',$targetPath) . =  $_FILES['Filedata']['name'];
create a $targetFile variable equal to the path (with // = converted  to /) plus the file name
// $fileTypes  =3D = str_replace('*.','',$_REQUEST['fileext']);
create a $fileTypes variable equal to the = $fileext form variable (with  *. converted to = blank)
= // $fileTypes  =3D = str_replace(';','|',$fileTypes);
update the $fileTypes variable with ; replaced by = |
= // $typesArray =3D = split('\|',$fileTypes);
create an array name $typesArray by splitting the = $fileTypes variable  using a | = delimiter
= // $fileParts  =3D = pathinfo($_FILES['Filedata']['name']);
create an array named $fileParts by splitting the = upload path variable  using a / = delimiter
this includes the = directory name, base name, file extension, and file =  name
= // if (in_array($fileParts['extension'],$typesArray)) = {
if the = extension of the uploaded file is found in the = $typesArray...
= = // Uncomment the following line if you want to make the directory =  if it doesn't exist
// = mkdir(str_replace('//','/',$targetPath), 0755, = true);
create a = directory based on the $targetPath variable (with // replaced  by = /) and set permissions to 755
= move_uploaded_file($tempFile,$targetFile);
move (or rename) the uploaded file from = the $tempFile name to the  $targetFile = name
= = echo "1";
display '1' on the page
// } else = {
if the = extension of the uploaded file is NOT found in the = $typesArray...
= // = echo 'Invalid file = type.';
display = 'Invalid file type.' on the page
// = }
}
?>
=

=

= --Apple-Mail-112-880466170-- Clint Davis

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

NT version and O'reily's WebSite (1997) best way to store prefs (1998) Speed Optimization - Mac (1997) [WebDNA] OT: just poking (2010) [WebDNA] Strange MATH result - BUG (2010) WebCat B13 Mac CGI -- Frames question (1997) won't serve .tpl -not permissions- can't process .tpl (2000) WebCat2 - many [carts] on one template page? (1997) form data submission gets truncated (1997) Webcat and other cgi (2000) FlushDatabases (2000) Nested vs conditional (1997) Max Record length restated as maybe bug (1997) PCS Customer submissions ? (1997) Re:Emailer Error Question (1998) WebCatalog for guestbook ? (1997) Suggestions (1998) More NT encyption!! (1999) MATH (1998) JavaScript (1998)