|  | Posted by Etienne Marais on 12/21/05 16:50 
Tracy D wrote:
 > I know nothing about php. Can anyone help convert this asp script to a php
 > script?
 
 > [asp snipped]
 
 In general:
 
 <?php
 
 // Will evaluate to true if
 // TransID is "",0,null,false or simply not set
 if (!$_REQUEST["TransID"]) {
 
 ?>
 
 not processed html
 
 <?php
 
 // User || for OR statement, && for AND statement
 } else if ( ($_REQUEST["Auth"]=="Declined") || ($_REQUEST["Auth"]=="") ){
 
 ?>
 
 declined html
 <td><b><php echo $_REQUEST["TransID"] ?></b></td>
 more html
 <td><b><php echo $_REQUEST["RefNo"] ?></b></td>
 more html
 etc. ...
 
 <?
 
 } else {
 
 <?php
 
 approved transaction html + php fragments as above
 
 ?>
 
 }
 
 ?>
 
 ===================
 
 Note that you can get access to
 the variables directly by doing:
 
 extract($_REQUEST)
 
 then you can do:
 
 if ($Auth=="Declined") instead of ($_REQUEST["Auth"]=="Declined)
 and echo $RefNo instead of echo $_REQUEST["RefNo"]
 
 I have altered the logic slightly,
 your last if statement seems wrong,
 i.e. if Auth equals "Declined" then
 Auth is <>"" ( !="" in php) and the
 if statement evaluates to true.
 
 --
 Etienne Marais
 Cosmic Link
 South Africa
  Navigation: [Reply to this message] |