Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Displaying a success message dilemma.

$
0
0

Good evening,

 

I have a contact form which when submitted, gets processed inside my main index.php file and inserts into the database via a separate file for my query, 2 directories above this file.

 

When it's time to insert, we go into this file and after the query, check to see the affected rows.

 

At the minute, I am using a header() redirect to prevent the user being able to submit data multiple times so easily with the warning message which we get. I set a $confirmation message variable in the query script which is supposed to be displayed underneath the form but because of the header() is obviously not displaying.

 

I could always write the query script in the main index.php file but I don't think this is good for the structure and security.

 

My only options I see here are to either redirect them to a 'Message Confirmation' page, set a session variable - but I know for sure it's not good practice to do it this way, or process the form in the index.php file but again the issues mentioned above, I will not be exploring this avenue.

 

Any thoughts?

 

Kind regards,

 

L2c.


Viewing all articles
Browse latest Browse all 13200

Trending Articles