PHPMailer Custom Thank you page

I have a site with an Opt-in form. In the form there is a drop-down in which you select your product. Once you click on yes a button appears and you are redirected to a Thank you page that also gives you a direct download link and thanks you for inquiring more about the selected product. I change one of the product names and updated its pdf, but on the thank you page it displays a blank where it should list the product. The Opt-in form also sends the pdf via email and in the email the product name and attachment is displayed correctly.

The products are loaded in the database.

Func.php

<?php

//==============================================================================
function getDevelopmentName($iChoice){
	$aRecords=doSQL(
			"SELECT development_name "
			."FROM current_developments "
			."WHERE property_id='".intval($iChoice)."'"
	);
	$sDevelopmentName=$aRecords[0]["development_name"];
	return str_replace(" ","_",$sDevelopmentName);
}


    function doSQL($sQuery){
			error_log("SQL\n".$sQuery);
				$aLink=mysqli_connect("localhost","property_mspuser","z>ea1Cwidf5V","property_MSP");
				if ($aLink){
					$aResult=@mysqli_query($aLink,utf8_encode($sQuery));
				}
				if (substr($sQuery,0,6)=="INSERT"){
					$aOutput=mysqli_insert_id($aLink);
				} else {
					$aOutput=array();
					$iCount=0;
					while ($aRow=@mysqli_fetch_array($aResult,MYSQL_BOTH)){
						$aOutput[$iCount]=$aRow;
						++$iCount;
					}
				}
				@mysqli_free_result($aResult);
				mysqli_close($aLink);
				return $aOutput;
			}
			
		function change($iDevelopmentInterest){
			$blah = '';
			if($iDevelopmentInterest == 2){
				$blah = "Product5";
			}
			else if($iDevelopmentInterest == 9){
				$blah = "Product6";
			}
			else if($iDevelopmentInterest == 4){
				$blah = "Product1";
			}
			else if($iDevelopmentInterest == 10){
				$blah = "Product2";
			}
			else if($iDevelopmentInterest == 13){
				$blah = "Product3";
			}
			else if($iDevelopmentInterest == 7){
				$blah = "Product4";
			}
			else {
				$blah = "[nothing selected]";
			}
			return $blah;
			
		}
		
		
		function fillDropdown(){
			$aRecords=doSQL(
				"SELECT property_id, development_name "
				."FROM current_developments "
				."ORDER BY development_name"
			);
			$sOptions="";
			$iSize=sizeof($aRecords);
			for ($iCount=0;$iCount<$iSize;$iCount++){
				$aRecord=$aRecords[$iCount];
				$sOptions.="<option value='".$aRecord["property_id"]."'>"
					.$aRecord["development_name"]."</option>";
			}
			return $sOptions;
		}	
	
?> 

And then thankyou.php

<?php 
			require_once "func.php";
			$iDevelopmentID=$_GET["d"];
			
			//==============================================================================
			function getChoice($iChoice){
				$aRecords=doSQL(
						"SELECT development_name "
						."FROM current_developments "
						."WHERE property_id='".intval($iChoice)."'"
				);
				$sDevelopmentName=$aRecords[0]["development_name"];
				return $sDevelopmentName;
			}
			
		?>

Like I said I just changed the one. The rest work perfectly. It’s just the latest one I edited. It doesn’t display the product’s name on the thank you page and the download button also doesn’t work for that product as it doesn’t add the id. The previous edits worked perfectly where I changed products. I’m wondering if it doesn’t have something to do with the auto-increment in the database for that table as I was playing around with that before I loaded the new product.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.