I made this form and I need it to read the data and write the data to a table and its not working can someone please help me and show me what I have wrong so I can fix it
heres the html form I left off the doc type so it dont take up that much room
<form>
<h1>Telephone Directory</h1>
<table align='Left'>
<tr>
<td>LastName</td>
<td><input name='LastName' /></td>
</tr>
<tr>
<td>FirstName</td>
<td><input name='FirstName' /></td>
</tr>
<tr>
<td>StreetAddress</td>
<td><input name='StreetAddress' /></td>
</tr>
<tr>
<td>City</td>
<td><input name='City' /></td>
</tr>
<tr>
<td>State</td>
<td><input name='State' /></td>
</tr>
<tr>
<td>Zip</td>
<td><input name='Zip' /></td>
</tr>
<tr>
<td>AreaCode</td>
<td><input name='AreaCode' /></td>
</tr>
<tr>
<td>PhoneNumber</td>
<td><input name='PhoneNumber' /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Submit" /></td>
<td><a href="Telephonewrite.php">ReadFile</a></td>
</tr>
</table>
</form>
</body>
</html>
php.file to read
<body>
<h1>Telephone Directory</h1>
<?php
$fileHandle=fopen("read.txt","r");
readfile("read.txt");
$record=fgets($fileHandle);
echo("<table><tr><td>FirstName</td><td>LastName</td><td>StreetAddress</td><td>City</td><td>State</td>
<td>Zip</td><td>AreaCode</td><td>PhoneNumber</td></tr>");
while(!feof($fileHandle))
{
$myArray=explode("|",$record);
echo "<tr><td>$myArray[0]</td><td>$myArray[1]</td></tr>";
$record =fgets($fileHandle);
$record =fgets($LastName);
$record =fgets($FirstName);
$record =fgets($StreetAddress);
$record =fgets($City);
$record =fgets($State);
$record =fgets($Zip);
$record =fgets($AreaCode);
$record =fgets($PhoneNumber);
}
echo "</table>"
?>
</body>
</html>
the php file to write
<body>
<h1>Telephone Directory</h1>
<hr />
<?php
if(isset($_GET['PhoneNumber']) && isset($_GET['LastName'])) {
$LastName = $_GET['LastName'];
$FirstName = $_GET['FirstName'];
$StreetAdress = $_GET['StreetAddress'];
$City = $_GET['City'];
$State = $_GET['State'];
$Zip = $_GET['Zip'];
$AreaCode = $_GET['AreaCode'];
$PhoneNumber = $_GET['PhoneNumber'];
$record=$LastName. "|";
$record=$FirstName. "|";
$record .="rn";
$fileHandle = fopen("read.txt","a");
readfile("read.txt");
if(fwrite($read, $record)>0)
echo "<p>your entry was successfully added to the file</p>";
else
echo "<p>No data was written, please return to the form</p>";
fclose($fileHandle);
}
?>
<a href="Telephone.html">Form</a>
</body>
</html>
2 decima places & How to reload my page
Hello There,How do i put full-stop (.) after second figure from behind? ie if i have 123456 in my database and i want it to echo as 1234.56Secondly, am designing a shopping website. I want the pages
Images outside webroot
Im hopeing someone can help me with this because i cant figure it out.I have setup an ASP.NET website in C# that allows end users to upload files to the server. I am able to save these files outside
Remove values in array2 from array1
I have two arrays.Array 1 is where the array key holds various different numbers. For example:Code: [Select]$array[32] = 1;$array[122] = 1;$array[238] = 1;$array[324] = 1;The other array holds values
Weird MySQL error, why am I recieving this?
PHP Code:<?php require "global_settings.php"; ?><title><?php echo $sitetitle; ?></title><center><style
help with Get_
ok some how this is not working i am not sure what i am doing wrong here but what this does is when the user goes to Secret-Codes.php they get a menu and when they pick the phone they want to view it
SAP Logon Failed
I tried to login to SAP through MMC.
Adding Outlook 2007 items via file upload
I am looking for a way to be able to attach an Outlook item (an email message) in an ASP.NET 3.5 application. Similar to when in Outlook and sending an attachment, you can select either a file, or an
if statements problems
Hi. I'm trying to make a web form, but I kind of hit a dead end trying to figure out why it doesn't work. Basically, I'm trying to read from a file and then populate the form according to the file.The
natcasesort works on one server but not on another
HiI have a problem that I was hoping that someone can help me with.I'm trying to use natcasesort() to sort an array. This works fine on my laptop (which I use for testing and which uses php 5.2.6),
issues verifying if user is logged in
I am having issues when a user logs in via asp Login control, the IsAuthenticated still seems to come up false... ( yes the username and password is correct)