I've got a web forum that has three buttons: next, forward, start. They serve as simple navigation through records of a mySQL database. I've also created a text box with php to display which record they are looking at:

<?
function textbox($the_name,$the_value)
{    
$_output = "<input type='text' name='".$the_name."' value='".$the_value."' maxlength='3' size='4'>\n"; return $_output; } //Generate dynamic textbox echo textbox('alpha',$number]); ?>

This works great for display the record but I thought, what if I could have the user enter in a record also to this text box. I've got html forms that do just that using POST method, but it would be nice if they could do it right at that textbox. Any ideas?

    create a form using the post method send the info to another PHP script and update or insert the data in to MYSQL

      Try

      <?
      function textbox($the_name,$the_value)
      {

      $output = "<input type='text' name='".$the_name."' value='".$the_value."' maxlength='3' size='4'>\n";
      return $
      output;
      }
      //Generate dynamic textbox
      echo textbox('alpha',$number]);

      // echo your form here
      // you could even have a function that would display a
      // certain form based on a variable to dispaly an insert or
      // update button or form.

      ?>

        I'm a little bit unclear on what you guys are saying. If the user were to type in a number in this textbox, i'd want that same page/php to display, but it would know that the user was inputting a number so the page would then cater to that input.

        Kinda like a textbox/submit button in html that just posts to that same page and reads in the post, generating the results.

        I can kinda see how a second php script would help. I guess I'll have to dig deeper into php...

          Write a Reply...