Hello, I'm just starting out using PHP and am learning to use forms and stuff. I'm using Dreamweaver and DZSoft PHP editor, the problem I'm having is that they both create temporary files when I preview the results; so I don't know what the filename will be and then can't reference the script in the action part of the HTML.

I think I can use one of the $_SERVER globals to get the script name, the trouble with that is that the form is in HTML and not echoed from PHP. Is there an easy answer, or do I need to convert the HTML form into echo?

Hope this made sense!

    You can convert the entire form tag to within an echo statement, or you could embed the PHP, e.g.

    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">

      After some fiddling around with the root directory of my PHP.ini file that worked perfectly!

      Thanks for the help, that's going to speed up my efforts no end.

        Write a Reply...