douwei7976 2015-01-07 13:48
浏览 118

未定义的变量GET问题

I'm still relatively new to PHP, I'm trying to assist someone with a PHP issue they're having. However for some reason I just cannot see what it is that I'm doing wrong.

I attempted to echo the "$params" and got this string:

clientid=30608&password=passphrase&oid=&chargetype=Auth¤cycode=826&total=

which clearly shows that the "oid=" and the "total=" records are missing, which was because in the old code, the oid and total section displayed in the code below, were commented out, which meant they weren't being encrypted along with the rest of the params.

After removing the #, I attempted again, however I received this notice:

Notice: Undefined variable: GET_ in /home/public_html/payments.php on line 232

Notice: Undefined variable: GET_ in /home/public_html/payments.php on line 234

I understand it's $_GET (also in the code) and not $GET_ however the error still shows it like that.

Any help would be greatly appreciated

<?php require_once('mulgas1.php'); ?>
<?php session_start(); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$colname_InvoicePayments = "-1";
if (isset($_SESSION['recordadded'])) {
  $colname_InvoicePayments = (get_magic_quotes_gpc()) ? $_SESSION['recordadded'] : addslashes($_SESSION['recordadded']);
}
mysql_select_db($database_mulgas1, $mulgas1);
$query_InvoicePayments = sprintf("SELECT * FROM InvoicePayments WHERE IP_ID = %s", GetSQLValueString($colname_InvoicePayments, "int"));
$InvoicePayments = mysql_query($query_InvoicePayments, $mulgas1) or die(mysql_error());
$row_InvoicePayments = mysql_fetch_assoc($InvoicePayments);
$totalRows_InvoicePayments = mysql_num_rows($InvoicePayments);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>MULGAS LIMITED - Competitive Prices on Boiler Service, Installation, Gas Safety Checks, PAT Testing - Contact Us For Details</title>
<meta name="description" content="MULGAS SERVICES - Established Corgi Registered Gas Engineers. Services include gas installation, service, repair, upgrades, boiler service and replacement. Gas oven and fire installation is another MULGAS service. MULGAS are approved to carry out gas and electrical landlord safety checks. Based in Woking and operating in Surrey and South West London." />
<meta name="keywords" content="mulgas, gas, service, installation, install, repair, upgrade, boiler, replacement, oven, cooker, fire, hot water, central heating, heating, safety, check, landlord, electrical, tenant, UK gas safety, gas safety and electrical checks, inspections, gaselec, gas-elec, british, UK, surrey, london, woking, guildford, engineer, engineers, carbon monoxide, CO, landlords, estate agents, letting agents, property management,solar heating, air source heat pumps, mulgas ltd, mulgas limited, gas boiler engineers, weybridge, west byfleet, camberley, farnham, farnborough, chertsey, addlestone, ashford, staines, bagshot, kingston, surbiton, epsom, esher, leatherhead, cobham, oxshott, chobham, virginia water, sunningdale, ascot, bracknell, gas safety checks, lgsc, cp12, pat, central heating repairs, systems, radiators, solar, renewable, underfloor heating, carbon monoxide, plumbing" />
<link rel="stylesheet" type="text/css" href="http://mulgas.co.uk/wp-content/themes/Mulgas/style.css" media="screen" />
<meta name="author" content="Graham Heels - www.morgan-gould.com" />
<meta name="revisit-after" content="1 week" />
<meta name="robots" content="all" />
<style type="text/css">









body,td,th {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #28335F;
}



.style2 {
    font-size:25px;
}















-->
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script language="JavaScript1.2" type="text/javascript" src="Nav2/mm_css_menu.js"></script>
<script type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}
//-->
</script>
</head>

<body onload="MM_preloadImages('Nav2/Mulgas_Nav2_r1_c1_f2.png','Nav2/Mulgas_Nav2_r1_c1_f4.png','Nav2/Mulgas_Nav2_r1_c3_f3.png','Nav2/Mulgas_Nav2_r1_c3_f2.png','Nav2/Mulgas_Nav2_r1_c3_f4.png','Nav2/Mulgas_Nav2_r1_c4_f3.png','Nav2/Mulgas_Nav2_r1_c4_f2.png','Nav2/Mulgas_Nav2_r1_c4_f4.png','Nav2/Mulgas_Nav2_r1_c6_f3.png','Nav2/Mulgas_Nav2_r1_c6_f2.png','Nav2/Mulgas_Nav2_r1_c6_f4.png','Nav2/Mulgas_Nav2_r1_c8_f3.png','Nav2/Mulgas_Nav2_r1_c8_f2.png','Nav2/Mulgas_Nav2_r1_c8_f4.png','Nav2/Mulgas_Nav2_r1_c1.png','Nav2/Mulgas_Nav2_r1_c1_f3.png','Nav3/Mulgas_Nav2_r1_c1_f3.png','Nav3/Mulgas_Nav2_r1_c1_f2.png','Nav3/Mulgas_Nav2_r1_c1_f4.png','Nav3/Mulgas_Nav2_r1_c3_f3.png','Nav3/Mulgas_Nav2_r1_c3_f2.png','Nav3/Mulgas_Nav2_r1_c3_f4.png','Nav3/Mulgas_Nav2_r1_c4_f3.png','Nav3/Mulgas_Nav2_r1_c4_f2.png','Nav3/Mulgas_Nav2_r1_c4_f4.png','Nav3/Mulgas_Nav2_r1_c6_f3.png','Nav3/Mulgas_Nav2_r1_c6_f2.png','Nav3/Mulgas_Nav2_r1_c6_f4.png','Nav3/Mulgas_Nav2_r1_c8_f3.png','Nav3/Mulgas_Nav2_r1_c8_f2.png','Nav3/Mulgas_Nav2_r1_c8_f4.png','Nav3/Mulgas_Nav2_r1_c10_f3.png','Nav3/Mulgas_Nav2_r1_c10_f2.png','Nav3/Mulgas_Nav2_r1_c10_f4.png','Nav3/Mulgas_Nav2_r1_c12_f3.png','Nav3/Mulgas_Nav2_r1_c12_f2.png','Nav3/Mulgas_Nav2_r1_c12_f4.png','Nav3/Mulgas_Nav2_r1_c14_f3.png','Nav3/Mulgas_Nav2_r1_c14_f2.png','Nav3/Mulgas_Nav2_r1_c14_f4.png','Nav3/Mulgas_Nav2_r1_c16_f3.png','Nav3/Mulgas_Nav2_r1_c16_f2.png','Nav3/Mulgas_Nav2_r1_c16_f4.png')"><div id="main-content">

    <div id="main-content-page">

        <div id="main-content-inside-page">
        <a href="http://www.mulgas.co.uk"><img src="http://mulgas.co.uk/wp-content/themes/Mulgas/images/logo-pay.png" /></a>
<div id="design">








  <div id="MainText1">
    <table width="100%" bgcolor="#fff">
      <tr>
        <td width="5%">&nbsp;</td>
        <td width="73%">&nbsp;</td>
        <td width="22%">&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><span class="style2">Paying Your Invoice With A Debit Or Credit Card</span></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><?php # echo "record added =>" . $_SESSION['recordadded'] . "<=   " ;?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="502">&nbsp;</td>
        <td>     
        <?php

#the following function performs a HTTP Post and returns the whole response
function pullpage( $host, $usepath, $postdata = "" ) {

# open socket to filehandle(epdq encryption cgi)
$fp = fsockopen('ssl://'. $host, 443, &$errno, &$errstr, 60);

#check that the socket has been opened successfully
 if( !$fp ) {
    print "$errstr ($errno)<br>
";
 }
 else {

    #write the data to the encryption cgi
    fputs( $fp, "POST $usepath HTTP/1.0
");
    $strlength = strlen( $postdata );
    fputs( $fp, "Content-type: application/x-www-form-urlencoded
" );
    fputs( $fp, "Content-length: ".$strlength."

" );
    fputs( $fp, $postdata."

" );

    #clear the response data
   $output = "";


    #read the response from the remote cgi 
    #while content exists, keep retrieving document in 1K chunks
    while( !feof( $fp ) ) {
        $output .= fgets( $fp, 1024);
    }

    #close the socket connection
    fclose( $fp);
 }

#return the response
 return $output;
}

#define the remote cgi in readiness to call pullpage function 
$server="secure2.epdq.co.uk";
$url="/cgi-bin/CcxBarclaysEpdqEncTool.e";

#the following parameters have been obtained earlier in the merchant's webstore
#clientid, passphrase, oid, currencycode, total
$clientid = "30608";
$passphrase = "passphrase";
$oid = $_GET['InvoiceNo'];
$currencycode = "826";
$total = $_GET['AmountDue'];

$params="clientid=30608";
$params.="&password=passphrase";
$params.="&oid=" . $row_InvoicePayments['IP_Invoice_Number']; 
$params.="&chargetype=Auth";
$params.="&currencycode=826";
$params.="&total=" . $row_InvoicePayments['IP_Amount_Due'];

#$params="clientid=$clientid";
#$params.="&password=$passphrase";
#$params.="&oid=$oid";
#$params.="&chargetype=Auth";
#$params.="&currencycode=$currencycode";
#$params.="&total=$total";

#perform the HTTP Post
$response = pullpage( $server,$url,$params );

#split the response into separate lines
$response_lines=explode("
",$response);

#for each line in the response check for the presence of the string 'epdqdata'
#this line contains the encrypted string
$strEPDQ = '';
$response_line_count=count($response_lines);
for ($i=0;$i<$response_line_count;$i++){
    if (preg_match('/epdqdata/',$response_lines[$i])){
        $strEPDQ=$response_lines[$i];
    }
}
?>
          <p align="left">Thank you for entering your invoice details and agreeing to the Terms and Conditions. 
          <p align="left">By pressing the Complete Payment button below you will be taken to the ePDQ payment page.          
          <p align="left">Once you have succesfully processed a payment through Barclaycard's ePDQ system you will return to <br />
            the Mulgas web site. 
          <p align="left">Mulgas Limited are a limited company based in the UK.           
          <blockquote>
            <p align="left">Company Registration Number : <strong>6240616 </strong></p>
            <p align="left">VAT Number : 
              <strong>GB 733 7166 30            </strong>
            </p>
          </blockquote>
          <FORM action="https://secure2.epdq.co.uk/cgi-bin/CcxBarclaysEpdq.e" method="POST">
            <div align="left"><?php print $strEPDQ; ?>
              <INPUT type="hidden" name="returnurl" value="http://www.mulgas.co.uk/completed_payment.php">
              <INPUT type="hidden" name="merchantdisplayname" value="Mulgas Services">
              <INPUT TYPE="submit" VALUE="Complete Payment">
            </div>
          </FORM>
        </p>
        <div align="center"><img src="images/CC_Warning_1.gif" width="400" height="230" /></div>
        <p>&nbsp;</p></td>
        <td align="right"><img src="images/Prices_Panel_right_200w_500h_1.gif" width="200" height="500" hspace="10" border="0" usemap="#Map3" /></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
  </div>
    <div id="bottomSectionNotIndex"><img src="images/Bottom_Narrow_Footer_970w_20h_1.gif" border="0" usemap="#Map2" />
<map name="Map2" id="Map2">
  <area shape="rect" coords="7,1,271,17" href="mailto:service@mulgas.co.uk" />
</map></div>
</div>


<map name="Map3" id="Map3"><area shape="rect" coords="3,6,195,492" href="second opinion.html" />
</map></div>
        <!-- #main-content-inside-page -->

    </div>
    <!-- #main-content-page -->

</div>
<!-- #main-content --></body>
</html>
<?php
mysql_free_result($InvoicePayments);
?>
  • 写回答

1条回答 默认 最新

  • douhuan6157 2015-01-07 13:54
    关注

    change

    $oid = $_GET['InvoiceNo'];
    $currencycode = "826";
    $total = $_GET['AmountDue'];
    

    to

    $oid = (isset($_GET['InvoiceNo']) ? $_GET['InvoiceNo'] : null );
    $currencycode = "826";
    $total = (isset($_GET['AmountDue']) ? $_GET['AmountDue'] : null );
    

    basic idea is those parameters you are searching on, are not declared. You should ALWAYS check if the viriable exist before u are using it

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。