Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2011
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can I make a form without a long url?

    On my website, I use a form to input lots of data, which is then automatically compiled into formatted text when one hits the submit button. The problem is that the URL is about half a page long. How can I reduce its size? Could I make it save as .../output.php without all the &comment=&%sample stuff at the end?

    Here's what the input page looks like (note that it repeats itself 10 times):

    Code:
    <form action="welcome.php" method="get">
    <p><h1>Site 1</h1></p>
    Website: <input type="text" name="site" />
    Privacy color:
    <select name="pcolor"><option value="#00ff00">Green</option><option value="#ffff00">Yellow</option><option value="#ff0000">Red</option></select>
    Privacy rating: <select name="privacy"><option value="Excellent">Excellent</option><option value="Excellent, NCT">NCT</option><option value="Lacking">Lacking</option><option value="N/A">Web forgery</option></select>
    Privacy Policy: <select name="PP"><option value="Adequate">Adequate</option><option value="Lacking">Inadequate</option><option value="Nonexistent">Nonexistent</option></select>
    PP color: <select name="ppcolor"><option value="#00ff00">Green</option><option value="#ffff00">Yellow</option><option value="#ff0000">Red</option></select>
    Privacy comments: <input type="text" name="pcomments" />
    # of trackers: <input type="text" name="#trackers" />
    Cookies: <select name="cookies" /><option value="yes">yes</option><option value="none">none</option></select>
    Third party cookies: <select name="3cookies" /><option value="yes">yes</option><option value="none">none</option></select>
    Viruses: <input type="text" name="vcomment" />
    Virus color: <select name="vcolor"><option value="#00ff00">Green</option><option value="#ffff00">Yellow</option><option value="#ff0000">Red</option></select>
    Subjective content: (enter applicable tags, put : after tags if any): <input type="text" name="stags" />
    Subjective content color: <select name="scolor"><option value="#00ff00">Green</option><option value="#ffff00">Yellow</option></select>
    Subjective content comment: <input type="text" name="scomment" />
    <p><h1>Site 2</h1></p>
    Website: <input type="text" name="site2" />
    Privacy color:
    <select name="pcolor2"><option value="#00ff00">Green</option><option value="#ffff00">Yellow</option><option value="#ff0000">Red</option></select>
    Privacy rating: <select name="privacy2"><option value="Excellent">Excellent</option><option value="Excellent, NCT">NCT</option><option value="Lacking">Lacking</option><option value="N/A">Web forgery</option></select>
    Privacy Policy: <select name="PP2"><option value="Adequate">Adequate</option><option value="Lacking">Inadequate</option><option value="Nonexistent">Nonexistent</option></select>
    PP color: <select name="ppcolor2"><option value="#00ff00">Green</option><option value="#ffff00">Yellow</option><option value="#ff0000">Red</option></select>
    Privacy comments: <input type="text" name="pcomments2" />
    # of trackers: <input type="text" name="#trackers2" />
    Cookies: <select name="cookies2" /><option value="yes">yes</option><option value="none">none</option></select>
    Third party cookies: <select name="3cookies2" /><option value="yes">yes</option><option value="none">none</option></select>
    Viruses: <input type="text" name="vcomment2" />
    Virus color: <select name="vcolor2"><option value="#00ff00">Green</option><option value="#ffff00">Yellow</option><option value="#ff0000">Red</option></select>
    Subjective content: (enter applicable tags, put : after tags if any): <input type="text" name="stags2" />
    Subjective content color: <select name="scolor2"><option value="#00ff00">Green</option><option value="#ffff00">Yellow</option></select>
    Subjective content comment: <input type="text" name="scomment2" />
    ...and it goes on another 8 times.
    <input type="submit">
    </form>
    and the output page:
    Code:
    <html>
    <head>
    <style type="text/css">
    p.green
    {
    color:green;
    left:20px
    }
    </style>
    </head>
    <blockquote> <p> <span style="font-size: 12pt;"><?php echo $_GET["site"]; ?></span></blockquote></p><p><b>Privacy:</b> <font color="<?php echo $_GET["pcolor"]; ?>"><?php echo $_GET["privacy"]; ?></font>.</p><ul><li>Trackers-<font color="<?php echo $_GET["pcolor"]; ?>"><?php echo $_GET["#trackers"]; ?></font>.</li><li>Privacy Policy-<font color="<?php echo $_GET["ppcolor"]; ?>"><?php echo $_GET["PP"]; ?></font>.</li><li>Cookies: <?php echo $_GET["cookies"]; ?>.</li><li>Third party cookies: <?php echo $_GET["3cookies"]; ?>.</li></ul><?php echo $_GET["pcomments"]; ?><p><b>Viruses:</b> <font color="<?php echo $_GET["vcolor"]; ?>"><?php echo $_GET["vcomment"]; ?></font>.</p><p><b>Subjective content:</b> <font color="<?php echo $_GET["scolor"]; ?>"><?php echo $_GET["stags"]; ?><?php echo $_GET["scomment"]; ?></font>.</p>
    <blockquote> <p> <span style="font-size: 12pt;"><?php echo $_GET["site2"]; ?></span></blockquote></p> <p><b>Privacy:</b> <font color="<?php echo $_GET["pcolor2"]; ?>"><?php echo $_GET["privacy2"]; ?></font>.</p><ul><li>Trackers-<font color="<?php echo $_GET["pcolor2"]; ?>"><?php echo $_GET["#trackers2"]; ?></font>.</li><li>Privacy Policy-<font color="<?php echo $_GET["ppcolor2"]; ?>"><?php echo $_GET["PP2"]; ?></font>.</li><li>Cookies: <?php echo $_GET["cookies2"]; ?>.</li><li>Third party cookies: <?php echo $_GET["3cookies2"]; ?>.</li></ul><?php echo $_GET["pcomments2"]; ?><p><b>Viruses:</b> <font color="<?php echo $_GET["vcolor2"]; ?>"><?php echo $_GET["vcomment2"]; ?></font>.</p><p><b>Subjective content:</b> <font color="<?php echo $_GET["scolor2"]; ?>"><?php echo $_GET["stags2"]; ?><?php echo $_GET["scomment2"]; ?></font>.</p>
    <blockquote> <p> <span style="font-size: 12pt;"><?php echo $_GET["site3"]; ?></span></blockquote></p> <p><b>Privacy:</b> <font color="<?php echo $_GET["pcolor3"]; ?>"><?php echo $_GET["privacy3"]; ?></font>.</p><ul><li>Trackers-<font color="<?php echo $_GET["pcolor3"]; ?>"><?php echo $_GET["#trackers3"]; ?></font>.</li><li>Privacy Policy-<font color="<?php echo $_GET["ppcolor3"]; ?>"><?php echo $_GET["PP3"]; ?></font>.</li><li>Cookies: <?php echo $_GET["cookies3"]; ?>.</li><li>Third party cookies: <?php echo $_GET["3cookies3"]; ?>.</li></ul><?php echo $_GET["pcomments3"]; ?><p><b>Viruses:</b> <font color="<?php echo $_GET["vcolor3"]; ?>"><?php echo $_GET["vcomment3"]; ?></font>.</p><p><b>Subjective content:</b> <font color="<?php echo $_GET["scolor3"]; ?>"><?php echo $_GET["stags3"]; ?><?php echo $_GET["scomment3"]; ?></font>.</p>
    <blockquote> <p> <span style="font-size: 12pt;"><?php echo $_GET["site4"]; ?></span></blockquote></p> <p><b>Privacy:</b> <font color="<?php echo $_GET["pcolor4"]; ?>"><?php echo $_GET["privacy4"]; ?></font>.</p><ul><li>Trackers-<font color="<?php echo $_GET["pcolor4"]; ?>"><?php echo $_GET["#trackers4"]; ?></font>.</li><li>Privacy Policy-<font color="<?php echo $_GET["ppcolor4"]; ?>"><?php echo $_GET["PP4"]; ?></font>.</li><li>Cookies: <?php echo $_GET["cookies4"]; ?>.</li><li>Third party cookies: <?php echo $_GET["3cookies4"]; ?>.</li></ul><?php echo $_GET["pcomments4"]; ?><p><b>Viruses:</b> <font color="<?php echo $_GET["vcolor4"]; ?>"><?php echo $_GET["vcomment4"]; ?></font>.</p><p><b>Subjective content:</b> <font color="<?php echo $_GET["scolor4"]; ?>"><?php echo $_GET["stags4"]; ?><?php echo $_GET["scomment4"]; ?></font>.</p>
    <blockquote> <p> <span style="font-size: 12pt;"><?php echo $_GET["site5"]; ?></span></blockquote></p> <p><b>Privacy:</b> <font color="<?php echo $_GET["pcolor5"]; ?>"><?php echo $_GET["privacy5"]; ?></font>.</p><ul><li>Trackers-<font color="<?php echo $_GET["pcolor5"]; ?>"><?php echo $_GET["#trackers5"]; ?></font>.</li><li>Privacy Policy-<font color="<?php echo $_GET["ppcolor5"]; ?>"><?php echo $_GET["PP5"]; ?></font>.</li><li>Cookies: <?php echo $_GET["cookies5"]; ?>.</li><li>Third party cookies: <?php echo $_GET["3cookies5"]; ?>.</li></ul><?php echo $_GET["pcomments5"]; ?><p><b>Viruses:</b> <font color="<?php echo $_GET["vcolor5"]; ?>"><?php echo $_GET["vcomment5"]; ?></font>.</p><p><b>Subjective content:</b> <font color="<?php echo $_GET["scolor5"]; ?>"><?php echo $_GET["stags5"]; ?><?php echo $_GET["scomment5"]; ?></font>.</p>
    <blockquote> <p> <span style="font-size: 12pt;"><?php echo $_GET["site6"]; ?></span></blockquote></p> <p><b>Privacy:</b> <font color="<?php echo $_GET["pcolor6"]; ?>"><?php echo $_GET["privacy6"]; ?></font>.</p><ul><li>Trackers-<font color="<?php echo $_GET["pcolor6"]; ?>"><?php echo $_GET["#trackers6"]; ?></font>.</li><li>Privacy Policy-<font color="<?php echo $_GET["ppcolor6"]; ?>"><?php echo $_GET["PP6"]; ?></font>.</li><li>Cookies: <?php echo $_GET["cookies6"]; ?>.</li><li>Third party cookies: <?php echo $_GET["3cookies6"]; ?>.</li></ul><?php echo $_GET["pcomments6"]; ?><p><b>Viruses:</b> <font color="<?php echo $_GET["vcolor6"]; ?>"><?php echo $_GET["vcomment6"]; ?></font>.</p><p><b>Subjective content:</b> <font color="<?php echo $_GET["scolor6"]; ?>"><?php echo $_GET["stags6"]; ?><?php echo $_GET["scomment6"]; ?></font>.</p>
    <blockquote> <p> <span style="font-size: 12pt;"><?php echo $_GET["site7"]; ?></span></blockquote></p> <p><b>Privacy:</b> <font color="<?php echo $_GET["pcolor7"]; ?>"><?php echo $_GET["privacy7"]; ?></font>.</p><ul><li>Trackers-<font color="<?php echo $_GET["pcolor7"]; ?>"><?php echo $_GET["#trackers7"]; ?></font>.</li><li>Privacy Policy-<font color="<?php echo $_GET["ppcolor7"]; ?>"><?php echo $_GET["PP7"]; ?></font>.</li><li>Cookies: <?php echo $_GET["cookies7"]; ?>.</li><li>Third party cookies: <?php echo $_GET["3cookies7"]; ?>.</li></ul><?php echo $_GET["pcomments7"]; ?><p><b>Viruses:</b> <font color="<?php echo $_GET["vcolor7"]; ?>"><?php echo $_GET["vcomment7"]; ?></font>.</p><p><b>Subjective content:</b> <font color="<?php echo $_GET["scolor7"]; ?>"><?php echo $_GET["stags7"]; ?><?php echo $_GET["scomment7"]; ?></font>.</p>
    <blockquote> <p> <span style="font-size: 12pt;"><?php echo $_GET["site8"]; ?></span></blockquote></p> <p><b>Privacy:</b> <font color="<?php echo $_GET["pcolor8"]; ?>"><?php echo $_GET["privacy8"]; ?></font>.</p><ul><li>Trackers-<font color="<?php echo $_GET["pcolor8"]; ?>"><?php echo $_GET["#trackers8"]; ?></font>.</li><li>Privacy Policy-<font color="<?php echo $_GET["ppcolor8"]; ?>"><?php echo $_GET["PP8"]; ?></font>.</li><li>Cookies: <?php echo $_GET["cookies8"]; ?>.</li><li>Third party cookies: <?php echo $_GET["3cookies8"]; ?>.</li></ul><?php echo $_GET["pcomments8"]; ?><p><b>Viruses:</b> <font color="<?php echo $_GET["vcolor8"]; ?>"><?php echo $_GET["vcomment8"]; ?></font>.</p><p><b>Subjective content:</b> <font color="<?php echo $_GET["scolor8"]; ?>"><?php echo $_GET["stags8"]; ?><?php echo $_GET["scomment8"]; ?></font>.</p>
    <blockquote> <p> <span style="font-size: 12pt;"><?php echo $_GET["site9"]; ?></span></blockquote></p> <p><b>Privacy:</b> <font color="<?php echo $_GET["pcolor9"]; ?>"><?php echo $_GET["privacy9"]; ?></font>.</p><ul><li>Trackers-<font color="<?php echo $_GET["pcolor9"]; ?>"><?php echo $_GET["#trackers9"]; ?></font>.</li><li>Privacy Policy-<font color="<?php echo $_GET["ppcolor9"]; ?>"><?php echo $_GET["PP9"]; ?></font>.</li><li>Cookies: <?php echo $_GET["cookies9"]; ?>.</li><li>Third party cookies: <?php echo $_GET["3cookies9"]; ?>.</li></ul><?php echo $_GET["pcomments9"]; ?><p><b>Viruses:</b> <font color="<?php echo $_GET["vcolor9"]; ?>"><?php echo $_GET["vcomment9"]; ?></font>.</p><p><b>Subjective content:</b> <font color="<?php echo $_GET["scolor9"]; ?>"><?php echo $_GET["stags9"]; ?><?php echo $_GET["scomment9"]; ?></font>.</p>
    <blockquote> <p> <span style="font-size: 12pt;"><?php echo $_GET["site10"]; ?></span></blockquote></p> <p><b>Privacy:</b> <font color="<?php echo $_GET["pcolor10"]; ?>"><?php echo $_GET["privacy10"]; ?></font>.</p><ul><li>Trackers-<font color="<?php echo $_GET["pcolor10"]; ?>"><?php echo $_GET["#trackers10"]; ?></font>.</li><li>Privacy Policy-<font color="<?php echo $_GET["ppcolor10"]; ?>"><?php echo $_GET["PP10"]; ?></font>.</li><li>Cookies: <?php echo $_GET["cookies10"]; ?>.</li><li>Third party cookies: <?php echo $_GET["3cookies10"]; ?>.</li></ul><?php echo $_GET["pcomments10"]; ?><p><b>Viruses:</b> <font color="<?php echo $_GET["vcolor10"]; ?>"><?php echo $_GET["vcomment10"]; ?></font>.</p><p><b>Subjective content:</b> <font color="<?php echo $_GET["scolor10"]; ?>"><?php echo $_GET["stags10"]; ?><?php echo $_GET["scomment10"]; ?></font>.</p>
    
    
    <h1><p>A list of sites rated for future reference:</p></h1>
    <?php echo $_GET["site"]; ?><br />
    <?php echo $_GET["site2"]; ?><br />
    <?php echo $_GET["site3"]; ?><br />
    <?php echo $_GET["site4"]; ?><br />
    <?php echo $_GET["site5"]; ?><br />
    <?php echo $_GET["site6"]; ?><br />
    <?php echo $_GET["site7"]; ?><br />
    <?php echo $_GET["site8"]; ?><br />
    <?php echo $_GET["site9"]; ?><br />
    <?php echo $_GET["site10"]; ?><br />
    </body>
    </html>
    Please leave only *helpful* posts-thanks.

  • #2
    New Coder
    Join Date
    Apr 2011
    Posts
    24
    Thanks
    1
    Thanked 1 Time in 1 Post
    Why don't you use POST method instead of GET, if you don't wish having long URL's?

  • #3
    New Coder
    Join Date
    Jan 2011
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you for the help. I did that (replacing GET with POST) and it worked.


  •  

    Posting Permissions

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