Skip to main content

Home/ PHP Programming/ Contents contributed and discussions participated by sloansteddi

Contents contributed and discussions participated by sloansteddi

sloansteddi

Secure File Upload with PHP - 0 views

  •   $ext = substr($filename, strrpos($filename, '.') + 1);
  • ($ext == "jpg")
  • $_FILES["uploaded_file"]["type"] the MIME type of the uploaded file (if the browser provided the type)
sloansteddi

MDB2-Cheatsheet - codeschmie.de - 0 views

  • fetchOne([int $colnum = 0])
  •  
    examples for using MDB2
sloansteddi

MDB2 | Prepare & Execute - 0 views

  •  array('integer'), array('text', 'text')
    • sloansteddi
       
      Make sure to pass TWO types arrays when selecting data with a where clause: prepare($sql, $typesIN, $typesOUT) inserting just takes one...
  • $sth = $mdb2->prepare('INSERT INTO numbers (number) VALUES (?)', array('integer'), MDB2_PREPARE_MANIP); $sth->execute(1); $sth->execute(8);
  •  
    walk through of preparing and executing statements
sloansteddi

PEAR::Pager Tutorials - Paginate database results - 0 views

  • Method #2: Pager_Wrapper to the rescue!
  •  
    This tutorial explains how to paginate database results using PEAR::Pager and Pager_Wrapper. The latter is useful, because without it (Pager_Wrapper), you are selecting the ENTIRE result set for each page, which undoes one of the important advantages of paginating.
sloansteddi

PEAR Auth example - Dev Shed - 0 views

  •  
    PEAR::Auth example
  •  
    Example code for the PEAR auth class.
sloansteddi

PEAR::Calendar Examples - 0 views

  •  
    a bunch of examples on using the PEAR::Calendar class. Code included. With a little styling, those calenders could look right nice!!!
sloansteddi

How to use PHP and PEAR MDB2 (Tutorial) | David and Katherine Goodwin - 0 views

    • sloansteddi
       
      Prepare takes the $sql (with '?'s where data will go), along with the TYPES (array) of data to prepare the sql for, and a 3rd paramater for manipulating or result-getting (see next paragraph). It assigns this to $prepared_statement. Another array is created with the data (in the same order as the types, of course), and the RESULT is aquired by running the execute() method on the $prepared_statement object, passing the execute method the "$data" array to fill in the '?'s After this do everything as normal.
  • column = ?
  • id = ?
  • ...1 more annotation...
  • I have a feeling that MDB2 lower cases all field names - so you'll probably need : echo $row['name'] A good idea would be to print_r($row) or similar, to see what's in it
  •  
    A great walk through on getting started with MDB2
sloansteddi

Rename File Upload PHP - Rename PHP Upload - Change Upload Name PHP - 0 views

  •  
    Randomize upload file names to avoid clobbering.
1 - 8 of 8
Showing 20 items per page