Forms PHP + Javascript Help

Part One. I have BOLDED the piece of code I am working on. It is in the first half of the code.

[code]<?php
session_start(); //start a session

error_reporting(E_ALL); //E_ALL ^ E_NOTICE
ini_set(‘display_errors’,‘1’); //Initialize custom debugging function
?>

Device Manager
<?php		
	
	print "<font size='6'>DEVICE INVENTORY (Android): MOBILE TEAM</font><br>";

	$textfile = 'mtand.txt';
	$data = ''; //defining variable before use

  if (file_exists($textfile) && is_readable($textfile))      
  {         
     $file = file($textfile);      

     foreach ($file as $line)
     {
        //separate each element and store in temp array.      
        $tmp = explode(":", $line);               

        //assign each element to array.        
        $data[] = array('name' => $tmp[0], 'mdn' => $tmp[1], 'carrier' => $tmp[2], 'meid' => $tmp[3], 'version' => $tmp[4], 'date' => $tmp[5], 'notes' => $tmp[6], 'voice' => $tmp[7]);      
     }  

}

	echo "<table cellspacing='0' cellpadding='14'>";		
	if ($data!=""){			
		echo "<tr><th style='background:#6699FF'>Device Name</th><th style='background:#6699FF'>MDN</th><th style='background:#6699FF'>Carrier</th><th style='background:#6699FF'>MEID/IMEI</th><th style='background:#6699FF'>OS Version</th><th style='background:#6699FF'>Received Date</th><th style='background:#6699FF'>Notes</th><th style='background:#6699FF'>Voice</th></tr>";			
		foreach ($data as $key => $row)			
		{				

			$name[$key]= $row['name'];		
			$mdn[$key]= $row['mdn'];		
			$carrier[$key]= $row['carrier'];		
			$meid[$key]= $row['meid'];
			$version[$key]= $row['version'];
			$date[$key]= $row['date'];
			$notes[$key]= $row['notes'];
			$voice[$key]= $row['voice'];				
			
			echo "<tr><td>{$name[$key]}</td><td>{$mdn[$key]}</td><td>{$carrier[$key]}</td><td>{$meid[$key]}</td><td>{$version[$key]}</td><td>{$date[$key]}</td><td>{$notes[$key]}</td><td>{$voice[$key]}</td></tr>";			
		}
	}
	echo "</table>";

[b] $textfile = ‘mtand.txt’;
if (file_exists($textfile) && is_readable($textfile))
{

$delete = @$_GET['delete']; 
$file_name = "mtand.txt";
$size = filesize($file_name);
$textFile = file($file_name);
$lines = count($textFile);

if($size == "0") 
{ 
/* Do no action. There is no data written to the file */
exit; 
	} 
}

if($delete != “” && $delete >! $lines || $delete === ‘0’) {
$textFile[$delete] = “”;
$fileUpdate = fopen($file_name, “wb”);
for($a=0; $a<$lines; $a++) {
fwrite($fileUpdate, $textFile[$a]);
}
fclose($fileUpdate);
header(“Location:indexNew.htm”);

} else

foreach($textFile as $key => $val) {

$line = @$line . $val . "<a href =?delete=$key> [DELETE]
";

}
echo $line; [/b]

?>

<?php		
	
	print "<font size='6'>DEVICE INVENTORY (iOS): MOBILE TEAM</font><br>";

	$textfile = 'mtios.txt';
	$data = ''; //defining variable before use

  if (file_exists($textfile) && is_readable($textfile))      
  {         
     $file = file($textfile);      

     foreach ($file as $line)
     {
        //separate each element and store in temp array.      
        $tmp = explode(":", $line);               

        //assign each element to array.        
        $data[] = array('name' => $tmp[0], 'mdn' => $tmp[1], 'carrier' => $tmp[2], 'meid' => $tmp[3], 'version' => $tmp[4], 'date' => $tmp[5], 'notes' => $tmp[6], 'voice' => $tmp[7]);      
     }  

}

	echo "<table cellspacing='0' cellpadding='14'>";		
	if ($data!=""){			
		echo "<tr><th style='background:#6699FF'>Device Name</th><th style='background:#6699FF'>MDN</th><th style='background:#6699FF'>Carrier</th><th style='background:#6699FF'>MEID/IMEI</th><th style='background:#6699FF'>OS Version</th><th style='background:#6699FF'>Received Date</th><th style='background:#6699FF'>Notes</th><th style='background:#6699FF'>Voice</th></tr>";			
		foreach ($data as $key => $row)			
		{				

			$name[$key]= $row['name'];		
			$mdn[$key]= $row['mdn'];		
			$carrier[$key]= $row['carrier'];		
			$meid[$key]= $row['meid'];
			$version[$key]= $row['version'];
			$date[$key]= $row['date'];
			$notes[$key]= $row['notes'];
			$voice[$key]= $row['voice'];				
			
			echo "<tr><td>{$name[$key]}</td><td>{$mdn[$key]}</td><td>{$carrier[$key]}</td><td>{$meid[$key]}</td><td>{$version[$key]}</td><td>{$date[$key]}</td><td>{$notes[$key]}</td><td>{$voice[$key]}</td></tr>";			
		}
	}
	echo "</table>";
?>

<?php		
	
	print "<font size='6'>DEVICE INVENTORY (MISC): MOBILE TEAM</font><br>";

	$textfile = 'mtmisc.txt';
	$data = ''; //defining variable before use

  if (file_exists($textfile) && is_readable($textfile))      
  {         
     $file = file($textfile);      

     foreach ($file as $line)
     {
        //separate each element and store in temp array.      
        $tmp = explode(":", $line);               

        //assign each element to array.        
        $data[] = array('name' => $tmp[0], 'mdn' => $tmp[1], 'carrier' => $tmp[2], 'meid' => $tmp[3], 'version' => $tmp[4], 'date' => $tmp[5], 'notes' => $tmp[6], 'voice' => $tmp[7]);      
     }  

}

	echo "<table cellspacing='0' cellpadding='14'>";		
	if ($data!=""){			
		echo "<tr><th style='background:#6699FF'>Device Name</th><th style='background:#6699FF'>MDN</th><th style='background:#6699FF'>Carrier</th><th style='background:#6699FF'>MEID/IMEI</th><th style='background:#6699FF'>OS Version</th><th style='background:#6699FF'>Received Date</th><th style='background:#6699FF'>Notes</th><th style='background:#6699FF'>Voice</th></tr>";			
		foreach ($data as $key => $row)			
		{				

			$name[$key]= $row['name'];		
			$mdn[$key]= $row['mdn'];		
			$carrier[$key]= $row['carrier'];		
			$meid[$key]= $row['meid'];
			$version[$key]= $row['version'];
			$date[$key]= $row['date'];
			$notes[$key]= $row['notes'];
			$voice[$key]= $row['voice'];				
			
			echo "<tr><td>{$name[$key]}</td><td>{$mdn[$key]}</td><td>{$carrier[$key]}</td><td>{$meid[$key]}</td><td>{$version[$key]}</td><td>{$date[$key]}</td><td>{$notes[$key]}</td><td>{$voice[$key]}</td></tr>";			
		}
	}
	echo "</table>";
?>

<?php		
	
	print "<font size='6'>DEVICE INVENTORY (Android): BIZ DEV</font><br>";

	$textfile = 'bdand.txt';
	$data = ''; //defining variable before use

  if (file_exists($textfile) && is_readable($textfile))      
  {         
     $file = file($textfile);      

     foreach ($file as $line)
     {
        //separate each element and store in temp array.      
        $tmp = explode(":", $line);               

        //assign each element to array.        
        $data[] = array('name' => $tmp[0], 'mdn' => $tmp[1], 'carrier' => $tmp[2], 'meid' => $tmp[3], 'version' => $tmp[4], 'date' => $tmp[5], 'notes' => $tmp[6], 'voice' => $tmp[7]);      
     }  

}

	echo "<table cellspacing='0' cellpadding='14'>";		
	if ($data!=""){			
		echo "<tr><th style='background:#A6A6A6'>Device Name</th><th style='background:#A6A6A6'>MDN</th><th style='background:#A6A6A6'>Carrier</th><th style='background:#A6A6A6'>MEID/IMEI</th><th style='background:#A6A6A6'>OS Version</th><th style='background:#A6A6A6'>Received Date</th><th style='background:#A6A6A6'>Notes</th><th style='background:#A6A6A6'>Voice</th></tr>";			
		foreach ($data as $key => $row)			
		{				

			$name[$key]= $row['name'];		
			$mdn[$key]= $row['mdn'];		
			$carrier[$key]= $row['carrier'];		
			$meid[$key]= $row['meid'];
			$version[$key]= $row['version'];
			$date[$key]= $row['date'];
			$notes[$key]= $row['notes'];
			$voice[$key]= $row['voice'];				
			
			echo "<tr><td>{$name[$key]}</td><td>{$mdn[$key]}</td><td>{$carrier[$key]}</td><td>{$meid[$key]}</td><td>{$version[$key]}</td><td>{$date[$key]}</td><td>{$notes[$key]}</td><td>{$voice[$key]}</td></tr>";			
		}
	}
	echo "</table>";
?>

<?php		
	
	print "<font size='6'>DEVICE INVENTORY (iOS): BIZ DEV</font><br>";

	$textfile = 'bdios.txt';
	$data = ''; //defining variable before use

  if (file_exists($textfile) && is_readable($textfile))      
  {         
     $file = file($textfile);      

     foreach ($file as $line)
     {
        //separate each element and store in temp array.      
        $tmp = explode(":", $line);               

        //assign each element to array.        
        $data[] = array('name' => $tmp[0], 'mdn' => $tmp[1], 'carrier' => $tmp[2], 'meid' => $tmp[3], 'version' => $tmp[4], 'date' => $tmp[5], 'notes' => $tmp[6], 'voice' => $tmp[7]);      
     }  

}

	echo "<table cellspacing='0' cellpadding='14'>";		
	if ($data!=""){			
		echo "<tr><th style='background:#A6A6A6'>Device Name</th><th style='background:#A6A6A6'>MDN</th><th style='background:#A6A6A6'>Carrier</th><th style='background:#A6A6A6'>MEID/IMEI</th><th style='background:#A6A6A6'>OS Version</th><th style='background:#A6A6A6'>Received Date</th><th style='background:#A6A6A6'>Notes</th><th style='background:#A6A6A6'>Voice</th></tr>";			
		foreach ($data as $key => $row)			
		{				

			$name[$key]= $row['name'];		
			$mdn[$key]= $row['mdn'];		
			$carrier[$key]= $row['carrier'];		
			$meid[$key]= $row['meid'];
			$version[$key]= $row['version'];
			$date[$key]= $row['date'];
			$notes[$key]= $row['notes'];
			$voice[$key]= $row['voice'];				
			
			echo "<tr><td>{$name[$key]}</td><td>{$mdn[$key]}</td><td>{$carrier[$key]}</td><td>{$meid[$key]}</td><td>{$version[$key]}</td><td>{$date[$key]}</td><td>{$notes[$key]}</td><td>{$voice[$key]}</td></tr>";			
		}
	}
	echo "</table>";
?>

<?php		
	
	print "<font size='6'>DEVICE INVENTORY (MISC): BIZ DEV</font><br>";

	$textfile = 'bdmisc.txt';
	$data = ''; //defining variable before use

  if (file_exists($textfile) && is_readable($textfile))      
  {         
     $file = file($textfile);      

     foreach ($file as $line)
     {
        //separate each element and store in temp array.      
        $tmp = explode(":", $line);               

        //assign each element to array.        
        $data[] = array('name' => $tmp[0], 'mdn' => $tmp[1], 'carrier' => $tmp[2], 'meid' => $tmp[3], 'version' => $tmp[4], 'date' => $tmp[5], 'notes' => $tmp[6], 'voice' => $tmp[7]);      
     }  

}

	echo "<table cellspacing='0' cellpadding='14'>";		
	if ($data!=""){			
		echo "<tr><th style='background:#A6A6A6'>Device Name</th><th style='background:#A6A6A6'>MDN</th><th style='background:#A6A6A6'>Carrier</th><th style='background:#A6A6A6'>MEID/IMEI</th><th style='background:#A6A6A6'>OS Version</th><th style='background:#A6A6A6'>Received Date</th><th style='background:#A6A6A6'>Notes</th><th style='background:#A6A6A6'>Voice</th></tr>";			
		foreach ($data as $key => $row)			
		{				

			$name[$key]= $row['name'];		
			$mdn[$key]= $row['mdn'];		
			$carrier[$key]= $row['carrier'];		
			$meid[$key]= $row['meid'];
			$version[$key]= $row['version'];
			$date[$key]= $row['date'];
			$notes[$key]= $row['notes'];
			$voice[$key]= $row['voice'];				
			
			echo "<tr><td>{$name[$key]}</td><td>{$mdn[$key]}</td><td>{$carrier[$key]}</td><td>{$meid[$key]}</td><td>{$version[$key]}</td><td>{$date[$key]}</td><td>{$notes[$key]}</td><td>{$voice[$key]}</td></tr>";			
		}
	}
	echo "</table>";
?>
			<tr>
				<td height="10" width="750">
				<img alt="" width="1" height="10" src="MsSpacer.gif"></td>
			</tr>
		</table>
		</td>
	</tr>


	<tr>


		<td valign="top" height="180" width="750">
		<!-- MSCellType="ContentBody" -->

		<!-- Create id, hide and finalize expandable content -->
		<ul id="addDevice">
		<li>Add New Device<ul>[/code]

Part 2

[php]<?php

if (isset($_POST['submit']))	 
{				

$platform= $_POST['platform']; //defining variable before use
$owner= $_POST['owner']; //defining variable before use

if ($platform=="Android") {
	if ($owner=="Mobile Team") {
//prepare 'mtand.txt' file for data	
$fh = fopen("mtand.txt","a+") or die("File Close"); }
}

if ($platform=="iOS") {
	if ($owner=="Mobile Team") {
//prepare 'mtios.txt' file for data	
$fh = fopen("mtios.txt","a+") or die("File Close"); }
}

if ($platform=="MISC") {
	if ($owner=="Mobile Team") {
//prepare 'mtmisc.txt' file for data	
$fh = fopen("mtmisc.txt","a+") or die("File Close"); }
}

if ($platform=="Android") {
	if ($owner=="Biz Dev") {
//prepare 'bdand.txt' file for data	
$fh = fopen("bdand.txt","a+") or die("File Close"); }
}

if ($platform=="iOS") {
	if ($owner=="Biz Dev") {
//prepare 'bdios.txt' file for data	
$fh = fopen("bdios.txt","a+") or die("File Close"); }
}

if ($platform=="MISC") {
	if ($owner=="Biz Dev") {
//prepare 'bdmisc.txt' file for data	
$fh = fopen("bdmisc.txt","a+") or die("File Close"); }
}


$name= $_POST['name'];		
$mdn= $_POST['mdn'];		
$carrier= $_POST['carrier'];		
$meid= $_POST['meid'];
$version= $_POST['version'];
$date= $_POST['date'];
$notes= $_POST['notes'];
$voice= $_POST['voice'];

/* $platform= $_POST['platform'] */
/* $owner= $_POST['owner'] */

//setup implementation rules for notes
$notes=stripslashes($notes);

//implement validation
if (empty($name)) {
print "<font color=#E00000><b> *Error: Must Fill Out All Fields! Mobile Device Information Not Stored</b><br>"; }
elseif (empty($mdn)) {
print "<font color=#E00000><b> *Error: Must Fill Out All Fields! Mobile Device Information Not Stored</b><br>"; }
elseif (empty($carrier)) {
print "<font color=#E00000><b> *Error: Must Fill Out All Fields! Mobile Device Information Not Stored</b><br>"; }
elseif (empty($meid)) {
print "<font color=#E00000><b> *Error: Must Fill Out All Fields! Mobile Device Information Not Stored</b><br>"; }
elseif (empty($version)) {
print "<font color=#E00000><b> *Error: Must Fill Out All Fields! Mobile Device Information Not Stored</b><br>"; }
elseif (empty($date)) {
print "<font color=#E00000><b> *Error: Must Fill Out All Fields! Mobile Device Information Not Stored</b><br>"; }

else {

//Retrieve the value of the hidden field
$form_secret = $_POST['form_secret']; /* isset($_POST["form_secret"])?$_POST["form_secret"]:''; */

if(isset($_SESSION['FORM_SECRET'])) {
if(strcasecmp($form_secret, $_SESSION['FORM_SECRET']) === 0) { /* if($_POST['secret'] == $_SESSION['secret']) { */

$mtandcount = '';
$mtioscount = '';
$mtmisccount = '';
$bdandcount = '';
$bdioscount = '';
$bdmisccount = '';

//assemble the data into a line variable		
$data= $name . ":" . $mdn . ":" . $carrier . ":" . $meid . ":" . $version . ":" . $date . ":" . $notes . ":" . $voice . ":" . "\r\n";		

//Figure out what choice was made so that data can be written to correct text file
if ($platform=="Android") {	
	 if ($owner=="Mobile Team") { 		
	print "<font color=#6699FF><b> *Successfully Added Device To <font color=#E00000>$owner ($platform)<font color=#6699FF> Category!</b><br>";
	
		//write the data to the file		
		fwrite($fh, $data);
		
		//counter for devices
		if ($fh = fopen('mtand.txt', 'r')) { 
			while (!feof($fh)) {
				if (fgets($fh)) {
					$mtandcount++;
							}
						}
					}
		/* adding a print or echo line here will show that $mtandcount is increasing properly */
		if ($mtandcount <= 1) {		
		print "<font color=#000000><b> Note: There Is $mtandcount Device Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
		} else {
		print "<font color=#000000><b> Note: There Are $mtandcount Devices Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
				}			
			}
		}
	
//Figure out what choice was made so that data can be written to correct text file
if ($platform=="iOS") {	
	 if ($owner=="Mobile Team") { 
	print "<font color=#6699FF><b> *Successfully Added Device To <font color=#E00000>$owner ($platform)<font color=#6699FF> Category!</b><br>";

		//write the data to the file		
		fwrite($fh, $data);
		
		//counter for devices
		if ($fh = fopen('mtios.txt', 'r')) { 
			while (!feof($fh)) {
				if (fgets($fh)) {
					$mtioscount++;
							}
						}
					}
		/* adding a print or echo line here will show that $mtioscount is increasing properly */
		if ($mtioscount <= 1) {		
		print "<font color=#000000><b> Note: There Is $mtioscount Device Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
		} else {
		print "<font color=#000000><b> Note: There Are $mtioscount Devices Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
				}			
			}
		}

//Figure out what choice was made so that data can be written to correct text file
if ($platform=="MISC") {	
	 if ($owner=="Mobile Team") { 
	print "<font color=#6699FF><b> *Successfully Added Device To <font color=#E00000>$owner ($platform)<font color=#6699FF> Category!</b><br>";

		//write the data to the file		
		fwrite($fh, $data);
		
		//counter for devices
		if ($fh = fopen('mtmisc.txt', 'r')) { 
			while (!feof($fh)) {
				if (fgets($fh)) {
					$mtmisccount++;
							}
						}
					}
		/* adding a print or echo line here will show that $mtmisccount is increasing properly */
		if ($mtmisccount <= 1) {		
		print "<font color=#000000><b> Note: There Is $mtmisccount Device Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
		} else {
		print "<font color=#000000><b> Note: There Are $mtmisccount Devices Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
				}			
			}
		}

//Figure out what choice was made so that data can be written to correct text file
if ($platform=="Android") {	
	 if ($owner=="Biz Dev") { 
	print "<font color=#6699FF><b> *Successfully Added Device To <font color=#E00000>$owner ($platform)<font color=#6699FF> Category!</b><br>";

		//write the data to the file		
		fwrite($fh, $data);
		
		//counter for devices
		if ($fh = fopen('bdand.txt', 'r')) { 
			while (!feof($fh)) {
				if (fgets($fh)) {
					$bdandcount++;
							}
						}
					}
		/* adding a print or echo line here will show that $bdandcount is increasing properly */
		if ($bdandcount <= 1) {		
		print "<font color=#000000><b> Note: There Is $bdandcount Device Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
		} else {
		print "<font color=#000000><b> Note: There Are $bdandcount Devices Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
				}			
			}
		}

//Figure out what choice was made so that data can be written to correct text file
if ($platform=="iOS") {	
	 if ($owner=="Biz Dev") { 
	print "<font color=#6699FF><b> *Successfully Added Device To <font color=#E00000>$owner ($platform)<font color=#6699FF> Category!</b><br>";

		//write the data to the file		
		fwrite($fh, $data);
		
		//counter for devices
		if ($fh = fopen('bdios.txt', 'r')) { 
			while (!feof($fh)) {
				if (fgets($fh)) {
					$bdioscount++;
							}
						}
					}
		/* adding a print or echo line here will show that $bdioscount is increasing properly */
		if ($bdioscount <= 1) {		
		print "<font color=#000000><b> Note: There Is $bdioscount Device Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
		} else {
		print "<font color=#000000><b> Note: There Are $bdioscount Devices Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
				}			
			}
		}

//Figure out what choice was made so that data can be written to correct text file
if ($platform=="MISC") {	
	 if ($owner=="Biz Dev") { 
	print "<font color=#6699FF><b> *Successfully Added Device To <font color=#E00000>$owner ($platform)<font color=#6699FF> Category!</b><br>";

		//write the data to the file		
		fwrite($fh, $data);
		
		//counter for devices
		if ($fh = fopen('bdmisc.txt', 'r')) { 
			while (!feof($fh)) {
				if (fgets($fh)) {
					$bdmisccount++;
							}
						}
					}
		/* adding a print or echo line here will show that $bdmisccount is increasing properly */
		if ($bdmisccount <= 1) {		
		print "<font color=#000000><b> Note: There Is $bdmisccount Device Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
		} else {
		print "<font color=#000000><b> Note: There Are $bdmisccount Devices Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
				}			
			}
		}

//close the file		
fclose($fh);	     

unset ($_SESSION["FORM_SECRET"]);

		}
	}

}

}
?>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />	
<style type="text/css">		
	body{			
		font: 10px Verdana, Arial, Helvetica, sans-serif;		
	}	
</style>
<?php $output = ''; //defining variable before use if($output!=""){ echo $output; } $secret=md5(uniqid(rand(), true)); //generate a random value $_SESSION['FORM_SECRET'] = $secret; //set the session ?> " method = "post">
<tr><td><b>Select Device Platform (Android/iOS/MISC):</b></td><td>		
<select name="platform" style="width:200px;"> 	
<option>Android</option>	
<option>iOS</option>
<option>MISC</option>		
</select></td></tr>

<tr><td><b>Select Device Owner (Mobile Team/Biz Dev):</b></td><td>		
<select name="owner" style="width:200px;"> 	
<option>Mobile Team</option>	
<option>Biz Dev</option>		
</select></td></tr>	
</table>	

<!-- echo the contents of hiddle field, FORM_SECRET, into the variable $_SESSION --> 
<input type="hidden" name="form_secret" id="form_secret" value="<?php echo $_SESSION['FORM_SECRET'];?>" />
<input type="submit" name="submit" value="Update" />
</div>
</tr>
</table>
    </ul>
</li>
[/php]
Enter Device Name:
Enter MDN:
Enter Carrier:
Enter MEID/IMEI:
Enter OS Version:
Enter Received Date:
Enter Notes:
Is Voice Enabled (Yes/No): Yes No

Well, I have been gone a lot lately. Just noticed you posted the next area of code issues…

The only main issue I see at first glance is your error messages. You test to see if ‘name’, ‘mdn’ etc is empty.
But, you give out the same error for each. You should change them to say something like:
if (empty($name)) {
print " *Error: Must Fill Out All Fields! Name missing! Information Not Stored
"; }
elseif (empty($mdn)) {
print " *Error: Must Fill Out All Fields! MDN missing! Information Not Stored
"; }

Something simple like adding the field name makes it much easier for the user to understand where
they went wrong.

As far as “deleting” records, that is not too hard to do. Using MySQL, it would be a simple query something
like $query="DELETE * FROM table-name WHERE item-number=$_GET[‘delete-number’]; Then run query.
(general terms not exact!) But, for text files it would be a little tricky. First, the delete code would be done
server-side because it is PHP. There are two easy ways to do this. Once the DELETE button has been pressed,
you can either rewrite the entire file with the current data. I think that is what you are doing now. Or, you can
remove the data from the current text file by locating it’s location and editing out that line of data. For your
current program, it is simpler just to rewrite the entire file.

So, basically, you would just save the file skipping the line of data that you want to delete. The save routines
are already in your code because you write the data to the file and then re-read it back in to display the new
version. You just need to check for the deleted item and re-save the file and re-read the file to display it again.

Hope that made sense! Now, what exactly can we help you with. I think you are nearly complete on this
project. Try to think out your re-saving without the deleted item and post the entire file again when you get
stuck on it. Good luck!

Yes, that makes sense and I am trying to do what you are saying. I can add items to my file, and delete it. But I am using a link as the action that initiates the delete entry. It is not working correctly. I need more direct help on this. Copy and paste my code into one single text file, sandbox the file, and test it out. You will see what I mean. Add 1 item, refresh the page, click on the Delete text and my issue will come to light. I am being led to a page with added =?delete=0 at the end of the URL. That is not my real page. I don’t know how to fix, I have tried independantly for a while. Anyone with suggestions?

Part 1 Code (Copy and paste into one text file). Name your text file as “indexNew”

[code]<?php
session_start(); //start a session

error_reporting(E_ALL); //E_ALL ^ E_NOTICE
ini_set(‘display_errors’,‘1’); //Initialize custom debugging function
?>

Device Manager
<?php		
	
	print "<font size='6'>DEVICE INVENTORY (Android): MOBILE TEAM</font><br>";

	$textfile = 'mtand.txt';
	$data = ''; //defining variable before use

  if (file_exists($textfile) && is_readable($textfile))      
  {         
     $file = file($textfile);      

     foreach ($file as $line)
     {
        //separate each element and store in temp array.      
        $tmp = explode(":", $line);               

        //assign each element to array.        
        $data[] = array('name' => $tmp[0], 'mdn' => $tmp[1], 'carrier' => $tmp[2], 'meid' => $tmp[3], 'version' => $tmp[4], 'date' => $tmp[5], 'notes' => $tmp[6], 'voice' => $tmp[7]);      
     }  

}

	echo "<table cellspacing='0' cellpadding='14'>";		
	if ($data!=""){			
		echo "<tr><th style='background:#6699FF'>Device Name</th><th style='background:#6699FF'>MDN</th><th style='background:#6699FF'>Carrier</th><th style='background:#6699FF'>MEID/IMEI</th><th style='background:#6699FF'>OS Version</th><th style='background:#6699FF'>Received Date</th><th style='background:#6699FF'>Notes</th><th style='background:#6699FF'>Voice</th></tr>";			
		foreach ($data as $key => $row)			
		{				

			$name[$key]= $row['name'];		
			$mdn[$key]= $row['mdn'];		
			$carrier[$key]= $row['carrier'];		
			$meid[$key]= $row['meid'];
			$version[$key]= $row['version'];
			$date[$key]= $row['date'];
			$notes[$key]= $row['notes'];
			$voice[$key]= $row['voice'];				
			
			echo "<tr><td>{$name[$key]}</td><td>{$mdn[$key]}</td><td>{$carrier[$key]}</td><td>{$meid[$key]}</td><td>{$version[$key]}</td><td>{$date[$key]}</td><td>{$notes[$key]}</td><td>{$voice[$key]}</td></tr>";			
		}
	}
	echo "</table>";

$return = “indexNew2.htm”;
$delete = @$_GET[‘delete’];
$textFile = file(“mtand.txt”);
$lines = count($textFile);

if($delete != “” && $delete >! $lines || $delete === ‘0’) {
$textFile[$delete] = “”;
$fileUpdate = fopen(“mtand.txt”, “wb”);
for($a=0; $a<$lines; $a++) {
fwrite($fileUpdate, $textFile[$a]);
}
fclose($fileUpdate);
header(“location:$return”);
exit;
}

foreach($textFile as $key => $val) {
$line ="<a href =?delete=$key>[ DELETE ]
";
}
echo $line;

?>

<?php		
	
	print "<font size='6'>DEVICE INVENTORY (iOS): MOBILE TEAM</font><br>";

	$textfile = 'mtios.txt';
	$data = ''; //defining variable before use

  if (file_exists($textfile) && is_readable($textfile))      
  {         
     $file = file($textfile);      

     foreach ($file as $line)
     {
        //separate each element and store in temp array.      
        $tmp = explode(":", $line);               

        //assign each element to array.        
        $data[] = array('name' => $tmp[0], 'mdn' => $tmp[1], 'carrier' => $tmp[2], 'meid' => $tmp[3], 'version' => $tmp[4], 'date' => $tmp[5], 'notes' => $tmp[6], 'voice' => $tmp[7]);      
     }  

}

	echo "<table cellspacing='0' cellpadding='14'>";		
	if ($data!=""){			
		echo "<tr><th style='background:#6699FF'>Device Name</th><th style='background:#6699FF'>MDN</th><th style='background:#6699FF'>Carrier</th><th style='background:#6699FF'>MEID/IMEI</th><th style='background:#6699FF'>OS Version</th><th style='background:#6699FF'>Received Date</th><th style='background:#6699FF'>Notes</th><th style='background:#6699FF'>Voice</th></tr>";			
		foreach ($data as $key => $row)			
		{				

			$name[$key]= $row['name'];		
			$mdn[$key]= $row['mdn'];		
			$carrier[$key]= $row['carrier'];		
			$meid[$key]= $row['meid'];
			$version[$key]= $row['version'];
			$date[$key]= $row['date'];
			$notes[$key]= $row['notes'];
			$voice[$key]= $row['voice'];				
			
			echo "<tr><td>{$name[$key]}</td><td>{$mdn[$key]}</td><td>{$carrier[$key]}</td><td>{$meid[$key]}</td><td>{$version[$key]}</td><td>{$date[$key]}</td><td>{$notes[$key]}</td><td>{$voice[$key]}</td></tr>";			
		}
	}
	echo "</table>";
?>

<?php		
	
	print "<font size='6'>DEVICE INVENTORY (MISC): MOBILE TEAM</font><br>";

	$textfile = 'mtmisc.txt';
	$data = ''; //defining variable before use

  if (file_exists($textfile) && is_readable($textfile))      
  {         
     $file = file($textfile);      

     foreach ($file as $line)
     {
        //separate each element and store in temp array.      
        $tmp = explode(":", $line);               

        //assign each element to array.        
        $data[] = array('name' => $tmp[0], 'mdn' => $tmp[1], 'carrier' => $tmp[2], 'meid' => $tmp[3], 'version' => $tmp[4], 'date' => $tmp[5], 'notes' => $tmp[6], 'voice' => $tmp[7]);      
     }  

}

	echo "<table cellspacing='0' cellpadding='14'>";		
	if ($data!=""){			
		echo "<tr><th style='background:#6699FF'>Device Name</th><th style='background:#6699FF'>MDN</th><th style='background:#6699FF'>Carrier</th><th style='background:#6699FF'>MEID/IMEI</th><th style='background:#6699FF'>OS Version</th><th style='background:#6699FF'>Received Date</th><th style='background:#6699FF'>Notes</th><th style='background:#6699FF'>Voice</th></tr>";			
		foreach ($data as $key => $row)			
		{				

			$name[$key]= $row['name'];		
			$mdn[$key]= $row['mdn'];		
			$carrier[$key]= $row['carrier'];		
			$meid[$key]= $row['meid'];
			$version[$key]= $row['version'];
			$date[$key]= $row['date'];
			$notes[$key]= $row['notes'];
			$voice[$key]= $row['voice'];				
			
			echo "<tr><td>{$name[$key]}</td><td>{$mdn[$key]}</td><td>{$carrier[$key]}</td><td>{$meid[$key]}</td><td>{$version[$key]}</td><td>{$date[$key]}</td><td>{$notes[$key]}</td><td>{$voice[$key]}</td></tr>";			
		}
	}
	echo "</table>";
?>

<?php		
	
	print "<font size='6'>DEVICE INVENTORY (Android): BIZ DEV</font><br>";

	$textfile = 'bdand.txt';
	$data = ''; //defining variable before use

  if (file_exists($textfile) && is_readable($textfile))      
  {         
     $file = file($textfile);      

     foreach ($file as $line)
     {
        //separate each element and store in temp array.      
        $tmp = explode(":", $line);               

        //assign each element to array.        
        $data[] = array('name' => $tmp[0], 'mdn' => $tmp[1], 'carrier' => $tmp[2], 'meid' => $tmp[3], 'version' => $tmp[4], 'date' => $tmp[5], 'notes' => $tmp[6], 'voice' => $tmp[7]);      
     }  

}

	echo "<table cellspacing='0' cellpadding='14'>";		
	if ($data!=""){			
		echo "<tr><th style='background:#A6A6A6'>Device Name</th><th style='background:#A6A6A6'>MDN</th><th style='background:#A6A6A6'>Carrier</th><th style='background:#A6A6A6'>MEID/IMEI</th><th style='background:#A6A6A6'>OS Version</th><th style='background:#A6A6A6'>Received Date</th><th style='background:#A6A6A6'>Notes</th><th style='background:#A6A6A6'>Voice</th></tr>";			
		foreach ($data as $key => $row)			
		{				

			$name[$key]= $row['name'];		
			$mdn[$key]= $row['mdn'];		
			$carrier[$key]= $row['carrier'];		
			$meid[$key]= $row['meid'];
			$version[$key]= $row['version'];
			$date[$key]= $row['date'];
			$notes[$key]= $row['notes'];
			$voice[$key]= $row['voice'];				
			
			echo "<tr><td>{$name[$key]}</td><td>{$mdn[$key]}</td><td>{$carrier[$key]}</td><td>{$meid[$key]}</td><td>{$version[$key]}</td><td>{$date[$key]}</td><td>{$notes[$key]}</td><td>{$voice[$key]}</td></tr>";			
		}
	}
	echo "</table>";
?>

<?php		
	
	print "<font size='6'>DEVICE INVENTORY (iOS): BIZ DEV</font><br>";

	$textfile = 'bdios.txt';
	$data = ''; //defining variable before use

  if (file_exists($textfile) && is_readable($textfile))      
  {         
     $file = file($textfile);      

     foreach ($file as $line)
     {
        //separate each element and store in temp array.      
        $tmp = explode(":", $line);               

        //assign each element to array.        
        $data[] = array('name' => $tmp[0], 'mdn' => $tmp[1], 'carrier' => $tmp[2], 'meid' => $tmp[3], 'version' => $tmp[4], 'date' => $tmp[5], 'notes' => $tmp[6], 'voice' => $tmp[7]);      
     }  

}

	echo "<table cellspacing='0' cellpadding='14'>";		
	if ($data!=""){			
		echo "<tr><th style='background:#A6A6A6'>Device Name</th><th style='background:#A6A6A6'>MDN</th><th style='background:#A6A6A6'>Carrier</th><th style='background:#A6A6A6'>MEID/IMEI</th><th style='background:#A6A6A6'>OS Version</th><th style='background:#A6A6A6'>Received Date</th><th style='background:#A6A6A6'>Notes</th><th style='background:#A6A6A6'>Voice</th></tr>";			
		foreach ($data as $key => $row)			
		{				

			$name[$key]= $row['name'];		
			$mdn[$key]= $row['mdn'];		
			$carrier[$key]= $row['carrier'];		
			$meid[$key]= $row['meid'];
			$version[$key]= $row['version'];
			$date[$key]= $row['date'];
			$notes[$key]= $row['notes'];
			$voice[$key]= $row['voice'];				
			
			echo "<tr><td>{$name[$key]}</td><td>{$mdn[$key]}</td><td>{$carrier[$key]}</td><td>{$meid[$key]}</td><td>{$version[$key]}</td><td>{$date[$key]}</td><td>{$notes[$key]}</td><td>{$voice[$key]}</td></tr>";			
		}
	}
	echo "</table>";
?>

<?php		
	
	print "<font size='6'>DEVICE INVENTORY (MISC): BIZ DEV</font><br>";

	$textfile = 'bdmisc.txt';
	$data = ''; //defining variable before use

  if (file_exists($textfile) && is_readable($textfile))      
  {         
     $file = file($textfile);      

     foreach ($file as $line)
     {
        //separate each element and store in temp array.      
        $tmp = explode(":", $line);               

        //assign each element to array.        
        $data[] = array('name' => $tmp[0], 'mdn' => $tmp[1], 'carrier' => $tmp[2], 'meid' => $tmp[3], 'version' => $tmp[4], 'date' => $tmp[5], 'notes' => $tmp[6], 'voice' => $tmp[7]);      
     }  

}

	echo "<table cellspacing='0' cellpadding='14'>";		
	if ($data!=""){			
		echo "<tr><th style='background:#A6A6A6'>Device Name</th><th style='background:#A6A6A6'>MDN</th><th style='background:#A6A6A6'>Carrier</th><th style='background:#A6A6A6'>MEID/IMEI</th><th style='background:#A6A6A6'>OS Version</th><th style='background:#A6A6A6'>Received Date</th><th style='background:#A6A6A6'>Notes</th><th style='background:#A6A6A6'>Voice</th></tr>";			
		foreach ($data as $key => $row)			
		{				

			$name[$key]= $row['name'];		
			$mdn[$key]= $row['mdn'];		
			$carrier[$key]= $row['carrier'];		
			$meid[$key]= $row['meid'];
			$version[$key]= $row['version'];
			$date[$key]= $row['date'];
			$notes[$key]= $row['notes'];
			$voice[$key]= $row['voice'];				
			
			echo "<tr><td>{$name[$key]}</td><td>{$mdn[$key]}</td><td>{$carrier[$key]}</td><td>{$meid[$key]}</td><td>{$version[$key]}</td><td>{$date[$key]}</td><td>{$notes[$key]}</td><td>{$voice[$key]}</td></tr>";			
		}
	}
	echo "</table>";
?>[/code]

Pay close attention to (WARNING: Don’t recopy this part) [code]$return = “indexNew2.htm”;
$delete = @$_GET[‘delete’];
$textFile = file(“mtand.txt”);
$lines = count($textFile);

if($delete != “” && $delete >! $lines || $delete === ‘0’) {
$textFile[$delete] = “”;
$fileUpdate = fopen(“mtand.txt”, “wb”);
for($a=0; $a<$lines; $a++) {
fwrite($fileUpdate, $textFile[$a]);
}
fclose($fileUpdate);
header(“location:$return”);
exit;[/code]

That is where my mistake is, I know.

Code Part Two. Copy the rest of the code in the same file, underneath the first half.

[code]<?php

if (isset($_POST['submit']))	 
{				

$platform= $_POST['platform']; //defining variable before use
$owner= $_POST['owner']; //defining variable before use

if ($platform=="Android") {
	if ($owner=="Mobile Team") {
//prepare 'mtand.txt' file for data	
$fh = fopen("mtand.txt","a+") or die("File Close"); }
}

if ($platform=="iOS") {
	if ($owner=="Mobile Team") {
//prepare 'mtios.txt' file for data	
$fh = fopen("mtios.txt","a+") or die("File Close"); }
}

if ($platform=="MISC") {
	if ($owner=="Mobile Team") {
//prepare 'mtmisc.txt' file for data	
$fh = fopen("mtmisc.txt","a+") or die("File Close"); }
}

if ($platform=="Android") {
	if ($owner=="Biz Dev") {
//prepare 'bdand.txt' file for data	
$fh = fopen("bdand.txt","a+") or die("File Close"); }
}

if ($platform=="iOS") {
	if ($owner=="Biz Dev") {
//prepare 'bdios.txt' file for data	
$fh = fopen("bdios.txt","a+") or die("File Close"); }
}

if ($platform=="MISC") {
	if ($owner=="Biz Dev") {
//prepare 'bdmisc.txt' file for data	
$fh = fopen("bdmisc.txt","a+") or die("File Close"); }
}


$name= $_POST['name'];		
$mdn= $_POST['mdn'];		
$carrier= $_POST['carrier'];		
$meid= $_POST['meid'];
$version= $_POST['version'];
$date= $_POST['date'];
$notes= $_POST['notes'];
$voice= $_POST['voice'];

/* $platform= $_POST['platform'] */
/* $owner= $_POST['owner'] */

//setup implementation rules for notes
$notes=stripslashes($notes);

//implement validation
if (empty($name)) {
print "<font color=#E00000><b> *Error: Must Fill Out All Fields! Mobile Device Information Not Stored</b><br>"; }
elseif (empty($mdn)) {
print "<font color=#E00000><b> *Error: Must Fill Out All Fields! Mobile Device Information Not Stored</b><br>"; }
elseif (empty($carrier)) {
print "<font color=#E00000><b> *Error: Must Fill Out All Fields! Mobile Device Information Not Stored</b><br>"; }
elseif (empty($meid)) {
print "<font color=#E00000><b> *Error: Must Fill Out All Fields! Mobile Device Information Not Stored</b><br>"; }
elseif (empty($version)) {
print "<font color=#E00000><b> *Error: Must Fill Out All Fields! Mobile Device Information Not Stored</b><br>"; }
elseif (empty($date)) {
print "<font color=#E00000><b> *Error: Must Fill Out All Fields! Mobile Device Information Not Stored</b><br>"; }

else {

//Retrieve the value of the hidden field
$form_secret = $_POST['form_secret']; /* isset($_POST["form_secret"])?$_POST["form_secret"]:''; */

if(isset($_SESSION['FORM_SECRET'])) {
if(strcasecmp($form_secret, $_SESSION['FORM_SECRET']) === 0) { /* if($_POST['secret'] == $_SESSION['secret']) { */

$mtandcount = '';
$mtioscount = '';
$mtmisccount = '';
$bdandcount = '';
$bdioscount = '';
$bdmisccount = '';

//assemble the data into a line variable		
$data= $name . ":" . $mdn . ":" . $carrier . ":" . $meid . ":" . $version . ":" . $date . ":" . $notes . ":" . $voice . ":" . "\r\n";		

//Figure out what choice was made so that data can be written to correct text file
if ($platform=="Android") {	
	 if ($owner=="Mobile Team") { 		
	print "<font color=#6699FF><b> *Successfully Added Device To <font color=#E00000>$owner ($platform)<font color=#6699FF> Category!</b><br>";
	
		//write the data to the file		
		fwrite($fh, $data);
		
		//counter for devices
		if ($fh = fopen('mtand.txt', 'r')) { 
			while (!feof($fh)) {
				if (fgets($fh)) {
					$mtandcount++;
							}
						}
					}
		/* adding a print or echo line here will show that $mtandcount is increasing properly */
		if ($mtandcount <= 1) {		
		print "<font color=#000000><b> Note: There Is $mtandcount Device Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
		} else {
		print "<font color=#000000><b> Note: There Are $mtandcount Devices Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
				}			
			}
		}
	
//Figure out what choice was made so that data can be written to correct text file
if ($platform=="iOS") {	
	 if ($owner=="Mobile Team") { 
	print "<font color=#6699FF><b> *Successfully Added Device To <font color=#E00000>$owner ($platform)<font color=#6699FF> Category!</b><br>";

		//write the data to the file		
		fwrite($fh, $data);
		
		//counter for devices
		if ($fh = fopen('mtios.txt', 'r')) { 
			while (!feof($fh)) {
				if (fgets($fh)) {
					$mtioscount++;
							}
						}
					}
		/* adding a print or echo line here will show that $mtioscount is increasing properly */
		if ($mtioscount <= 1) {		
		print "<font color=#000000><b> Note: There Is $mtioscount Device Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
		} else {
		print "<font color=#000000><b> Note: There Are $mtioscount Devices Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
				}			
			}
		}

//Figure out what choice was made so that data can be written to correct text file
if ($platform=="MISC") {	
	 if ($owner=="Mobile Team") { 
	print "<font color=#6699FF><b> *Successfully Added Device To <font color=#E00000>$owner ($platform)<font color=#6699FF> Category!</b><br>";

		//write the data to the file		
		fwrite($fh, $data);
		
		//counter for devices
		if ($fh = fopen('mtmisc.txt', 'r')) { 
			while (!feof($fh)) {
				if (fgets($fh)) {
					$mtmisccount++;
							}
						}
					}
		/* adding a print or echo line here will show that $mtmisccount is increasing properly */
		if ($mtmisccount <= 1) {		
		print "<font color=#000000><b> Note: There Is $mtmisccount Device Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
		} else {
		print "<font color=#000000><b> Note: There Are $mtmisccount Devices Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
				}			
			}
		}

//Figure out what choice was made so that data can be written to correct text file
if ($platform=="Android") {	
	 if ($owner=="Biz Dev") { 
	print "<font color=#6699FF><b> *Successfully Added Device To <font color=#E00000>$owner ($platform)<font color=#6699FF> Category!</b><br>";

		//write the data to the file		
		fwrite($fh, $data);
		
		//counter for devices
		if ($fh = fopen('bdand.txt', 'r')) { 
			while (!feof($fh)) {
				if (fgets($fh)) {
					$bdandcount++;
							}
						}
					}
		/* adding a print or echo line here will show that $bdandcount is increasing properly */
		if ($bdandcount <= 1) {		
		print "<font color=#000000><b> Note: There Is $bdandcount Device Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
		} else {
		print "<font color=#000000><b> Note: There Are $bdandcount Devices Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
				}			
			}
		}

//Figure out what choice was made so that data can be written to correct text file
if ($platform=="iOS") {	
	 if ($owner=="Biz Dev") { 
	print "<font color=#6699FF><b> *Successfully Added Device To <font color=#E00000>$owner ($platform)<font color=#6699FF> Category!</b><br>";

		//write the data to the file		
		fwrite($fh, $data);
		
		//counter for devices
		if ($fh = fopen('bdios.txt', 'r')) { 
			while (!feof($fh)) {
				if (fgets($fh)) {
					$bdioscount++;
							}
						}
					}
		/* adding a print or echo line here will show that $bdioscount is increasing properly */
		if ($bdioscount <= 1) {		
		print "<font color=#000000><b> Note: There Is $bdioscount Device Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
		} else {
		print "<font color=#000000><b> Note: There Are $bdioscount Devices Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
				}			
			}
		}

//Figure out what choice was made so that data can be written to correct text file
if ($platform=="MISC") {	
	 if ($owner=="Biz Dev") { 
	print "<font color=#6699FF><b> *Successfully Added Device To <font color=#E00000>$owner ($platform)<font color=#6699FF> Category!</b><br>";

		//write the data to the file		
		fwrite($fh, $data);
		
		//counter for devices
		if ($fh = fopen('bdmisc.txt', 'r')) { 
			while (!feof($fh)) {
				if (fgets($fh)) {
					$bdmisccount++;
							}
						}
					}
		/* adding a print or echo line here will show that $bdmisccount is increasing properly */
		if ($bdmisccount <= 1) {		
		print "<font color=#000000><b> Note: There Is $bdmisccount Device Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
		} else {
		print "<font color=#000000><b> Note: There Are $bdmisccount Devices Stored In <font color=#E00000>$owner ($platform)<font color=#000000> Database (Refresh Page)</b><br>";
				}			
			}
		}

//close the file		
fclose($fh);	     

unset ($_SESSION["FORM_SECRET"]);

		}
	}

}

}
?>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />	
<style type="text/css">		
	body{			
		font: 10px Verdana, Arial, Helvetica, sans-serif;		
	}	
</style>
<?php $output = ''; //defining variable before use if($output!=""){ echo $output; } $secret=md5(uniqid(rand(), true)); //generate a random value $_SESSION['FORM_SECRET'] = $secret; //set the session ?> " method = "post">
<tr><td><b>Select Device Platform (Android/iOS/MISC):</b></td><td>		
<select name="platform" style="width:200px;"> 	
<option>Android</option>	
<option>iOS</option>
<option>MISC</option>		
</select></td></tr>

<tr><td><b>Select Device Owner (Mobile Team/Biz Dev):</b></td><td>		
<select name="owner" style="width:200px;"> 	
<option>Mobile Team</option>	
<option>Biz Dev</option>		
</select></td></tr>	
</table>	

<!-- echo the contents of hiddle field, FORM_SECRET, into the variable $_SESSION --> 
<input type="hidden" name="form_secret" id="form_secret" value="<?php echo $_SESSION['FORM_SECRET'];?>" />
<input type="submit" name="submit" value="Update" />
</div>
Enter Device Name:
Enter MDN:
Enter Carrier:
Enter MEID/IMEI:
Enter OS Version:
Enter Received Date:
Enter Notes:
Is Voice Enabled (Yes/No): Yes No
[/code]

[quote author=phpBeginner1 link=topic=16738.msg56427#msg56427 date=1339548490]
Part 1 Code (Copy and paste into one text file). Name your text file as “indexNew”

Name your file “indexNew2.htm”. Sorry, no edit of posts once sent. Now you will see what I see.

I will be available later today and will try to sort your error out.

Sorry, I was busy with a sick family member. Sorry for the delay…

At first look it is just the way you are trying to delete the item. I think there is a better way, but, will have to test it later this afternoon. More then…

Hello, sorry, I have been gone for so long. Sick mother…

Did you get your code fixed up? If not let me know what errors you are still sorting out…

If so, congrats…

Sponsor our Newsletter | Privacy Policy | Terms of Service