The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 9 of 9

Thread: Using hidden input type to send php data in the request problem.

  1. #1

    Using hidden input type to send php data in the request problem.

    I have this code in a file called saveClientUtility.php:

    HTML Code:
    <a href="retrieveClientUtility.php">Retrieve</a>
    followed by
    PHP Code:
    <input name="userRet" type="hidden" value="<?php echo ($user); ?>" />
    My problem is when I click on the Retrieve link, the userRet value is not
    getting passed in the request to retrieveClientUtility.php. I have viewed the source of saveClientUtility.php and the value for
    userRet is showing up so I know that value is okay.

    It's when I get to the retrieveClientUtility.php and do a $_POST['userRet'] that I don't see any value. I've also tried using $_REQUEST['userRet'], $_GET['userRet'] and these have no data as well.

    Any help would be appreciated.

    Thanks
    ---------------------------------------
    FlashNewby
    "Not really a newby just thought the name was cool ...."

  2. #2
    4,029
    posts
    home cooking is killing the restaurant industry
    Why don't you just do this:

    PHP Code:
    <a href="retrieveClientUtility.php?userRet=<?php echo (urlencode ($user)); ?>">Retrieve</a>
    That should work
    There are only 10 kinds of people in this world:
    Those that might know ternary, those that do, and those that don't
    Say NO to DRM.

  3. #3
    I did try this and got it to work but was trying to keep the id out of the querystring. I'll use this and keep looking for another way.

    Thanks
    ---------------------------------------
    FlashNewby
    "Not really a newby just thought the name was cool ...."

  4. #4
    use this:
    HTML Code:
    <a href="retrieveClientUtility.php?u=<?php echo (str_rot13 ($user)); ?>">Retrieve</a> 
    in retrieveClientUtility.php use
    PHP Code:
    <?php

    $userid 
    str_rot13 ($_GET['u']);

    ?>

  5. #5
    or use sessions - it's even easier!

  6. #6
    Does str_rot13 do some encrypting or something?

    Ya know fluid_tw0 I thought about using sessions, and your right I will probably use sessions. It's cleaner as well.

    Thanks
    ---------------------------------------
    FlashNewby
    "Not really a newby just thought the name was cool ...."

  7. #7
    str_rot13 - encodes/decodes string

    sessions are the best solution here

  8. #8
    or you can make a form out of it... so you can acces the variable as post data.

    But sessions are good... you can also use it to acces the variable on other pages.

  9. #9
    Great, thanks guys!
    ---------------------------------------
    FlashNewby
    "Not really a newby just thought the name was cool ...."

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012