bradgrafelman wrote:1. What does it do when you try to add data?
Have you tried the same debugging technique as above - echo'ing mysql_error() if the query fails as well as echo'ing out the query string to visually inspect it?
What's with all of the $post stuff? Why would you duplicate all of this instead of just using $_POST ???
Try echo'ing mysql_affected_rows() to see how many rows it did alter/add.
It's hard to test since the php file is set there wile a .exe sends data to it using URL encoding POST. I used all the post variables so my fellow developers could edit them to something shorter when they feel the need too. I suppose I could just take that all out and use $_POST
Well as you can see I do have allot of dies with error debugging. But even with them and using the mysql_error() I don't get any errors at all. I do however keep getting "Error: IP sent does not match the IP the server connected from." Thats obviously becuse when visiting the page Im not sending any data for it to match the IP field with though 😛
// Validate the otserv's IP Address
if ($_POST["ip"] != $_SERVER["REMOTE_ADDR"]) {
die("ERROR: IP sent does not match the IP the server connected from.");
}
So, I'm lost as to whats going on. Oh and btw I do use (mysql_affected_rows() != -1) or die ("ERROR: ". mysql_error()); at the very bottom of the file. Look at the source at the top maby you missed it before.
Edited I tryed just writing up a simple form to send the required post data.
<FORM action="http://urlicantsay.com/otservdb.php" method="post">
<P>
<LABEL for="ip">ip: </LABEL>
<INPUT type="text" id="ip"><BR>
<LABEL for="servername">servername: </LABEL>
<INPUT type="text" id="servername"><BR>
<LABEL for="server">server: </LABEL>
<INPUT type="text" id="server"><BR>
<LABEL for="ownername">owner name: </LABEL>
<INPUT type="text" id="ownername"><BR>
<LABEL for="motd">motd: </LABEL>
<INPUT type="text" id="motd"><BR>
<INPUT type="submit" value="Send"> <INPUT type="reset">
</P>
</FORM>
And I get the same error as just visiting the page "ERROR: IP sent does not match the IP the server connected from" So this leads me to think that my issue is not anything to do with the db but instead may have something to do with the ip check. I'm not sure why though. I'm gonna run some more tests but I still need help majorly if anyone can come up with answers.