get data from page and posted to new page via href

I want to be able to click on an order id and have that order id posted to another page.

First page
[php]

Status Screen

Open RedTags

<?php $connect =odbc_connect("removed"); if(!$connect) { exit("Connection Failed: " . $connect); } $sql="SELECT OrbeData_KithKitchens.dbo.WIP_master.uompschedulenumber, OrbeData_KithKitchens.dbo.WIP_master.uompscheduleColor,jmaPartID,OrbeData_KithKitchens.dbo.WIP_master.ompSalesOrderID, uomlSorP,serial,rail,panel,stile,upsdescription,itemtype,jmaPartShortDescription , uomlStyleGroup,status ,convert(varchar(19),createdate,0) as createdate ,convert(varchar(19),lastupdate,0) as lastupdate , Case when status=10 then 'Created' when status=3 then 'PreSanding' when status=4 then 'PrePaint' when status=5 then 'Paint' when status=6 then 'PostPaint' else '' end as Status1, m1_DC.dbo.SalesOrders.UOMPTRUCKNUMBER FROM WIP_master left join m1_DC.dbo.SalesOrders on m1_DC.dbo.SalesOrders.ompSalesOrderID=OrbeData_KithKitchens.dbo.WIP_master.ompSalesOrderID where redtag='Y' and redtagclosed !='Y' and uompeudora=0 order by OrbeData_KithKitchens.dbo.WIP_master.uompschedulenumber,uomlSorP,upsdescription,jmaPartID "; $result =odbc_exec($connect,$sql); if(!$result){ exit("Error in SQL"); } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; while (odbc_fetch_row($result)) { $bgcolor= odbc_result($result, "uompscheduleColor"); $jmaPartID= odbc_result($result, "jmaPartID"); $ompSalesOrderID= odbc_result($result, "ompSalesOrderID"); $uomlSorP= odbc_result($result, "uomlSorP"); $serial= odbc_result($result, "serial"); $upsdescription= odbc_result($result, "upsdescription"); $itemtype = odbc_result($result, "itemtype"); $jmaPartShortDescription = odbc_result($result, "jmaPartShortDescription"); $status1 = odbc_result($result, "status1"); $createdate=odbc_result($result, "createdate"); $lastupdate=odbc_result($result, "lastupdate"); $uompschedulenumber=odbc_result($result, "uompschedulenumber"); $truck=odbc_result($result, "UOMPTRUCKNUMBER"); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } odbc_close($connect); ?> [/php]

second page

[PHP]

Status Screen

Open RedTags

<?php $order=$_POST["order"]; $connect =odbc_connect("removed"); if(!$connect) { exit("Connection Failed: " . $connect); } $sql="SELECT OrbeData_KithKitchens.dbo.WIP_master.uompschedulenumber, OrbeData_KithKitchens.dbo.WIP_master.uompscheduleColor,jmaPartID,OrbeData_KithKitchens.dbo.WIP_master.ompSalesOrderID, uomlSorP,serial,rail,panel,stile,upsdescription,itemtype,jmaPartShortDescription , uomlStyleGroup,status ,convert(varchar(19),createdate,0) as createdate ,convert(varchar(19),lastupdate,0) as lastupdate , Case when status=10 then 'Created' when status=3 then 'PreSanding' when status=4 then 'PrePaint' when status=5 then 'Paint' when status=6 then 'PostPaint' else '' end as Status1, m1_DC.dbo.SalesOrders.UOMPTRUCKNUMBER FROM WIP_master left join m1_DC.dbo.SalesOrders on m1_DC.dbo.SalesOrders.ompSalesOrderID=OrbeData_KithKitchens.dbo.WIP_master.ompSalesOrderID where redtag='Y' and redtagclosed !='Y' and OrbeData_KithKitchens.dbo.WIP_master.ompSalesOrderID='$order' order by OrbeData_KithKitchens.dbo.WIP_master.uompschedulenumber,uomlSorP,upsdescription,jmaPartID "; $result =odbc_exec($connect,$sql); if(!$result){ exit("Error in SQL"); } echo "
PartIDOrderIDSorPSerialDescriptionItemTypeItemDescStatusDescCreateLastScheduleTruck
$jmaPartID$ompSalesOrderID$uomlSorP$serial$upsdescription $itemtype$jmaPartShortDescription$status1$createdate$lastupdate $uompschedulenumber $truck
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; while (odbc_fetch_row($result)) { $bgcolor= odbc_result($result, "uompscheduleColor"); $jmaPartID= odbc_result($result, "jmaPartID"); $ompSalesOrderID= odbc_result($result, "ompSalesOrderID"); $uomlSorP= odbc_result($result, "uomlSorP"); $serial= odbc_result($result, "serial"); $upsdescription= odbc_result($result, "upsdescription"); $itemtype = odbc_result($result, "itemtype"); $jmaPartShortDescription = odbc_result($result, "jmaPartShortDescription"); $status1 = odbc_result($result, "status1"); $createdate=odbc_result($result, "createdate"); $lastupdate=odbc_result($result, "lastupdate"); $uompschedulenumber=odbc_result($result, "uompschedulenumber"); $truck=odbc_result($result, "UOMPTRUCKNUMBER"); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } odbc_close($connect); ?> [/PHP]
PartIDOrderIDSorPSerialDescriptionItemTypeItemDescStatusDescCreateLastScheduleTruck
$jmaPartID$ompSalesOrderID$uomlSorP$serial$upsdescription $itemtype$jmaPartShortDescription$status1$createdate$lastupdate $uompschedulenumber $truck

FIRST PAGE
$id

SECOND PAGE

$id=$_GET[‘id’];

You could do it all in one page. You are duplicating your query on the second page. If your going to do multiple pages, put your data into a session. You are using twice as much code as needed.

* Using periods in the column names is going to cause you problems and other people confusion.

Sponsor our Newsletter | Privacy Policy | Terms of Service