Page 1 of 2 12 LastLast
Results 1 to 25 of 36

Thread: $_GET

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    It's not Jim Beam! XcArm's Avatar
    Join Date: Aug:2008
    Location:
    Posts: 118

    $_GET

    , POST GE. online POST , 10- ot url. . url-, G - .
    GET, url-. GET url-to, , url url?


    online users:

    <?php
    require ('/online_results.php');





    function online()
    {
    if(isset($_SESSION['user']))
    {

    $online=new sitesession();
    $online->connect();
    $query="select uid,user,name,namelast,city,university,m ail from user where status='y'";
    $result=mysql_query($query);
    if($result)
    {

    $row=mysql_fetch_array($result, MYSQL_ASSOC);
    echo '<div style="position:absolute;margin-left:10px;margin-top:250px;border:0px solid #000000;height:auto;width:642px;">';
    $i=1;
    $h=1;
    $w=400;
    $l=260;

    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    if($l==1060)
    {
    $l=260;
    $h=$h+150;
    }
    printf('<div style="position:absolute;margin-left:'.$l.'px;padding:0px;margin-top:'.$h.'px;width:'.$w.'px;border:1px solid #211f1f;background-color:#2e2d2d;height:150px;"><table border=0>
    <tr><td>&nbsp&nbsp&nbsp</td><td>&nbsp&nbsp&nbsp</td><td>&nbsp&nbsp&nbsp</td><td>&nbsp&nbsp&nbsp</td><td>&nbsp&nbsp&nbsp</td></tr>
    <tr><td>ID :</td><td>&nbsp&nbsp&nbsp</td><td>%s</td>
    <td>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</td>
    <td>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp& nbsp&nbsp:</td>
    <td>&nbsp&nbsp&nbsp</td><td><center>%s</center></td></tr><tr><td>&nbsp&nbsp&nbsp&nbsp&nbsp&nbs p</td>
    <td>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</td><td>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</td><td>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</td>
    <td>&nbsp&nbsp&nbsp E-mail: </td><td>&nbsp&nbsp&nbsp</td><td>%s</td></tr>
    <tr><td>&nbsp&nbsp&nbsp</td><td>&nbsp&nbsp&nbsp</td><td>&nbsp&nbsp&nbsp</td><td>&nbsp&nbsp&nbsp</td><td>&nbsp&nbsp&nbsp</td></tr>
    <tr><td>&nbsp&nbsp&nbsp</td><td>&nbsp&nbsp&nbsp</td><td>&nbsp&nbsp&nbsp</td><td colspan=5><center> </center></td><td>&nbsp&nbsp&nbsp</td><td>&nbsp&nbsp&nbsp</td><td>&nbsp&nbsp&nbsp</td></tr></table></div>', $row["uid"], $row["user"], $row["mail"]);

    $l=$l+400;

    $i++;

    }


    mysql_free_result($result);
    echo '</div>';
    }

    }
    else if(!isset($_SESSION['user']))
    {
    echo '<div style="position:absolute;margin-left:0px;margin-top:0px;"> !</div>';

    }
    }
    ?>
    2 . GET ?
    Last edited by XcArm; 24th June 2010 at 06:44.

  2. #2
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    , . .
    , <form method="get" ... .
    url $page = $_GET['page'], .
    ( , ) LIMIT $page,20

    $page = 0;
    if (isset($_GET['page'])) {
    $page = (integer)$_GET['page'];
    $page--;
    if ($page<0) $page = 0;
    }

  3. #3
    Nuclear's Avatar
    Join Date: Sep:2004
    Location: , . ()
    Posts: 3,352
    : http ://hardwarebg.com/forum/showthread.php?p=2402389
    url p, 2402389
    ( showthread.php ) $count=$_GET['p'];
    , , p , a form. &
    : http ://hardwarebg.com/forum/showthread.php?p=2402389&t=123456
    . HWBG !

  4. #4
    It's not Jim Beam! XcArm's Avatar
    Join Date: Aug:2008
    Location:
    Posts: 118
    , , GET ?


    tedych: . sql injection-, .

    Nuclear: , .
    Last edited by XcArm; 24th June 2010 at 12:04.

  5. #5
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    ( ) GET ? - URL-o, , Nuclear.
    EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
    Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|

  6. #6
    It's not Jim Beam! XcArm's Avatar
    Join Date: Aug:2008
    Location:
    Posts: 118
    online.php url-to, localhost/online.php url- . GET.., nuclear GET , GET . :

    $query="select uid,user from user";
    $result=mysql_query($query);
    if(!$result)
    {
    echo 'Error'.mysql_error();
    }
    $num=mysql_num_rows($result);
    $array=mysql_fetch_array($result,MYSQL_A SSOC);
    for(i=0;$i<=$num;$i++)
    {
    echo stripslashes($array['uid']).' '.stripslashes($array['user']);
    }

    , post get, GET ....
    GET..



    , array $_GET :
    stripslashes($_GET($array['user'])); GET...

    .: , , , GET . , GET ...
    Last edited by XcArm; 24th June 2010 at 12:48.

  7. #7
    Nuclear's Avatar
    Join Date: Sep:2004
    Location: , . ()
    Posts: 3,352
    Ka GET ?
    , mysql GET ?
    - user. get

    $user=stripslashes($array['user']);

    /, .
    :
    echo "<a href=\"http://yoursite.com/checkdata.php?username=$user></a>".
    GET checkdata.php
    $user=$_GET['username'].
    Last edited by Nuclear; 24th June 2010 at 14:22.
    . HWBG !

  8. #8
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    , , (checkdata.php) URL, , . JavaScript, - .

    . GET , , .

    ..
    .
    POST GET , ( HTTP ()) .
    Last edited by Bombera; 24th June 2010 at 14:32.
    EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
    Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|

  9. #9
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    , . GET/POST .
    , -, .

  10. #10
    It's not Jim Beam! XcArm's Avatar
    Join Date: Aug:2008
    Location:
    Posts: 118
    .php :

    $connect=mysql_pconnect('localhost','use r','pass') or die(echo 'Error'.mysql_error());
    $db=mysql_select_db('site');

    $query="select uid,user from user";
    $result=mysql_query($query);
    if(!$result)
    {
    echo 'Error'.mysql_error();
    }
    $num=mysql_num_rows($result);
    $array=mysql_fetch_array($result,MYSQL_A SSOC);
    for(i=0;$i<=$num;$i++)
    {
    echo stripslashes($array['uid']).' '.stripslashes($array['user']);
    }
    , , url. , , POST, GET .



    .: , POST, . , url. get ...

    , Help. , get , - localhost/online.php localhost/online.php?t=...
    .. GET .
    Last edited by XcArm; 24th June 2010 at 19:53.

  11. #11
    Nuclear's Avatar
    Join Date: Sep:2004
    Location: , . ()
    Posts: 3,352
    :
    ?
    ?
    POST GET . GET , . T.e, o .
    page ($_GET['page']). 50 , (page=0) 1 50, - 51 100 ..
    page , .



    Code:
    $i=0;
    $page=$_GET['page'];
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    if ($i<($page+1)*20 && $i>$page*20)  printf("ID: %s  Name: %s", $row["id"], $row["name"]);
    $i++;
    }
    / . - , . , , online.php? ( page=0, set- Page), nline.php?page=1 ... .

    , - ( ($result) $i ).
    Last edited by Nuclear; 24th June 2010 at 20:14.
    . HWBG !

  12. #12
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    , , $_GET['page'] SQL , 20 ( 50) , , mysql LIMIT $page, 50.
    GET , POST .. , .

    " get ..."
    - A, "" .

    " get " . "get ".
    get , URL. POST , POST Http .
    Last edited by tedych; 24th June 2010 at 20:36.

  13. #13
    It's not Jim Beam! XcArm's Avatar
    Join Date: Aug:2008
    Location:
    Posts: 118
    , $_GET['page'] - post , , url e get $_get['page']. post get, online.php online.php?page=1 online.php?page=10, url- online.php , , !

    , Url- ? get url

  14. #14
    Registered User
    Join Date: Feb:2006
    Location: Plovdiv
    Posts: 392
    , . " "

  15. #15
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    , , GET/POST , , .
    , .
    , , , , , , , .

  16. #16
    It's not Jim Beam! XcArm's Avatar
    Join Date: Aug:2008
    Location:
    Posts: 118
    ,

  17. #17
    a.k.a. Bibi Flower's Avatar
    Join Date: Aug:2006
    Location: Sofia, Bulgaria
    Posts: 562
    , ...

    :
    : users.php
    SQL- , , .
    , , , .

    :
    , x y. x y , . $x = 5; $y = 9; SQL- limit, $x, $y.
    .

    :
    . $x = $_GET['a']; $y = $_GET['b'];. .
    users.php?a=5&b=9.
    , , , , , , .. , .

    .
    - .
    ...
    Last edited by Flower; 28th June 2010 at 01:15.

  18. #18
    ! vbTheKing's Avatar
    Join Date: Sep:2003
    Location:
    Posts: 4,138
    Quote Originally Posted by Flower View Post
    : users.php
    SQL- ...
    , POST GET ?

    ...

    XcArm, , . .
    ''? * *
    - !
    ...

  19. #19
    It's not Jim Beam! XcArm's Avatar
    Join Date: Aug:2008
    Location:
    Posts: 118
    Flower: 10x , GET ... GET, url

    vbTheKing: ..... , ... POST GET php, ! MYSQL?? mysql-a, , ??


    .: , , GET (. html $_GET ), $_GET['page'] . GET GET , html ...., , GET, GET (. select user,city from user where user like 'pesho'; - Url - localhost/online.php?user=pesho&&city=ruse).... , ..
    , url-to, ...

    ? , page $_GET , GET? ... ...
    Last edited by XcArm; 28th June 2010 at 13:58.

  20. #20
    a.k.a. Bibi Flower's Avatar
    Join Date: Aug:2006
    Location: Sofia, Bulgaria
    Posts: 562
    !
    "GET ".
    .
    / .
    , web-.

    :
    1. http- - ( ).
    - .
    , - . : , , , .
    - , . , , , ..
    GET POST , . , .

    2. - . , . ( , ) - . php. , , . , , , . php , GET POST php- $_GET $_POST. php-.

    3. php -. $_GET $_POST . , , " -". , .
    php "" $_GET $_POST . , , , .
    , , php - , web-, ... . SQL- MySQL. , , php . . . -. , . GET POST - . " 5 9" .
    php . , , , , $_GET , .

    , php . html. - . .
    . , . .
    Last edited by Flower; 28th June 2010 at 15:02.

  21. #21
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    , - , ?!
    : , .
    , , . , , GET/POST/Mysql, N- ?

    vbTheKing , . , ...
    . , , , , .

    " GET"
    - . .

    " url "
    - url ? url_encode, url_decode ? ?!

    " MYSQL?? "
    - . "" , - , .

    " mysql-a, , ??"
    - ? . GET , ?? , web request, GET/POST, (SQL ). GET/POST mysql .
    .

  22. #22
    It's not Jim Beam! XcArm's Avatar
    Join Date: Aug:2008
    Location:
    Posts: 118
    , , - get post , localhost/online.php?user=pesho&&city=ruse :
    connect=mysql_pconnect('localhost','use r','pass') or die(echo 'Error'.mysql_error());
    $db=mysql_select_db('site');

    $query="select uid,user from user";
    $result=mysql_query($query);
    if(!$result)
    {
    echo 'Error'.mysql_error();
    }
    $num=mysql_num_rows($result);
    $array=mysql_fetch_array($result,MYSQL_A SSOC);
    for(i=0;$i<=$num;$i++)
    {
    echo stripslashes($array['uid']).' '.stripslashes($array['user']);
    }


    ---------- 14:16 ---------- 14:07 ----------

    , , , http request- url, , url, ,
    GET ...

  23. #23
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    , .

    " http request- ur"
    " url, ,"
    " GET ... "


  24. #24
    It's not Jim Beam! XcArm's Avatar
    Join Date: Aug:2008
    Location:
    Posts: 118
    , , ...., ? get !!!!!!! ,

    ---------- 14:32 ---------- 14:27 ----------

    Flower: ,
    3. php -. $_GET $_POST . , , " -". , .
    php "" $_GET $_POST . , , , .
    get post, get? , ?

  25. #25
    Nuclear's Avatar
    Join Date: Sep:2004
    Location: , . ()
    Posts: 3,352
    Quote Originally Posted by XcArm View Post
    get post, get? , ?
    get .
    - , get .
    - redirect php:
    Code:
    $array=mysql_fetch_array($result);
    $id=stripslashes($array['uid'])
    $user=stripslashes($array['user']);
    header("location:test.php?user=$id&name=$user");
    - test.php, test.php?user=3&name=pesho .
    - get ( ).
    . HWBG !

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 |