Jump to content

$_POST not releasing variable value in web page


fj1200

Recommended Posts

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.

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.