Hi,

I want to make a link on my PHP file that when user clicks on it, it pops up a input box, which then user can type in something, then I could capture the user input and process it in my PHP code.

For example, in my pHP file, I have the user click on a link, a pop up input box displays, then asks: "what is your name?", user type in his/her name, then I capture the string of his/her name.

Can I do something like that without using javascript? TIA

    Make an input on that page hidden (style="display: none") and use the link to change the style (though I suppose you'd need to use Javascript to do that).

    shrug

      🆒

      Even if I avoid MySQL totally and Java as much as possible, in my PHP code,
      maybe this time let Java popup a window of size: wdith x height,
      with that yourpage.php.
      I guess you can select several options for a Java popup window

        perhaps you could put a form into a hidden layer, which is revealed when you click on the link?

          perhaps you could put a form into a hidden layer, which is revealed when you click on the link?

          That's mostly what I suggested, though I couldn't think of a way of doing it without using Javascript to dynamically alter the style.

            what if when the link was clicked, php could insert a .php file ?

            Could that work?

              The only way you could do that is with frames. PHP can not do anything client-side.. it's a server-side scripting language.

                <?php 
                
                include('header.php');
                
                $page = basename($_SERVER['QUERY_STRING']);
                include('header.php');
                
                if(!$page){
                include('pages/main.php');
                } else {
                 if(file_exists('pages/'.$page.'.php')){
                       include('pages/'.$page.'.php');
                 } else {
                       echo('This page does not exist!');
                 } 
                }
                
                include('footer.php');
                ?>
                
                

                Have the header and the footer stay the same, but the content will change if the user clicks the link to bring in the dynamically included page with the form on it??

                  Well, yes, of course. I thought you meant it would change instantly i.e. without a call to another page. My mistake.

                    . . . You were just clarifying it for all of us!

                    : - )

                      Write a Reply...