At 11:36 PM 1/1/2008, chad qian wrote:
Here is the one PHP page code
<?php
.....
....
......
?>
<html>
<form action=???? method="post" name=form1>
......
 <input type="submit" name="Submit" value="Submit">
</form>

When people click "submit", I want to execute the first php coding part above <html>.
so,form action=what?

You can just leave the action attribute out of the <form> tag and it will be submitted to the same script. Make sure you test that the form was submitted before trying to process it.

<?php
if (isset($_POST['submit'])) {
//
//  do form processing
//
}
// other code
?>
<html>
<body>
<form method="post">
...
<form>
</body>
</html>

Ken 
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to