Re: get or post
- From: JRough <jlrough@xxxxxxxxx>
- Date: Tue, 30 Dec 2008 20:13:40 -0800 (PST)
On Dec 30, 7:45 pm, FutureShock <futuresho...@xxxxxxx> wrote:
Acutally I was wrong....PHP_SELF should return the doc path.
http://example.com/members/test.php
will return '/members/test.php'
Scotty
So that means the id does get posted for the "all cars". That means
it is available on any page in the session. It is posting it through
the url not through the form. Is that why it doesn't matter that the
end </form> tag was missing and it worked anyway? So that is not the
problem then. For some reason my redirect to the excel page works for
the customer user and not the internal or owner user. It does not
redirect to current_sightingsXL.php in the case of the owner or
internal user only the customer user. The only other difference
between those 2 users and the customer user is the select_lease_num
(leaseID) & select_comp_name(leaseID) functions.
Validate_login("current_sightings.php");
if(empty($id)&&($_SESSION["LMS_USER_DESC"]=='internal'||$_SESSION
["LMS_USER_DESC"]=='owner')){
# THIS IS id INSTEAD OF lease_id B/C ONE DAY WE MIGHT HAVE CUSTOMER
SUB GROUPS OR MANAGED CARS
$destroyed = GetDestroyed_lease_id();
$result = Get_leasesCLM();
$TPL_ids = "<SELECT name='id' class=box size=8>\n";
$trbg = "";
while($row = mysql_fetch_assoc($result)){
$id = $row['lease_id'];
$lnum = $row['lease_num'];
$comp = $row['comp_name'];
$trbg = GetTRBG($trbg);
$TPL_ids.=" <OPTION VALUE='".$id;
$TPL_ids.="' ".$trbg.">".$lnum." - ".$comp."</OPTION>\n";
}
$TPL_ids.="</SELECT>\n";
include "header.php";
include $template_path."current_sightings_php.html";
}elseif($_POST['redirect']&&$_POST['redirect']!=$_SERVER['PHP_SELF']){
Header("Location: ".$_POST['redirect'].".php?id=".$_POST['id']);
exit;
}elseif($_POST['assign']=='Open in Excel'){
#Header("Location: http://allcapitalrail.com/current_sightingsXL.php");
Header("Location: http://allcapitalrail.com/current_sightingsXL.php?id=".$_POST['id']);
exit;
}else{
# DETERMINE PAGE ACCORDING TO USER TYPE
switch ($_SESSION["LMS_USER_DESC"]){
case "customer":
$id = $_SESSION["LMS_LOGGED_IN"];
$MSG_carlist = "CURRENT SIGHTINGS";
$result = SELECT_sightings_customercars($id,CLM_order_by
($order_by));
break;
case "internal":
$MSG_carlist = "CURRENT SIGHTINGS FOR ".SELECT_lease_num($id)."
".SELECT_comp_name($id);
$result = SELECT_sightings_leasecars($id,CLM_order_by
($order_by));
break;
case "owner":
$MSG_carlist = "CURRENT SIGHTINGS FOR ".SELECT_lease_num($id)."
".SELECT_comp_name($id);
$result = SELECT_sightings_ownercars($id,CLM_order_by
($order_by));
break;
#case "internal_ltd":
# break;
}
$TPL_carnumbers = GetTableHeaders($id);
while ($row = mysql_fetch_assoc($result)){
$TPL_carnumbers.=MakeSighting($row);
}
$TPL_carnumbers.="</table>";
include "header.php";
include $template_path."template_carlist.html";
include "footer.php";
}
-------------
function SELECT_lease_num($lease_id){
$query = "SELECT m.lease_num
FROM INTERNAL_MASTER_LEASE m, INTERNAL_LEASES l
WHERE l.lease_id =".$lease_id."
AND l.master_lease_id = m.master_lease_id";
$result = mysql_query($query);
if(!$result){
MySQLError($query);
exit;
}
$row = mysql_fetch_row($result);
return $row[0];
}
function SELECT_comp_name($lease_id){
$query = "SELECT comp_name
FROM INTERNAL_LEASES l, INTERNAL_MASTER_LEASE m, INTERNAL_COMPANY
c
WHERE l.lease_id = ".$lease_id."
AND l.master_lease_id = m.master_lease_id
AND m.comp_id = c.comp_id";
$result = mysql_query($query);
if(!$result){
MySQLError($query);
exit;
}
$row = mysql_fetch_row($result);
return $row[0];
}
.
- Follow-Ups:
- Re: get or post
- From: FutureShock
- Re: get or post
- References:
- get or post
- From: JRough
- Re: get or post
- From: FutureShock
- get or post
- Prev by Date: Re: get or post
- Next by Date: Re: get or post
- Previous by thread: Re: get or post
- Next by thread: Re: get or post
- Index(es):
Relevant Pages
|