Re: get or post



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];
}
.



Relevant Pages

  • Re: get or post
    ... the customer user and not the internal or owner user. ... $query = "SELECT m.lease_num ...
    (comp.lang.php)
  • Re: get or post
    ... the customer user and not the internal or owner user. ...   # THIS IS id INSTEAD OF lease_id B/C ONE DAY WE MIGHT HAVE CUSTOMER ...     exit; ... $query = "SELECT m.lease_num ...
    (comp.lang.php)
  • Re: The Ultimate Cut In
    ... > the already crowded and at a standstill exit lane. ... Last night there was a half a mile queue of cars on the hard shoulder trying ... side of the two lane sliproad was half empty so I could indicate and pull ...
    (uk.rec.driving)
  • Re: A solution to the causeway jams
    ... >> If there is no checks on exit, it does not mean the traffic at the exit ... >> means there is no jams formed up at the JB side waiting entry checks. ... >> If you look at people who dirve cars, take bus, and so on, they all come ...
    (soc.culture.singapore)
  • Re: rFactor Mod - McLaren F1 Challenge V1.1
    ... As I said, I can adjust the exit oversteer out of the car, but there ... isn't any way to balance handling at entry with handling at exit. ... Fixing the exit problem results in a horrible entry push with no room ... world record in these cars on one of the Mills track configurations. ...
    (rec.autos.simulators)