You are here: Re: asp to php « All PHP « IT news, forums, messages
Re: asp to php

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация