Re: MySQL Database Connection Question
| From: | Daniel Kullik | Date: | Thu, 08 Jul 2004 14:36:35 +0000 |
| Subject: | Re: MySQL Database Connection Question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-189966@lists.php.net to get a copy of this message | ||
Harlequin wrote:
I have a user registration form that asks new users to register. However, Do I post the MySQLconnection string in the page they are completing or in the later page that the data is posted to, or both...?You ought to tell your registration-page to redirect to itself right after the visitor hit the submit-button of your form. This should to the trick: [code] <form name="form" action="<?php print $_SERVER['PHP_SELF']; ?>" method="post"> [/code] Therefore your script will have to check if something has been posted. [code] if (!empty($_POST) && isset($_POST['button_name'])) {
// perform validation, insert record into database, etc} [/code] .. might do, while 'button_name' is the name of your form's submit-button. Note: You should checkout the thread 'Form Submission' started on July 6th since this is appearently not the best way to check if the user hit the submit-button. Daniel -- WWE e-commerce IT GmbH Eiffestrasse 462, D-20537 Hamburg Tel.: +49-40-2530659-0, Fax: +49-40-2530659-50