SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to make form PHP_SELF into the same page?

    I have code to submit a form like this:
    HTML Code:
    <form action="<?php echo $PHP_SELF; ?>" method="post" >
    If the page was called with URL thisform.php?ID=1 how do I get the ID in the action?

  2. #2
    SitePoint Enthusiast Linkoroo's Avatar
    Join Date
    Jul 2009
    Location
    linkoroo.com
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think you can but there's a solution.

    You could have a <input type='hidden' name='id' value="<? echo($_REQUEST['id']);?>" />

    With that when you post, it you'll have a "id" attribute with your form.

    Hope that helps!

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2009
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php echo $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']; ?>


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
  •