Prev | Current Page 435 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

..
if (isset ($_POST['Upload']))
{
/* Check whether we have write permission on the
product_images folder */
if (!is_writeable(SITE_ROOT . '/product_images/'))
{
echo "Can't write to the product_images folder";
exit();
}
// If the error code is 0, the file was uploaded ok
if ($_FILES['ImageUpload']['error'] == 0)
{
/* Use the move_uploaded_file PHP function to move the file
from its temporary location to the product_images folder */
move_uploaded_file($_FILES['ImageUpload']['tmp_name'],
SITE_ROOT . '/product_images/' .
$_FILES['ImageUpload']['name']);
// Update the product's information in the database
Catalog::SetImage($this->_mProductId,
$_FILES['ImageUpload']['name']);
}
CHAPTER 11 ?–  CATALOG ADMINISTRATION: PRODUCTS AND ATTRIBUTES 334
// If the error code is 0, the file was uploaded ok
if ($_FILES['Image2Upload']['error'] == 0)
{
/* Use the move_uploaded_file PHP function to move the file
from its temporary location to the product_images folder */
move_uploaded_file($_FILES['Image2Upload']['tmp_name'],
SITE_ROOT . '/product_images/' .
$_FILES['Image2Upload']['name']);
// Update the product's information in the database
Catalog::SetImage2($this->_mProductId,
$_FILES['Image2Upload']['name']);
}
// If the error code is 0, the file was uploaded ok
if ($_FILES['ThumbnailUpload']['error'] == 0)
{
// Move the uploaded file to the product_images folder
move_uploaded_file($_FILES['ThumbnailUpload']['tmp_name'],
SITE_ROOT .


Pages:
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447
mapy polski Golec uOrkiestra 3 rolki napinacza paska klinowego brak Porównywarka