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>
getting weird error..
okay, I'm getting an error on this particular function, something about the syntax in the mysql LIMIT statement, but as far as I can see I have it right, currently using easymysql3.0 as test server,
Am i doing this wrong?
Im pulling from an Oracle database some info... one of which is a field count_pnums which is a NUMBER type field.Code: <?php$sql_E = "SELECT count_pnums, dist_pnums FROM
Alternate messaging
I have 4 strings in MySQL db1$string1 : Hello$string2 : Hi$string3 : Great$string4 : ThanksAnd I have 3 accounts MySQL db2$User1 : $Pw1$User2 : $Pw2$User3 : $Pw3expected result---------------Hello
Help with usergroups? prolly really quick
So were coding our own forums for a game system we made an we have the users level setup but now I need to make it do user groups. See the groups are defined by numbers:0 - banned1 - registered2 -
Month String to Numeric?
Hi guys,Given a month as a string, is there a simple way to find the numeric representation of said month?I've used a switch statement but I'm wondring if there is a more elegant way of doing
Using real time in php
I'm very average at PHP and im looking to introduce time to something on my site.Its a sports site and everyone has fixtures. I have them so they are created and put into a table, what I now want to
Save username into DB
OkaY so I got my blog to actually save the posts and whatever, all I need now is for it to keep the right posted. That database is set up to keep post id, title, subject, date, and author. The only
Save cookie to DB
I'm working on a pixel tracking script for an incentive website and I need to use an ASP script to save the cookie from the user to a MySQL DB via a 1 pixel image, such as follows.<img
Any decent php formatter/beautifier/pretty printer?
Any decent php formatter/beautifier/pretty printer class/function?I found the following whilst
Random Number Generation And Probability
Hello, I am working on a function which has to insert data into a SQL table.we have to supply the function with number of entry needs to be inserted into the database and the work of the function is