Hide the form action value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vihanay
    New Member
    • May 2007
    • 1

    Hide the form action value

    Sample code:
    [CODE=html]
    <form method="POST" enctype="multip art/form-data" action="process .php?id=$id&nam e=$name" >";
    //code
    <input type="file" name="text" size="70">";
    </form>
    [/CODE]

    I want to hide the "action" value, so when user see my source code from the page, they won't see the next page target.
    Is it possible?

    Thx.
    Last edited by pbmods; May 26 '07, 02:52 PM. Reason: Changed code language. Thanks for using CODE tags!
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, vihanay. Welcome to TSDN!

    Originally posted by vihanay
    I want to hide the "action" value, so when user see my source code from the page, they won't see the next page target.
    Is it possible?
    The direct answer to your question is, "No. Anything you send to the browser is visible to the User."

    The indirect answer to your question is, "If you save variables in the session instead of putting them in URLs, you don't have to send them to the browser."

    Comment

    • gm04030276
      New Member
      • Nov 2006
      • 17

      #3
      i'm not entirely up to speed on how sessions work yet myself but i would assume something like this:

      instead of having to send the information through the url as you are doing, keep it stored on the server in a session. put the variables $id and $name in the session like so ( i think! ):
      $_SESSION['id'] = their id;
      $_SESSION['name'] = their name;

      then when you go the the form handling page you can access them through the session variable names.

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        Originally posted by gm04030276
        then when you go the the form handling page you can access them through the session variable names.
        You got it nailed.

        Here's some more info about sessions in PHP:

        Comment

        Working...