www.webdeveloper.com
Results 1 to 3 of 3

Thread: Refreshing SESSION variable with an HTML form

Hybrid View

  1. #1
    Join Date
    May 2009
    Posts
    10

    Refreshing SESSION variable with an HTML form

    Hello,

    I have an HTML form at the top of a page called tsearch18.php. This page uses "find" as a session variable. I would like to change the value of the "find" session variable each time a new value is entered into the HTML form. How do I do this?

    Thanks in advance,

    John

    Code:
    <?php
    session_start();
    
    $find = strip_tags($find);
    $find = trim ($find);
    $find = strtolower($find);
    $_SESSION['find'] = $find;
    ?>
    
    
    <div class="searchbox">
      <form action="tsearch18.php" method="post">
      <label>Enter Topic:
      <input type="text" name="find" size="55"/>
      <input type="hidden" name="searching" value="yes" />
      <input type="submit" name="search" value="Search" />
      </label>
      </form>
      </div>

  2. #2
    Join Date
    Nov 2008
    Posts
    2,477
    PHP Code:
    if (isset($_POST['find'])) {
        
    $_SESSION['find'] = strtolower(trim(strip_tags($_POST['find'])));


  3. #3
    Join Date
    Mar 2009
    Location
    Texas
    Posts
    124
    wouldn't the person still have to push submit each time it is changed??? if that is what you are looking for then yeah but if not that is a ajax or javascript function that changes it at will while they type in the number or select it.

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
  •  
HTML5 Development Center



Recent Articles