SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast mihai001's Avatar
    Join Date
    Sep 2003
    Location
    Bucharest
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Problem with including php files

    I have this problem:

    I used the following include code:
    PHP Code:
    include 'data.includes/update_distribuitori.php';
    include 
    'data.includes/delete_distribuitori.php'
    If i put these 2 blocks of code in include files PHP won't parse.
    However, if I just copy-paste them in the php file...it works.
    PHP Code:
    //_____________________block 1

    if (isset($_POST['update'])){

    $table2"distribuitori";
    $produs =$_REQUEST['produs_cerut'];
    $nume   =$_REQUEST['nume_prenume'];
    $firma  =$_REQUEST['firma'];
    $telefon=$_REQUEST['telefon'];
    $adresa =$_REQUEST['adresa'];
    $email  =$_REQUEST['email'];
    $coment =$_REQUEST['comentariu'];

    $id $_POST['id'];
    $update = @mysql_query("UPDATE $table2 SET produs_cerut='$produs'
                                                        , nume_prenume='
    $nume'
                                                        , firma='
    $firma'
                                                        , telefon='
    $telefon'
                                                        , adresa='
    $adresa'
                                                        , email='
    $email'
                                                        , comentariu='
    $coment'
                                                        , date=now() 
                                                        WHERE id=
    $id"); 
    if (!
    $update){
        echo 
    '<p class="static9">Exista o problema in update-ul intrarii:'.mysql_error().'</p>';
        exit;
        }
    echo 
    '<p class="static9">Randul cu id-ul <b>'.$id.'</b> a fost updatat</p>';
    }


    //____________________________block 2
    if (isset($_POST['sterge'])){
    $id $_POST['id'];
    $delete = @mysql_query("delete FROM distribuitori where id = '$id'"); 
    if (!
    $delete){
        echo 
    '<p class="static9">Exista o problema in stergerea intrarii:'.mysql_error().'</p>';
        exit;
        }
    echo 
    '<p class="static9">Randul cu id-ul <b>'.$id.'</b> a fost sters din baza de date</p>';


  2. #2
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Did you make sure that the included files began with <?php and ended with ?>?


    If this is not the problem, what do you mean about "did not parse"? What happened? An error message?
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff

  3. #3
    SitePoint Enthusiast mihai001's Avatar
    Join Date
    Sep 2003
    Location
    Bucharest
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    [QUOTE='mmj']Did you make sure that the included files began with <?php and ended with ?>?
    [QUOTE]

    This was it.I didn't now this.
    Thanks a lot


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
  •