Jump to content

sungpeng

Members
  • Posts

    290
  • Joined

  • Last visited

Posts posted by sungpeng

  1. I have fields img1, img2, img3, img4, img5, img6, img7, img8, img9 in mysql.

    Given 3 input box only

     

    for($i=1; $i<=3; $i++){

    echo "<tr><td>text $i</td></tr>";

    echo "<tr><td><input type=text name='text[]''></td></tr>";

    }

     

    I need a code that can insert 3 values into mysql above fields if the fields is empty. How to code? Can help?

     

     

     

     

  2. hi PFMaBiSmAd,

     

    Could help explain the "outputting content to the browser before a header" and the "Your files have BOM (Byte Order Mark) characters". Trying to understand. I find that I just put the include 'header'; later than the session it solve the problem.

  3. <?php
    
    include 'config.php';
    if($_POST[action]=="Update")
    {	
    
    
    
    
    
                   
    
    			$folder_path="instant/";
    			$image_path=$folder_path.$_FILES['imagefile']['name'];
    			$img_name=$_FILES['imagefile']['name'];
    
    			copy($imagefile, "$image_path");
    
    
              }			
    
    
    
    
    
    
    ?>
    
    <html>
    
    <title>Upload an image to a database</title>
    
    
    <body>
    
    
    
    <h2>Update with new information</h2>
    
    <form name="form" enctype="multipart/form-data" method="post" action="<?php echo"$PHP_SELF?pid=$_GET[pid]"; ?>">
    <input type='file' name='imagefile'><br>
    
    <input type="submit" name="action" value="Update">
    </form>
    
    </body>
    </html>

     

    Hi good day check is there error in my code? Why I cannot upload anything picture using this code. Thank

×
×
  • 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.