tr33b1rd Posted September 19, 2007 Share Posted September 19, 2007 I have a PHP script that processes post data and displays the posted data on a confirmation page. The script works for me 100%. My client will use it and it will work for x amount of time, but then the post variables start to get lost. The success page displays with nothing on it. It seems like the post variables are not being sent to the server. Can anybody give me any reasons why post data would not be sent? I'm thinking it could be everything from the computer (i've had them use different browsers), the router, the modem, the ISP. And I have no idea where to start troubleshooting other than in their office, because that is the only place the problem occurs. Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 19, 2007 Share Posted September 19, 2007 We'd have to see the code. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 19, 2007 Share Posted September 19, 2007 diagnostic it with print_r($_POST) that will let you see if stuff is really getting lost or your script is mishandling the data. I've never heard of POST getting lost as it is transfered, but if it does I'd be interested to see if a pattern exist in the data lossage, or if its just a page timing out. Quote Link to comment Share on other sites More sharing options...
tr33b1rd Posted September 21, 2007 Author Share Posted September 21, 2007 Okay, my client has tested this outside their building themselfs, and it worked 100%. The problem still occurs in their building. I put some error messages in to better troubleshoot and now i'm really confused. The response on failure is "Error 2". Here's the code, I shortened the querys a bit, but there are about 20 post vars going into corrisponding MySQL fields. At this point we are only troubleshooting the INSERT query. if ($_POST['type'] == 'update') { $SQL = "UPDATE partners SET name = '".$_POST['name']."', address = '".$_POST['address']."' WHERE id = ".$_POST['id']; mysql_query($SQL); $id = $_POST['id']; } else if ($_POST['type'] == 'insert') { $SQL = "INSERT INTO partners (id, name, address) VALUES ('','".$_POST['name']."','".$_POST['address']."')"; mysql_query($SQL); $id = mysql_insert_id(); } else { print 'Error 1'; } if ($id != NULL){ header('location:success.php?t='.$_POST['type'].'&id='.$id); } else { print 'Error 2'; } $_POST['type'] is a hidden field to define what query to use. The type post variable is present, otherwise "Error 1" would be returned. $id is not set with: $id = mysql_insert_id(); This is because nothing is inserted into the database. The result is "Error 2". Quote Link to comment Share on other sites More sharing options...
tr33b1rd Posted September 25, 2007 Author Share Posted September 25, 2007 Problem solved. It was thier router. As soon as it was replaced everything started working properly again. Still don't know why or how. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.