SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2007
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    upload images and text same time (was "Any Idea?????")

    Hello to all

    I need to do this
    (see the image1.jpg)

    And I have the following code

    PHP Code:
    <?php
    if(isset($_POST['save']))
    {
        
    $title   $_POST['title'];
        
    $content $_POST['content'];
        
        
        if(!
    get_magic_quotes_gpc())
        {
            
    $title   addslashes($title);
            
    $content addslashes($content);
        }
        include 
    'library/config.php';
        include 
    'library/opendb.php';
        
        
    $query "INSERT INTO news2 (title, content) VALUES ('$title', '$content')";
        
    mysql_query($query) or die('Error ,query failed');
        include 
    'library/closedb.php';
        
        echo 
    "Article '$title' added";
        }
    ?>
    <form method="post">
      <table width="700" border="0" cellpadding="2" cellspacing="1" class="box" align="center">
        <tr> 
          <td width="100">Title</td>
          <td><input name="title" type="text" class="box" id="title"></td>
        </tr>
        <tr> 
          <td width="100">Nombre</td>
          <td><input name="nombre" type="text" class="box" id="nombre"></td>
        </tr>
        <tr> 
          <td width="100">Content</td>
          <td><textarea name="content" cols="50" rows="10" class="box" id="content"></textarea></td>
        </tr>
        <tr> 
          <td width="100">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr> 
          <td colspan="2" align="center"><input name="save" type="submit" class="box" id="save" value="Save Article"></td>
        </tr>
      </table>
    </form>
    </body>
    </html>
    My question is
    I can make what is shown in the image1 with this code???????
    what do i need to put on in this code?????????

    Help me please
    I'm newbie
    Attached Images Attached Images

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,804
    Mentioned
    157 Post(s)
    Tagged
    3 Thread(s)
    Hi Neonardo,
    The code you have given is for a form input whereas the image is page output. What is it that you want to do?!
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2007
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the idea is upload images and text same time, using this script
    the script is not complete for upload text and images, so I need help for this, but the problem is solved

    thanks spikez and sorry for my bad inglish :P

  4. #4
    SitePoint Zealot t0WL337's Avatar
    Join Date
    Mar 2007
    Location
    Ottawa, Ontario!
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So you don't need help anymore or you do still?
    <3php && SitePoint ?>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •