SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2006
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question $_GET variable display incomplete string

    Hello Sitepoint friends,

    Below is the PHP script that the $_GET['t'] will echo as "NOT SET" if the textarea string is too long, if it's shorter then only it will display. This problem happened ONLY in my remote hosting server. BUT the text was printed out completely & without any problem in my localhost. Is there any php.ini cofiguration that deals with the $_GET variable ? Thanks. I know there's one for $_POST like post_max_size in php.ini

    PHP Code:
    <?php

    if(isset($_GET['t']))
      echo 
    $_GET['t'];
    else
      echo 
    "NOT SET";

    ?>

    <form action="<?php echo $_SERVER["REQUEST_URI"?>" method="GET">
    <textarea name="t" cols="20" rows="30">
    We are different
    With JobsCentral, you are not just advertising in one job portal but within an expanding network of 17+ affiliate career portals. What you get is a distinct database largely composed of graduates from local universities, polytechnics and tertiary institutions.


    Effective and easy to use, JobsCentral is always developing cutting-edge technology to improve the online hiring process and augment our broad suite of recruitment and branding solutions. Our advertising towards jobseekers is aggressive and innovative; we employ print, online and mobile media to reach out to jobseekers and reward employers with the brand equity they deserve.


    Providing more than just a job portal, we enhance user experience with our JobsCentral Community. Developed as an interactive site that attracts usage even when jobseekers are not looking for a job, it provides a platform for JobsCentral members to come together to share and exchange views. In addition, JobsCentral Community is also a rich source of comprehensive and relevant career-centric information. 


    In short, no other job portal offers effective recruitment channels and robust content like JobsCentral.
    </textarea>

    <input type="submit" />
    </form>
    Or any ideas what is the cause of this effect ?

    Thanks for reading until this end point
    QwerQ - Natural Language is the Command
    QwerQ.com

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,069
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    If there is a setting for the maximum allowed length of the query string ($_GET), it's in the actual web server like Apache or IIS, not in PHP.

    The maximum recommended length however is 255 characters because some older proxy servers cannot handle more than that.

    For lots of data consider using $_POST instead.
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2006
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ScallioXTX View Post
    For lots of data consider using $_POST instead.
    Thanks Boss, I follow your order, then it works
    QwerQ - Natural Language is the Command
    QwerQ.com

  4. #4
    SitePoint Member
    Join Date
    Dec 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    w3c recommends that GET request should only be used for information retrieval, POST for sending info "as there name implies"
    * imagine if some one put a link like "http://www.yousite.com?t=alotOfcharacters...." in any website "Digg for example" then search engines will open it and so this data will be submitted whenever a search engineS parse this site with the such links!!!
    * You are also submitting a 'textarea'! which is a big string , so there is a cross browser , servers compatibility issue because each one has a max length ,different specification than the other see :
    http://www.boutell.com/newfaq/misc/urllength.html

  5. #5
    SitePoint Member
    Join Date
    Dec 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by 3DVector View Post
    w3c recommends that GET request should only be used for information retrieval, POST for sending info "as there name implies"
    * imagine if some one put a link like "http://www.yousite.com?t=alotOfcharacters...." in any website "Digg for example" then search engines will open it and so this data will be submitted whenever a search engineS parse this site with the such links!!!
    * You are also submitting a 'textarea'! which is a big string , so there is a cross browser , servers compatibility issue because each one has a max length ,different specification than the other see :
    http://www.boutell.com/newfaq/misc/urllength.html
    don't forget the horrible CSRF "Cross-site request forgery"!
    see:
    http://en.wikipedia.org/wiki/Cross-site_request_forgery


Tags for this Thread

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
  •