- Last post
- 3 Responses
Probably a long shot here but...
I have a PHP contact form I've been using for years. I don't know PHP, I just know the form works. Now, I'm using the same form on two pages of the same site. SOMETIMES when the client submits either form, they get the "Invalid data!" echo.
I thinking this maybe both forms are using the same variables. Any idea on what I'd need to change in my code to make each form unique?
Would changing 'step' or 'tkn' make one of the forms unique? Any input would be greatly appreciated!
When the server generates a session and variables, then they're uniquely tied to the browser session of each user; in theory you could run 1000s of sessions with the same variables on the same box, and it should work fine.
That's what I'd be thinking of before I tried to debug this arrangement - you need to isolate exactly when of the 'sometimes' you're getting this error. Echo out the $_SESSION['tkn'] and $_POST['tkn'] values in that section where you throw the error, see why and how they're different:
Above the echo "Invalid data!", see:
Thanks miko... looking into this now
try adding a random number or millisecond time-stamp in a hidden field, and/or some similar form of browser-cache breaker..... send that field with the form....
Does this issue happen with all browsers, or only IE on Winblows?