Results 1 to 10 of 10

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User vlex's Avatar
    Join Date: Jan:2008
    Location: Sofia
    Posts: 340

    php + mysql qyery -

    ,

    :
    Code:
    <html>...
    <form method=post action=bla.php>
    <input type=text name="UN" value="" size=40>
    <br><input type=submit value="submit>
    </form>
    </html>
    bla.php :
    Code:
    <?php
    include 'db.php'; // ,    sql- -      
    $UN = $_POST[UN];
    
    if ($UN != "") {$query_setuser = "UPDATE serverdata SET ilo_user=".$UN;
    } else {$query_setuser = "UPDATE serverdata SET ilo_user=ilouser";};
    
    $result_setuser = mysql_query($query_setuser);
    
    echo $UN;
    //header("Location: ie_index.htm");
    ?>
    , -. , echo. , , echo $UN , , - , . . ilo_user varchar(255), text(255) , . ?

    ,


    P.S. ?!?
    Last edited by vlex; 16th February 2011 at 23:45. Reason: ...

  2. #2
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    :

    UPDATE serverdata SET ilo_user = '".$UN."'
    .. .

    .

  3. #3
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    "".
    $_POST[UN] $_POST['UN']; PHP UN POST. , .
    , isset($_POST['UN']), .
    , if ($UN != "") ?
    4-, : UPDATE serverdata SET ilo_user=ilouser ? ilouser?
    , {$query_setuser = "UPDATE serverdata SET ilo_user=".$UN; - , , ilo_user - ?

    , z0ne , $UN .

  4. #4
    Registered User vlex's Avatar
    Join Date: Jan:2008
    Location: Sofia
    Posts: 340
    :
    $query_setuser = "UPDATE serverdata SET ilo_user=".'$UN' ; -
    $query_setuser = "UPDATE serverdata SET ilo_user=".'".$UN."' ; - ... .$UN.
    $query_setuser = 'UPDATE serverdata SET ilo_user='.'".$UN."' ; - same shit..

    ?

  5. #5
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    , .
    , :
    $query_setuser = "UPDATE serverdata SET ilo_user='" . $UN . "'";
    -:
    $query_setuser = "UPDATE serverdata SET ilo_user='" . mysql_real_escape_string($UN) . "'";

  6. #6
    Registered User vlex's Avatar
    Join Date: Jan:2008
    Location: Sofia
    Posts: 340
    @tedych:
    1) , , - .
    2) isset() - ,
    3)
    4) 'ilouser' 'ilouser'..
    5)

    ---------- 01:01 ---------- 00:59 ----------

    ... , , , . mysql_real_escape_string() .





    ---------- 01:03 ---------- 01:01 ----------

    ?
    "UPDATE serverdata SET ilo_user=' " . mysql_real_escape_string($UN) . " ' ";


  7. #7
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    mysql-a (). PHP.
    , PHP , . , , .

    :
    UPDATE serverdata SET ilo_user='tuk_stojnostta_na_UN'
    mysql .
    , $query_setuser,
    $query_setuser = "UPDATE serverdata SET ilo_user='" . $UN . "'";
    , ' , $UN, , hence . " ' ";
    - mysql_real_escape_string() , . - "" .
    , , , , , , ..

  8. #8
    Banned SHERIFA's Avatar
    Join Date: Jul:2005
    Location: twitter.com/s_SHERIFA_s
    Posts: 1,752

    Cool

    Quote Originally Posted by tedych View Post
    ... , , , , , , ..
    Notepad++ '. .

  9. #9
    Registered User
    Join Date: Jul:2005
    Location: Sofiq
    Posts: 2,798
    Quote Originally Posted by SHERIFA View Post
    Notepad++ '. .
    Komodo Edit, PHP, CSS, HTML, JavaScript, . , .

    Code:
    include 'db.php'; // ,    sql- -      
    $UN = trim(strip_tags($_POST['UN']));
    $UN = mysql_real_escape_string(!empty($UN) ? $UN : 'ilouser');
    
    $result_setuser = mysql_query("UPDATE serverdata SET ilo_user='$UN'");
    
    echo $UN;
    //header("Location: ie_index.htm");
    . WHERE.

  10. #10
    Registered User vlex's Avatar
    Join Date: Jan:2008
    Location: Sofia
    Posts: 340
    . , .

    ,

Posting Permissions

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

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |