Function not returning

I have a function that’s not returning an error message string. I’m sure I’m not doing something right here. Just trying to concatenate the strings together and return errors:

Function:

    function Validate_Register_WBG_Tester($Email, $FullName, $ChatHandle, $Product, $PreferedGenre, $PreviousTester, $AgeGroup, $PlayTime, $Discord, $NDA)
	{
		$Errors;
		
		if(empty($Email))
		{
			$Errors = $Errors.' Invalid Email <br />';
		}
		
		if(empty($Full_Name))
		{
			$Errors = $Errors.' Invalid Full Name <br />';
		}
		
		if(empty($ChatHandle))
		{
			$Errors = $Errors.' Invalid Chat Handle <br />';
		}
		
		if($Discord === FALSE))
		{
			$Errors = $Errors.' Discord Is Required <br />';
		}
		
		if($NDA === FALSE))
		{
			$Errors = $Errors.' You Must Except The Terms Of The Non Disclosure Agreement <br />';
		}
		
		//Todo Email EXISTS
		//Todo Chat Handle Exists
		
		return $Errros(string);
	}

Web Page:

    <?php
    include 'wbg/wbg_web_functions.php';
	/* Template Name: WBG Beta Tester Signup */
    
    global $wpdb;
	
	
	
	if(isset($_POST['submit']))
	{
		$Email = (string)($_POST['txtEmail']);
		$FullName = (string)($_POST['txtFullName']);
		$ChatHandle = (string)($_POST['txtChatHandle']);
		$Product = (string)($_POST['dlGame']);
		$PreferedGenre = (string)($_POST['dlPreferedGame']);
		$PreviousTester = (bool)($_POST['Beta-Tested']);
		$AgeGroup = (string)($_POST['dlAgeGroup']);
		$PlayTime = (string)($_POST['dlPlayTime']);
		$Discord = (bool)($_POST['dlDiscord']);
		$NDA = (bool)($_POST['cbNDA']);
		
		echo Validate_Register_WBG_Tester($Email, $FullName, $ChatHandle, $Product, $PreferedGenre, $PreviousTester, $AgeGroup, $PlayTime, $Discord, $NDA);
		
		
	}
?>

<div style="width: 100%;">
	<div style="width: 100%;background-color:#5BCBBC;">
		<!-- Banner -->
			![White Box Gaming Banner](upload://m0uwdHZQULNwS9G60xUD1fUJNmj.png)
	</div>
	<div style="width:100%;background-color:#FFFFFF; font-size:40px; color:#C2C2C2;" align="left">
		<br><label>WBG Tester Registration</label><br><br>
		<form action="" method="post">
			<div style="width: 100%;border: padding:60px; font-size:40px; color:#C2C2C2;" align="center">
				<div style="width: 100%; padding:25px;">
					<div style="width: 30%; height: 100px; float: left;" align="left">  
						<label>Email</label><br>
						<input type="text" name="txtEmail" id="txtEmail" placeholder="Email Address" style="font-size:20px; width: 90%; color:#000000;"/>
					</div>								
					<div style="width: 30%; height: 100px; float: left;" align="left"> 
						<label>Full Name</label><br>
						<input type="text" name="txtFullName" id="txtFullName" placeholder="Enter Full Name" style="font-size:20px; width: 90%; color:#000000;"/>
					</div>
					<div style="width: 30%; height: 100px; float: left;" align="left"> 
						<label>Chat Handle</label><br>
						<input type="text" name="txtChatHandle" id="txtChatHandle" placeholder="WBG Chat Handle" style="font-size:20px; width: 90%; color:#000000;"/>
					</div>
				</div>
				<br />
				<div style="width: 100%; padding:25px;">
					<div style="width: 30%; height: 100px; float: left;" align="left"> 
						<label for="games">Choose A Game:</label>
						<select id="games" name="dlGame" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="Rune-Master">Rune-Master</option>
						  <option value="Bugology">Bugology</option>
						  <option value="Ant-Farms">Ant-Farms</option>
						</select>
					</div>
					<div style="width: 30%; height: 100px; float: left;" align="left">  
						<label for="pgenre">Prefered Game Genre:</label>
						<select id="pgenre" name="dlPreferedGame" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="RPG">RPG</option>
						  <option value="MMORPG">MMORPG</option>
						  <option value="MMO">MMO</option>
						  <option value="FPS">FPS</option>
						  <option value="Puzzle">Puzzle</option>
						  <option value="Adventure">Adventure</option>
						  <option value="Hack-N-Slash">Hack-N-Slash</option>
						  <option value="VR">VR</option>
						  <option value="MOBA">MOBA</option>
						  <option value="RTS">RTS</option>
						  <option value="Sports">Sports</option>
						  <option value="Racing">Racing</option>
						  <option value="Religious">Religious</option>
						  <option value="Simulation">Simulation</option>
						  <option value="RP">RP</option>
						  <option value="Other">Other</option>
						</select>
					</div>
					<div style="width: 30%; height: 100px; float: left;" align="left">
						<label for="ptest">Beta Tested Previously:</label>
						<select id="ptest" name="Beta-Tested" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="Yes">TRUE</option>
						  <option value="No">FALSE</option>
						</select>
					</div>
				</div>
				<br /><br />
				<div style="width: 100%; padding:25px;">
					<div style="width: 30%; height: 100px; float: left;" align="left"> 
						<label for="age">Age Group:</label>
						<select id="age" name="dlAgeGroup" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="10-15">10-15</option>
						  <option value="16-20">16-20</option>
						  <option value="21-25">21-25</option>
						  <option value="26-30">26-30</option>
						  <option value="31-40">31-49</option>
						  <option value="40+">40+</option>
						</select>
					</div>
					<div style="width: 30%; height: 100px; float: left;" align="left">  
						<label for="ptime">Play Time(Hours/Day):</label>
						<select id="ptime" name="dlPlayTime" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="1-2">1-2</option>
						  <option value="3-4">3-4</option>
						  <option value="5+">5+</option>
						</select>
					</div>
					<div style="width: 30%; height: 100px; float: left;" align="left">
						<label for="discord">Discord:</label>
						<select id="discord" name="dlDiscord" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="Yes">Yes</option>
						  <option value="No">No</option>
						</select>
					</div>
				</div>
				<br />
			</div>
			<!--Agreeemnt-->
			<div style="width: 100%; padding:25px;" align="center">
					<br /><br /><br /><br />
				    <label>Non-Disclosure Agreement</label><br />
				    <a href="https://whiteboxgaming.com/non-disclosure-agreement-rune-master/" target="_blank">Rune Master NDA</a><br />
				    <input type="checkbox" id="cbNDA" name="cbNDA" value="" style="width:20px;height:20px;"><label>I Have Read The NDA And Agree To The Terms Listed.</label><br /><br />
					<input type="submit" id="submit" name="submit" value="Submit Application" style="height:30px; font-size:20px; color:#000000;"/>					
			</div>
		</form>
	<br><br><br>
	</div>
</div>

Well, I don’t see any form tags in your code. Posted data will not work without a form to post it to the code.

You mean this part?

> <form action="" method="post">
> 			<div style="width: 100%;border: padding:60px; font-size:40px; color:#C2C2C2;" align="center">
> 				<div style="width: 100%; padding:25px;">
> 					<div style="width: 30%; height: 100px; float: left;" align="left">  
> 						<label>Email</label><br>
> 						<input type="text" name="txtEmail" id="txtEmail" placeholder="Email Address" style="font-size:20px; width: 90%; color:#000000;"/>
> 					</div>								
> 					<div style="width: 30%; height: 100px; float: left;" align="left"> 
> 						<label>Full Name</label><br>
> 						<input type="text" name="txtFullName" id="txtFullName" placeholder="Enter Full Name" style="font-size:20px; width: 90%; color:#000000;"/>
> 					</div>
> 					<div style="width: 30%; height: 100px; float: left;" align="left"> 
> 						<label>Chat Handle</label><br>
> 						<input type="text" name="txtChatHandle" id="txtChatHandle" placeholder="WBG Chat Handle" style="font-size:20px; width: 90%; color:#000000;"/>
> 					</div>
> 				</div>
> 				<br />
> 				<div style="width: 100%; padding:25px;">
> 					<div style="width: 30%; height: 100px; float: left;" align="left"> 
> 						<label for="games">Choose A Game:</label>
> 						<select id="games" name="dlGame" style="width:90%;height:50px; font-size:20px; color:#000000;">
> 						  <option value="Rune-Master">Rune-Master</option>
> 						  <option value="Bugology">Bugology</option>
> 						  <option value="Ant-Farms">Ant-Farms</option>
> 						</select>
> 					</div>
> 					<div style="width: 30%; height: 100px; float: left;" align="left">  
> 						<label for="pgenre">Prefered Game Genre:</label>
> 						<select id="pgenre" name="dlPreferedGame" style="width:90%;height:50px; font-size:20px; color:#000000;">
> 						  <option value="RPG">RPG</option>
> 						  <option value="MMORPG">MMORPG</option>
> 						  <option value="MMO">MMO</option>
> 						  <option value="FPS">FPS</option>
> 						  <option value="Puzzle">Puzzle</option>
> 						  <option value="Adventure">Adventure</option>
> 						  <option value="Hack-N-Slash">Hack-N-Slash</option>
> 						  <option value="VR">VR</option>
> 						  <option value="MOBA">MOBA</option>
> 						  <option value="RTS">RTS</option>
> 						  <option value="Sports">Sports</option>
> 						  <option value="Racing">Racing</option>
> 						  <option value="Religious">Religious</option>
> 						  <option value="Simulation">Simulation</option>
> 						  <option value="RP">RP</option>
> 						  <option value="Other">Other</option>
> 						</select>
> 					</div>
> 					<div style="width: 30%; height: 100px; float: left;" align="left">
> 						<label for="ptest">Beta Tested Previously:</label>
> 						<select id="ptest" name="Beta-Tested" style="width:90%;height:50px; font-size:20px; color:#000000;">
> 						  <option value="Yes">TRUE</option>
> 						  <option value="No">FALSE</option>
> 						</select>
> 					</div>
> 				</div>
> 				<br /><br />
> 				<div style="width: 100%; padding:25px;">
> 					<div style="width: 30%; height: 100px; float: left;" align="left"> 
> 						<label for="age">Age Group:</label>
> 						<select id="age" name="dlAgeGroup" style="width:90%;height:50px; font-size:20px; color:#000000;">
> 						  <option value="10-15">10-15</option>
> 						  <option value="16-20">16-20</option>
> 						  <option value="21-25">21-25</option>
> 						  <option value="26-30">26-30</option>
> 						  <option value="31-40">31-49</option>
> 						  <option value="40+">40+</option>
> 						</select>
> 					</div>
> 					<div style="width: 30%; height: 100px; float: left;" align="left">  
> 						<label for="ptime">Play Time(Hours/Day):</label>
> 						<select id="ptime" name="dlPlayTime" style="width:90%;height:50px; font-size:20px; color:#000000;">
> 						  <option value="1-2">1-2</option>
> 						  <option value="3-4">3-4</option>
> 						  <option value="5+">5+</option>
> 						</select>
> 					</div>
> 					<div style="width: 30%; height: 100px; float: left;" align="left">
> 						<label for="discord">Discord:</label>
> 						<select id="discord" name="dlDiscord" style="width:90%;height:50px; font-size:20px; color:#000000;">
> 						  <option value="Yes">Yes</option>
> 						  <option value="No">No</option>
> 						</select>
> 					</div>
> 				</div>
> 				<br />
> 			</div>
> 			<!--Agreeemnt-->
> 			<div style="width: 100%; padding:25px;" align="center">
> 					<br /><br /><br /><br />
> 				    <label>Non-Disclosure Agreement</label><br />
> 				    <a href="https://whiteboxgaming.com/non-disclosure-agreement-rune-master/" target="_blank">Rune Master NDA</a><br />
> 				    <input type="checkbox" id="cbNDA" name="cbNDA" value="" style="width:20px;height:20px;"><label>I Have Read The NDA And Agree To The Terms Listed.</label><br /><br />
> 					<input type="submit" id="submit" name="submit" value="Submit Application" style="height:30px; font-size:20px; color:#000000;"/>					
> 			</div>
> 		</form>

I just called the code directly and it worked. So the issue is related to the fact its in a separate file im calling the function outside. So how do I call a function outside this file?

Here is the entire code:
> <?php

    include 'wbg_web_functions.php';
	/* Template Name: WBG Beta Tester Signup */
    
    global $wpdb;
	$wbgfunctions = new WBG_Functions;
	
	
	if(isset($_POST['submit']))
	{
		$Email = ($_POST['txtEmail']);
		$FullName = ($_POST['txtFullName']);
		$ChatHandle = ($_POST['txtChatHandle']);
		$Product = ($_POST['dlGame']);
		$PreferedGenre = ($_POST['dlPreferedGame']);
		$PreviousTester = ($_POST['Beta-Tested']);
		$AgeGroup = ($_POST['dlAgeGroup']);
		$PlayTime = ($_POST['dlPlayTime']);
		$Discord = ($_POST['dlDiscord']);
		$NDA = ($_POST['cbNDA']);
		$Errors;
		
		/*
		if(empty($Email))
		{
			$Errors = $Errors.' Invalid Email <br />';
		}
		
		if(empty($Full_Name))
		{
			$Errors = $Errors.' Invalid Full Name <br />';
		}
		
		if(empty($ChatHandle))
		{
			$Errors = $Errors.' Invalid Chat Handle <br />';
		}
		
		if(!$Discord)
		{
			$Errors = $Errors.' Discord Is Required <br />';
		}
		
		if(!$NDA)
		{
			$Errors = $Errors.' You Must Except The Terms Of The Non Disclosure Agreement <br />';
		}
		
		echo $Errors;
		*/
		echo $wbgfunctions->Validate_Register_WBG_Tester($Email, $FullName, $ChatHandle, $Product, $PreferedGenre, $PreviousTester, $AgeGroup, $PlayTime, $Discord, $NDA);
		
		//echo Register_WBG_Tester($Email, $FullName, $ChatHandle, $Product, $PreferedGenre, $PreviousTester, $AgeGroup, $PlayTime, $Discord, $NDA);
	}
?>

<div style="width: 100%;">
	<div style="width: 100%;background-color:#5BCBBC;">
		<!-- Banner -->
			<img src="https://whiteboxgaming.com/wp-content/uploads/2020/03/cropped-Header_WBG-3.png" alt="White Box Gaming Banner">
	</div>
	<div style="width:100%;background-color:#FFFFFF; font-size:40px; color:#C2C2C2;" align="left">
		<br><label>WBG Tester Registration</label><br><br>
		<form action="" method="post">
			<div style="width: 100%;border: padding:60px; font-size:40px; color:#C2C2C2;" align="center">
				<div style="width: 100%; padding:25px;">
					<div style="width: 30%; height: 100px; float: left;" align="left">  
						<label>Email</label><br>
						<input type="text" name="txtEmail" id="txtEmail" placeholder="Email Address" style="font-size:20px; width: 90%; color:#000000;"/>
					</div>								
					<div style="width: 30%; height: 100px; float: left;" align="left"> 
						<label>Full Name</label><br>
						<input type="text" name="txtFullName" id="txtFullName" placeholder="Enter Full Name" style="font-size:20px; width: 90%; color:#000000;"/>
					</div>
					<div style="width: 30%; height: 100px; float: left;" align="left"> 
						<label>Chat Handle</label><br>
						<input type="text" name="txtChatHandle" id="txtChatHandle" placeholder="WBG Chat Handle" style="font-size:20px; width: 90%; color:#000000;"/>
					</div>
				</div>
				<br />
				<div style="width: 100%; padding:25px;">
					<div style="width: 30%; height: 100px; float: left;" align="left"> 
						<label for="games">Choose A Game:</label>
						<select id="games" name="dlGame" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="Rune-Master">Rune-Master</option>
						  <option value="Bugology">Bugology</option>
						  <option value="Ant-Farms">Ant-Farms</option>
						</select>
					</div>
					<div style="width: 30%; height: 100px; float: left;" align="left">  
						<label for="pgenre">Prefered Game Genre:</label>
						<select id="pgenre" name="dlPreferedGame" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="RPG">RPG</option>
						  <option value="MMORPG">MMORPG</option>
						  <option value="MMO">MMO</option>
						  <option value="FPS">FPS</option>
						  <option value="Puzzle">Puzzle</option>
						  <option value="Adventure">Adventure</option>
						  <option value="Hack-N-Slash">Hack-N-Slash</option>
						  <option value="VR">VR</option>
						  <option value="MOBA">MOBA</option>
						  <option value="RTS">RTS</option>
						  <option value="Sports">Sports</option>
						  <option value="Racing">Racing</option>
						  <option value="Religious">Religious</option>
						  <option value="Simulation">Simulation</option>
						  <option value="RP">RP</option>
						  <option value="Other">Other</option>
						</select>
					</div>
					<div style="width: 30%; height: 100px; float: left;" align="left">
						<label for="ptest">Beta Tested Previously:</label>
						<select id="ptest" name="Beta-Tested" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="Yes">TRUE</option>
						  <option value="No">FALSE</option>
						</select>
					</div>
				</div>
				<br /><br />
				<div style="width: 100%; padding:25px;">
					<div style="width: 30%; height: 100px; float: left;" align="left"> 
						<label for="age">Age Group:</label>
						<select id="age" name="dlAgeGroup" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="10-15">10-15</option>
						  <option value="16-20">16-20</option>
						  <option value="21-25">21-25</option>
						  <option value="26-30">26-30</option>
						  <option value="31-40">31-49</option>
						  <option value="40+">40+</option>
						</select>
					</div>
					<div style="width: 30%; height: 100px; float: left;" align="left">  
						<label for="ptime">Play Time(Hours/Day):</label>
						<select id="ptime" name="dlPlayTime" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="1-2">1-2</option>
						  <option value="3-4">3-4</option>
						  <option value="5+">5+</option>
						</select>
					</div>
					<div style="width: 30%; height: 100px; float: left;" align="left">
						<label for="discord">Discord:</label>
						<select id="discord" name="dlDiscord" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="Yes">Yes</option>
						  <option value="No">No</option>
						</select>
					</div>
				</div>
				<br />
			</div>
			<!--Agreeemnt-->
			<div style="width: 100%; padding:25px;" align="center">
					<br /><br /><br /><br />
				    <label>Non-Disclosure Agreement</label><br />
				    <a href="https://whiteboxgaming.com/non-disclosure-agreement-rune-master/" target="_blank">Rune Master NDA</a><br />
				    <input type="checkbox" id="cbNDA" name="cbNDA" value="" style="width:20px;height:20px;"><label>I Have Read The NDA And Agree To The Terms Listed.</label><br /><br />
					<input type="submit" id="submit" name="submit" value="Submit Application" style="height:30px; font-size:20px; color:#000000;"/>					
			</div>
		</form>
	<br><br><br>
	</div>
</div>

Class

> <?php
>     class WBG_Functions
>     {
>         //Database 
>         protected $host; 
>         protected $username;
>         protected $password;
>         protected $database;
>         
>         function testing()
>         {
>             $string = 'hello world';
>             
>             return $string;
>         }
>     	
>     	function Validate_Register_WBG_Tester($Email, $FullName, $ChatHandle, $Product, $PreferedGenre, $PreviousTester, $AgeGroup, $PlayTime, $Discord, $NDA)
>     	{
>     		$Errors;
>     		
>     		if(empty($Email))
>     		{
>     			$Errors = $Errors.' Invalid Email <br />';
>     		}
>     		
>     		if(empty($Full_Name))
>     		{
>     			$Errors = $Errors.' Invalid Full Name <br />';
>     		}
>     		
>     		if(empty($ChatHandle))
>     		{
>     			$Errors = $Errors.' Invalid Chat Handle <br />';
>     		}
>     		
>     		if(!$Discord)
>     		{
>     			$Errors = $Errors.' Discord Is Required <br />';
>     		}
>     		
>     		if(!$NDA)
>     		{
>     			$Errors = $Errors.' You Must Except The Terms Of The Non Disclosure Agreement <br />';
>     		}
>     		
>     		//Todo Email EXISTS
>     		//Todo Chat Handle Exists
>     		
>     		return $Errros;
>     	}
>         
>         
>         function Register_WBG_Tester($Email, $FullName, $ChatHandle, $Product, $PreferedGenre, $PreviousTester, $AgeGroup, $PlayTime, $Discord, $NDA)
>         {
>             mssql_connect($host, $username, $password);
>             mssql_select_db($database);
>             sqlsrv_configure('WarningsReturnAsErrors',0);
>             $query;
>     		$result;
>     		
>     		$query = (string)"
>     		DECLARE @Response AS BIT = 0;
>     		IF NOT EXISTS(SELECT Email FROM [dbo].[WBG_Tester] WHERE [Email] = $Email) BEGIN
>     		INSERT INTO [dbo].[WBG_Tester]
>     				   ([Email]
>     				   ,[Full_Name]
>     				   ,[Chat_Handle]
>     				   ,[Product]
>     				   ,[Prefered_Genre]
>     				   ,[Previous_Tester]
>     				   ,[Age_Group]
>     				   ,[Play_Time]
>     				   ,[Discord]
>     				   ,[NDA_Agreement])
>     			 VALUES
>     				   ($Email
>     				   ,$FullName
>     				   ,$ChatHandle
>     				   ,$Product
>     				   ,$PreferedGenre
>     				   ,$PreviousTester
>     				   ,$AgeGroup
>     				   ,$PlayTime
>     				   ,$Discord
>     				   ,$NDA
>     				   )
>     
>     			SET @Response = 1
>     		END ELSE BEGIN
>     			SET @Response = 0
>     		END
>     
>     		SELECT @Response";
>     		
>     		$result = mssql_query($query);
>     		
>     		return $result;        
>         }
>     }
> ?>
1 Like

Well, Micah, I guess I should ask first which editor you are using for your code. If you use one built for coding it will show errors. You have an error in the code in line 65 which is:

  	<div style="width: 100%;border: padding:60px; font-size:40px; color:#C2C2C2;" align="center">

You have a missing parm for border. You should fix that first.

Next, we no longer use if(isset($_POST[‘submit’]) for testing if a form was posted.
Now we use: if($_SERVER[‘REQUEST_METHOD’] == ‘POST’)
This is more secure.

I replaced the INCLUDE with the actual code so I could test the page and it thru out errors. Then, before testing on my local server, it thru out more errors because there was no tags in the code you posted. I added these and tested the file. It threw out another error in line 118 which is:
$NDA = ($_POST[‘cbNDA’]);
You do not test if the posted data exists before you load it. I added in checks to see if the posted data exists. Then, it threw out other errors. One was a spelling error on line 50… $Errros…
Then, it threw out another error on line 27 where you spelled another variable incorrectly. In most places you use $FullName but, here you used $Full_name.
After these, it showed invalid entries. So, there is a good start for you. Is this for a class? If you plan to program in your future, you might want to get a good editor. There are several out there. I am currently using Netbeans which is a fairly good one. Other programmers here use others like Eclispe, Zend, etc… Several are free and easy to install. Also, if you set up a local server with WAMP or another free server emulator, you can test locally and it displays errors. Makes it easy to test code. Good luck!

Oh, here is the test page I was using…

  <?PHP

     class WBG_Functions
     {
         //Database 
         protected $host; 
         protected $username;
         protected $password;
         protected $database;
         
         function testing()
         {
             $string = 'hello world';
             
             return $string;
         }
     	
     	function Validate_Register_WBG_Tester($Email, $FullName, $ChatHandle, $Product, $PreferedGenre, $PreviousTester, $AgeGroup, $PlayTime, $Discord, $NDA)
     	{
     		$Errors;
     		
     		if(empty($Email))
     		{
     			$Errors = $Errors.' Invalid Email <br />';
     		}
     		
     		if(empty($FullName))
     		{
     			$Errors = $Errors.' Invalid Full Name <br />';
     		}
     		
     		if(empty($ChatHandle))
     		{
     			$Errors = $Errors.' Invalid Chat Handle <br />';
     		}
     		
     		if(!$Discord)
     		{
     			$Errors = $Errors.' Discord Is Required <br />';
     		}
     		
     		if(!$NDA)
     		{
     			$Errors = $Errors.' You Must Except The Terms Of The Non Disclosure Agreement <br />';
     		}
     		
     		//Todo Email EXISTS
     		//Todo Chat Handle Exists
     		
     		return $Errors;
     	}
         
         
         function Register_WBG_Tester($Email, $FullName, $ChatHandle, $Product, $PreferedGenre, $PreviousTester, $AgeGroup, $PlayTime, $Discord, $NDA)
         {
             mssql_connect($host, $username, $password);
             mssql_select_db($database);
             sqlsrv_configure('WarningsReturnAsErrors',0);
             $query;
     		$result;
     		
     		$query = (string)"
     		DECLARE @Response AS BIT = 0;
     		IF NOT EXISTS(SELECT Email FROM [dbo].[WBG_Tester] WHERE [Email] = $Email) BEGIN
     		INSERT INTO [dbo].[WBG_Tester]
     				   ([Email]
     				   ,[Full_Name]
     				   ,[Chat_Handle]
     				   ,[Product]
     				   ,[Prefered_Genre]
     				   ,[Previous_Tester]
     				   ,[Age_Group]
     				   ,[Play_Time]
     				   ,[Discord]
     				   ,[NDA_Agreement])
     			 VALUES
     				   ($Email
     				   ,$FullName
     				   ,$ChatHandle
     				   ,$Product
     				   ,$PreferedGenre
     				   ,$PreviousTester
     				   ,$AgeGroup
     				   ,$PlayTime
     				   ,$Discord
     				   ,$NDA
     				   )
    
     			SET @Response = 1
     		END ELSE BEGIN
     			SET @Response = 0
     		END
     
     		SELECT @Response";
     		
     		$result = mssql_query($query);
     		
     		return $result; 
         }        
     }
	/* Template Name: WBG Beta Tester Signup */
    
    global $wpdb;
	$wbgfunctions = new WBG_Functions;
	
	
	if(isset($_POST['submit']))
	{
            if(isset($_POST['txtEmail'])) { $Email = ($_POST['txtEmail']); }
            if(isset($_POST['txtFullName'])) { $FullName = ($_POST['txtFullName']); }
            if(isset($_POST['txtChatHandle'])) { $ChatHandle = ($_POST['txtChatHandle']); }
            if(isset($_POST['dlGame'])) { $Product = ($_POST['dlGame']); }
            if(isset($_POST['dlPreferedGame'])) { $PreferedGenre = ($_POST['dlPreferedGame']); }
            if(isset($_POST['Beta-Tested'])) { $PreviousTester = ($_POST['Beta-Tested']); }
            if(isset($_POST['dlAgeGroup'])) { $AgeGroup = ($_POST['dlAgeGroup']); }
            if(isset($_POST['dlPlayTime'])) { $PlayTime = ($_POST['dlPlayTime']); }
            if(isset($_POST['dlDiscord'])) { $Discord = ($_POST['dlDiscord']); }
            if(isset($_POST['cbNDA'])) { $NDA = ($_POST['cbNDA']); }
		$Errors;
		
		/*
		if(empty($Email))
		{
			$Errors = $Errors.' Invalid Email <br />';
		}
		
		if(empty($Full_Name))
		{
			$Errors = $Errors.' Invalid Full Name <br />';
		}
		
		if(empty($ChatHandle))
		{
			$Errors = $Errors.' Invalid Chat Handle <br />';
		}
		
		if(!$Discord)
		{
			$Errors = $Errors.' Discord Is Required <br />';
		}
		
		if(!$NDA)
		{
			$Errors = $Errors.' You Must Except The Terms Of The Non Disclosure Agreement <br />';
		}
		
		echo $Errors;
		*/
		echo $wbgfunctions->Validate_Register_WBG_Tester($Email, $FullName, $ChatHandle, $Product, $PreferedGenre, $PreviousTester, $AgeGroup, $PlayTime, $Discord, $NDA);
		
		//echo Register_WBG_Tester($Email, $FullName, $ChatHandle, $Product, $PreferedGenre, $PreviousTester, $AgeGroup, $PlayTime, $Discord, $NDA);
	}
?>
<html>
    <body>
<div style="width: 100%;">
	<div style="width: 100%;background-color:#5BCBBC;">
		<!-- Banner -->
			<img src="https://whiteboxgaming.com/wp-content/uploads/2020/03/cropped-Header_WBG-3.png" alt="White Box Gaming Banner">
	</div>
	<div style="width:100%;background-color:#FFFFFF; font-size:40px; color:#C2C2C2;" align="left">
		<br><label>WBG Tester Registration</label><br><br>
		<form action="" method="post">
			<div style="width: 100%;border: 1 black solid; padding:60px; font-size:40px; color:#C2C2C2;" align="center">
				<div style="width: 100%; padding:25px;">
					<div style="width: 30%; height: 100px; float: left;" align="left">  
						<label>Email</label><br>
						<input type="text" name="txtEmail" id="txtEmail" placeholder="Email Address" style="font-size:20px; width: 90%; color:#000000;"/>
					</div>								
					<div style="width: 30%; height: 100px; float: left;" align="left"> 
						<label>Full Name</label><br>
						<input type="text" name="txtFullName" id="txtFullName" placeholder="Enter Full Name" style="font-size:20px; width: 90%; color:#000000;"/>
					</div>
					<div style="width: 30%; height: 100px; float: left;" align="left"> 
						<label>Chat Handle</label><br>
						<input type="text" name="txtChatHandle" id="txtChatHandle" placeholder="WBG Chat Handle" style="font-size:20px; width: 90%; color:#000000;"/>
					</div>
				</div>
				<br />
				<div style="width: 100%; padding:25px;">
					<div style="width: 30%; height: 100px; float: left;" align="left"> 
						<label for="games">Choose A Game:</label>
						<select id="games" name="dlGame" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="Rune-Master">Rune-Master</option>
						  <option value="Bugology">Bugology</option>
						  <option value="Ant-Farms">Ant-Farms</option>
						</select>
					</div>
					<div style="width: 30%; height: 100px; float: left;" align="left">  
						<label for="pgenre">Prefered Game Genre:</label>
						<select id="pgenre" name="dlPreferedGame" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="RPG">RPG</option>
						  <option value="MMORPG">MMORPG</option>
						  <option value="MMO">MMO</option>
						  <option value="FPS">FPS</option>
						  <option value="Puzzle">Puzzle</option>
						  <option value="Adventure">Adventure</option>
						  <option value="Hack-N-Slash">Hack-N-Slash</option>
						  <option value="VR">VR</option>
						  <option value="MOBA">MOBA</option>
						  <option value="RTS">RTS</option>
						  <option value="Sports">Sports</option>
						  <option value="Racing">Racing</option>
						  <option value="Religious">Religious</option>
						  <option value="Simulation">Simulation</option>
						  <option value="RP">RP</option>
						  <option value="Other">Other</option>
						</select>
					</div>
					<div style="width: 30%; height: 100px; float: left;" align="left">
						<label for="ptest">Beta Tested Previously:</label>
						<select id="ptest" name="Beta-Tested" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="Yes">TRUE</option>
						  <option value="No">FALSE</option>
						</select>
					</div>
				</div>
				<br /><br />
				<div style="width: 100%; padding:25px;">
					<div style="width: 30%; height: 100px; float: left;" align="left"> 
						<label for="age">Age Group:</label>
						<select id="age" name="dlAgeGroup" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="10-15">10-15</option>
						  <option value="16-20">16-20</option>
						  <option value="21-25">21-25</option>
						  <option value="26-30">26-30</option>
						  <option value="31-40">31-49</option>
						  <option value="40+">40+</option>
						</select>
					</div>
					<div style="width: 30%; height: 100px; float: left;" align="left">  
						<label for="ptime">Play Time(Hours/Day):</label>
						<select id="ptime" name="dlPlayTime" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="1-2">1-2</option>
						  <option value="3-4">3-4</option>
						  <option value="5+">5+</option>
						</select>
					</div>
					<div style="width: 30%; height: 100px; float: left;" align="left">
						<label for="discord">Discord:</label>
						<select id="discord" name="dlDiscord" style="width:90%;height:50px; font-size:20px; color:#000000;">
						  <option value="Yes">Yes</option>
						  <option value="No">No</option>
						</select>
					</div>
				</div>
				<br />
			</div>
			<!--Agreeemnt-->
			<div style="width: 100%; padding:25px;" align="center">
					<br /><br /><br /><br />
				    <label>Non-Disclosure Agreement</label><br />
				    <a href="https://whiteboxgaming.com/non-disclosure-agreement-rune-master/" target="_blank">Rune Master NDA</a><br />
				    <input type="checkbox" id="cbNDA" name="cbNDA" value="" style="width:20px;height:20px;"><label>I Have Read The NDA And Agree To The Terms Listed.</label><br /><br />
					<input type="submit" id="submit" name="submit" value="Submit Application" style="height:30px; font-size:20px; color:#000000;"/>					
			</div>
		</form>
	<br><br><br>
	</div>
</div>
    </body>
</html>

did you get this working? Just curious…

Yes thank you. I was looking for a close button or something

Posts are not closed out. They are left so that others can view your code if they need help with the same problems.
Normally, you just post that you solved it. Glad you got it working…

Sponsor our Newsletter | Privacy Policy | Terms of Service