Jump to content

intech

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

intech's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. DOH! :o Always something simple, isn't it? My gratitude for your eyes and your help!
  2. Strange...I have done many simple file upload scripts and this one is baffeling me: First off, Here is my code (minus the MySQl connection-MySQL is working fine w/no issues): [code]if((is_uploaded_file($_FILES['homeri1']['tmp_name'])) && ($_FILES['homeri1']['type'] == 'image/jpeg' || 'image/pjpeg')) { $filename1 = addslashes($_FILES['homeri1']['name']); $filetmp1 = $_FILES['homeri1']['tmp_name']; $filetype1 = $_FILES['homeri1']['type']; $filesize1 = $_FILES['homeri1']['size']; $filedest1 = 'oosup/';     }     else { $filename1 = '';     } // Standard MySQL connection     mysql_select_db("oosdb1") or die("<b>Database Error. Please contact Integrated Technologies.</b>");     $query_update1 = "UPDATE home SET     home_lp1='$homelp1',home_lp2='$homelp2',home_lp3='$homelp3',home_lp4='$homelp4',     home_lp5='$homelp5',home_lp6='$homelp6',home_lp7='$homelp7',home_ri1='$filename1'       WHERE table_name='home' limit 1";     $result_update1 = mysql_query($query_update1) or die(mysql_error());     if(($filename1 != '') && (!file_exists($filedest1 . stripslashes($filename1)))) { move_uploaded_file($filetmp1, $filedest1 . stripslashes($filename1));     }[/code] What it should do: 1) Verify the file was indeed a file upload AND verify the file is of file type JPEG 2) IF both these conditions are met, then initialize the simple variables OR ELSE set the main variable of $filename1 to blank. 3) Insert the file name into my MySQL table (works fine) 4) IF $filename1 DOES NOT equal blank and does not exist, move the file to the destination folder. What it is currently doing: 1) When I try to upload a .txt, .pdf or any other file type, it STILL uploads the file AND inserts the file name into the MySQL table. I have verified this in both IE 6, Firefox AND Opera. I am at a loss. I have had a very long night of trying to find the error in my code that is allowing ALL file types to be uploaded. (I DO NOT receive any PHP errors or warnings). PHP Version: 4.4.4 OS Version: Windows XP PRO/IIS 5.1 My gratitude ahead of time...
  3. Now we're getting some where... Changed my line to the following: [code]$info .= ". $some_info .";[/code] It does pass all checkbox values to the email now, but I now get the dreaded error: [quote]Notice: Undefined variable: info [/quote]
  4. my line... [code]$info = ". $it_info ."; [/code] Should read... [code]$info = ". $some_info ."; [/code] (But still same problem) Yep all variables are printed to screen with your debug code...
  5. These foreach() statements have always thrown me for a loop... I have a simple contact us form with a series of checkboxes where users can request notifications by different formats. They could have 1,2 or any number of boxes checked. Here is my FORM code: [code] <input type="checkbox" name="some_info[]" value="Website Development" />DVD <input type="checkbox" name="some_info[]" value="Network Solutions" />Email <input type="checkbox" name="some_info[]" value="Computer Upgrades/Repairs" />Newsletter [/code] And here is my foreach() statement: [code] foreach($_POST['some_info'] as $some_info) {     $info = ". $some_info ."; }[/code] What I get in the email is only the last selection formatted like the following: Media requested: . Newsletter . Not all variables are being passed... My gratitude ahead of time...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.