SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2000
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is probably a really easy one, but I've been unable to figure it out.

    I have a page that I'm passing parameters to:

    http://www.dvdlard.co.uk/review_vote.php?did=64&pid=1

    The page has a form on it, to add data to a table. The problem I have is when I click on the submit button the URL changes to.

    http://www.dvdlard.co.uk/review_vote...te=Submit+Vote

    This means that I lose the did and pid, but I need these to write the record to the database. The form is using the phpself option:

    <form ACTION="<?php echo($PHP_SELF) ; ?>" METHOD=POST">

    Is there any way I can add these two parameters to the URL that the form creates.

    Thanks


  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    create hidden inputs in the form for each one

    <input type="hidden" name="did" value="<? print $did; ?>">
    <input type="hidden" name="pid" value="<? print $pid; ?>">
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2000
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, that did the trick.

  4. #4
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Alternatively,

    <form ACTION="<?=$PHP_SELF?>?did=<?=$did?>&pid=<?=$pid?>" METHOD=POST>
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference


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
  •