fj1200 Posted November 5, 2009 Share Posted November 5, 2009 I'm having a bit of a problem with a web form. It shows production status in one of our manufacturing areas with jobs listed in a table pulled from our production database - the job name appears on a button with a coloured background showing the job status - green for running and red for stopped. The idea is that when the job is completed they hit the button on a touch screen an a confirmation window pops up and they fill in other data before confirming, which then updates a SQL Server db and closes the popup. It all works as it should BUT the job name is always the same, like it's not releasing it. I've tried setting it to "" at the end of the insert in the pop-up, or on the parent page before the variables are set, but no good. It's the only part that isn't working and it's very frustrating. Not sure if I've got the button link to the popup right either. It's generated on the fly and sits in the forst cullumn of a table. in a table echo "<input style=\"font: 16px Arial; width:140px; height:40px;\" name=\"change_status\" type=\"submit\" VALUE=\"$job_desc\" onclick=\"window.open('http://manu001/m_status/mr_end.php?job=$_job,'popup','width=550,height=550, etc.... The variable $_job is a concatenated string of 10 other components that I then explode in the popup. Just makes it a bit easier for me. Anyone got any suggestions? Probably something pretty simple. Link to comment https://forums.phpfreaks.com/topic/180386-_post-not-releasing-variable-value-in-web-page/ Share on other sites More sharing options...
Bricktop Posted November 5, 2009 Share Posted November 5, 2009 Hi fj1200, The value attribute for the Submit button is $job_desc, so whenever you submit this form element the contents of $job_desc is what will be posted to the database. Is this correct? Link to comment https://forums.phpfreaks.com/topic/180386-_post-not-releasing-variable-value-in-web-page/#findComment-951635 Share on other sites More sharing options...
fj1200 Posted November 5, 2009 Author Share Posted November 5, 2009 It's a bit more involved but basically, yes. The table sits in a form field set to POST, and one of the table columns has a hidden field that carries $_job as the value. If I echo that back on the popup, it's all there as I'd expect it to be, just not the right job! And it's always the same job that get's displayed no matter what button I use, like it's not releasing it or it's picking up the wrong information from somewhere. It's the only thing now that's not working. Link to comment https://forums.phpfreaks.com/topic/180386-_post-not-releasing-variable-value-in-web-page/#findComment-951641 Share on other sites More sharing options...
Bricktop Posted November 5, 2009 Share Posted November 5, 2009 OK, could you post more of the code, specifically the MySQL query and the rest of the PHP code. Link to comment https://forums.phpfreaks.com/topic/180386-_post-not-releasing-variable-value-in-web-page/#findComment-951642 Share on other sites More sharing options...
fj1200 Posted November 5, 2009 Author Share Posted November 5, 2009 Seems to be working now - not entirely 100% why - but there's a strange thing happening too: in the button code I now have: VALUE=\"$_job\" onclick=\"window.open('http://manu001/m_status/mr_end.php?job=$_job Changed the VALUE to $_job and it's working - I'd missed that so thanks for seeing the obvious!. Was concerned it wouldn't display right but it's ok. However - if I remove $_job from either the Value= or the href job=$_job it displays nothing. I have to have both. No idea why, but it's working now anyhow and it doesn't cause a problem. I think the value= was causing the issue but still don't know why only one particular job was being picked up each time. Link to comment https://forums.phpfreaks.com/topic/180386-_post-not-releasing-variable-value-in-web-page/#findComment-951659 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.