You are here: Re: upload - return to the calling script or make it in single file « All PHP « IT news, forums, messages
Re: upload - return to the calling script or make it in single file

Posted by Steve on 02/21/07 17:31

<kkadrese@yahoo.com> wrote in message
news:1172062117.118275.164890@s48g2000cws.googlegroups.com...
| hello group,
|
| in upload form on action a php script is called. How to return from
| this script to the calling page?

either leave the 'action' out all together, or make it point to
$_SERVER('PHP_SELF')

| Or maybe it could be done in such a way that all the code resides in
| one file, action script is a php function somehow initiated?

put a hidden input in the form named something like 'inputSubmitted' (or
just name the submit button in the same way) and check at the beginning of
the page script - take the desired actions you want.

if ($_REQUEST['inputSubmitted'])
{
// check to see if anything was actually submitted
// check to see if upload was 'safe' (free of viruses and strip [or
comment out] anything that php may mistakenly execute)
// check to see that file attributes meet business/internal rules (file
size, nomanclature, etc.)
// show messages/warnings/errors related to the transaction
// relocate uploaded 'safe' file(s) (either to different path or store in
db)
}

// this is where your current page code beings

hth

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация