Alright so I've been pouring over this code for 16+ hours and I cannot find where the issue is. Before you say anything- I know I'm prone to SQL injection and I need to setup more prepared statements; once I get the code working my next step is to work on those issues. I also know I need to add the TRUE and 303 parameter to the Header call- I'm just trying to get it running at this point.
The code worked beautifully until I began working on eliminating form submission on refresh and adding redirects at the end.
The page that is having the problem is called updateorder.php and here is a Pastie link for it: http://pastie.org/9188291
I created a page called Issue.php to funnel everyone off the page and to eliminate the possibility of any of the html code outputting. That did not help. I removed the ?> PHP closing tag from the end since all the code is PHP and eliminate any white space possibility. That didn't help either.
The page before this has several submit buttons. This page looks at what button was pushed and runs the code when it meets the conditions of the IF.
- When I submit the form using the DeleteThisOrder button, it operates perfectly.
- When I submit the form using the PrintOnly button, it operates perfectly.
- When I submit the form using the UpdateOnly button, but $ThisStatus <>1, it runs perfectly.
Here are the problems:
If I hit the UpdateOnly button and $ThisStatus does ==1, then it remains on this page (updateorder.php) and the screen is blank. The exact thing happens if I use the UpdateCommit button.
Something is happening when it runs this particular section of the UpdateOnly script: Sorry I don't have 10 reputation so it will not let me provide more links. Here is the Pastie number you can replace in the above Pastie link to see the code for this section: 9188298
And something happens when running this particular section of the UpdateCommit script: Sorry I don't have 10 reputation so it will not let me provide more links. Here is the Pastie number you can replace in the above Pastie link to see the code for this section: 9188306
Whatever it is doing it is causing it not to redirect. The SQL code executes and does everything it is supposed to do in the database; it's updating the order, it's updating inventory- all of that executes fine- it's just not redirecting and it stalls somewhere in the script before it redirects and leaves me with a blank screen.
I've done the advanced search on the site and looked at every thing I could find using the keywords PHP, MySQL, Redirect, with no clue as to why it's not working. I've went over this code line by line to look for white space, tried using the whole website address for the redirect, added a space between the colon and the link in the header... I've tried a lot of things. I've even tried unhealthy things like banging my head on my desk, hitting my head with my palm, and pulling my hair... no results. I really appreciate your time.
Just in case- here is the code in my required db connection file: Sorry I don't have 10 reputation so it will not let me provide more links. Here is the Pastie number you can replace in the above Pastie link to see the code for this section: 9188351
By the way... as you can probably tell I'm still learning so it may not be 'beautiful code' yet but I'm working on getting there. Thanks again for your help.
error_reporting(E_ALL); ini_set('display_errors', 1);<?php)session_start();if ($ThisStatus != 1) {instead ofif ($ThisStatus <> 1) {see if that makes it kick in.