Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
[PHP] Wont Submit data to DB
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="JayC" data-source="post: 466353" data-attributes="member: 36373"><p>You are using $_POST on your server, which means your form should do a POST request.</p><p></p><p>A few other things I am going to point out:</p><p></p><p>1) Your table should be normalized. You are storing data in here multiple times. What happens if someone changes their username?</p><p></p><p>Table 1: Associated_Users</p><p>[ID] [USERNAME]</p><p></p><p>Here you can change the username column without affecting the other tables</p><p></p><p>Table 2: </p><p>[ID] [PAID_ASSOC_USER] [PAYEE_ASSOC_USER] [MESSAGE]</p><p></p><p></p><p>Sample Records would be:</p><p></p><p>Table 1-</p><p>[1] [Revali]</p><p>[2] [Caitlin]</p><p>[3] [Jess!]</p><p>[4] [Nick]</p><p></p><p>Table 2-</p><p>[1] [1] [3] [20SC and 2T] (Jess paid Revali)</p><p>[2] [2] [3] [20 SC and 2T] (Jess paid Caitlin)</p><p>[3] [2] [4] [4t/5sc] (Nick paid Caitlin)</p><p></p><p>If you change your posts to $_GET[''] and then you do a URL request by doing:</p><p>submit.php?name=Test&message=Testing&payee=Test2</p><p></p><p>Does it add it to the record? My suggestion is to get it working with the GET request, then swap them to POST, if it doesn't work it's an issue with ur form.</p><p></p><p>On your PHP side, I would like to see the full PHP code as well. There is no brackets, which means if you load this page up it's going to execute regardless if you have submitted the form or not, and ur not checking if those values are set or verifying the inputs before you use them. You're not sanitizing them either.</p></blockquote><p></p>
[QUOTE="JayC, post: 466353, member: 36373"] You are using $_POST on your server, which means your form should do a POST request. A few other things I am going to point out: 1) Your table should be normalized. You are storing data in here multiple times. What happens if someone changes their username? Table 1: Associated_Users [ID] [USERNAME] Here you can change the username column without affecting the other tables Table 2: [ID] [PAID_ASSOC_USER] [PAYEE_ASSOC_USER] [MESSAGE] Sample Records would be: Table 1- [1] [Revali] [2] [Caitlin] [3] [Jess!] [4] [Nick] Table 2- [1] [1] [3] [20SC and 2T] (Jess paid Revali) [2] [2] [3] [20 SC and 2T] (Jess paid Caitlin) [3] [2] [4] [4t/5sc] (Nick paid Caitlin) If you change your posts to $_GET[''] and then you do a URL request by doing: submit.php?name=Test&message=Testing&payee=Test2 Does it add it to the record? My suggestion is to get it working with the GET request, then swap them to POST, if it doesn't work it's an issue with ur form. On your PHP side, I would like to see the full PHP code as well. There is no brackets, which means if you load this page up it's going to execute regardless if you have submitted the form or not, and ur not checking if those values are set or verifying the inputs before you use them. You're not sanitizing them either. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
[PHP] Wont Submit data to DB
Top