This topic is locked

add page : before display

11/12/2008 2:52:37 AM
PHPRunner General questions
G
garethp authorDevClub member

Hi
I have seen this being talked about a lot but I can not get it to work at all.
In 4.2 I applied the followoing code to add page: before display to prepopulate the delivery_comment field

global $conn;

$sql = "select * from sor_header where sor='".$_SESSION["gdn_header_masterkey1"]."'";

$rs = db_query($sql,$conn);

if($data = db_fetch_array($rs))

$smarty->assign("value_delivery_comment",$data["delivery_comment"]);


This works perfectly and on upgrade 5.0 I tried changing the last line of the code based on previous topics in the forum to...

$xt->assign("value_delivery_comment",$data["delivery_comment"]);


This however does not work - can you help please? I use this in so many places.
Thanks
Gareth

J
Jane 11/12/2008

Gareth,
try to use following code instead:

global $control_delivery_comment;

$control_delivery_comment["params"]["value"]=$data["delivery_comment"];

G
garethp authorDevClub member 11/12/2008

thanks Jane - that seems to have done the trick!
Great support - thanks