Im trying to learn how to place a read file line by line and prevent duplicate entries and also BLANK entries, into my process php script,
using feof, I have failed many times and get so many errors such as syntax expecting . or , and so forth
this is my process.php
<?php
$File = "links.txt";
$Handle = fopen($File, 'a');
$Data = "".$_POST['ID'];
fwrite($Handle, $Data."n");
print "Data Addedn";
fclose($Handle);
?>
<?php
countLines("links.txt");
function countLines($filepath)
{
$handle = fopen( $filepath, "r" );
$count = 0;
while( fgets($handle) )
{
$count++;
}
fclose($handle);
return $count;
}
?>
<head>
<meta http-equiv="REFRESH" content="5;test1.php"></HEAD>
please wait... navigating back!
I got fed up and deleted all my work, to start from scratch,
if feof($_POST['ID'])
{
alert 'Already entered';
return;
}
that was just one of my attempts
also im unsure if putting in /n would make it look for /n or new line, if it looks for new line and every file has the new line marker would it always return as the data was already entered?
Thanks in advance for assistance/teaching
Preloading images
Posting this question here because I am not sure where this should belong.I am building an asp.net ajax web site with lots of media elements and I would like to make my image loading work smoother. I
Sessions Value Not Saved
Hi,Im making a login form and im using this code:Code: if($login=="true"){$_SESSION['mlvl']=1;if($username=="admin"){$_SESSION['admin']=1;}else{$_SESSION['admin']=0;}}but when the
Better Method of a Member Cloud
I assume most people know how tag clouds work, where the tags most used are bigger and the least used tags are smaller. This is the basic function of my member cloud. I created the code below from
Receive Rosettanet Message to SAP 4.6c
Dear all ,
php + mysql count consecutive data
I have a database of values and I want to work out how to display them if the values match a consecutive pattern.For example, I might have the table "eggs" with the values "1",
Comparing MySql data and arrays.
I have a mysql table set up like this:idsubjectbodyuseriddatetimetags1blog subjectblog body111|29|20099|30|AMblog,site news,techwhen displaying the data i want to be able to add
help with calculations on a flat text file
hello,I have this code below that is attached to a flat file like this:Email:LastName:FirstName:Assignment1,100:Assignment2,100:Quiz1,50someone@email.com:Doe:John:85:93:45Here is the code:
Save User Inputs while javascript reloading!
hi..i have written a PHP code in which i reload the page when user selects a value in dropdown...Code: function reload(form){var
.htpasswd Registration Form
Hi,I wanted to make an htpasswd registration form.I found this code on the internet but have no idea how to use it.Can anyone help?<?php// Register Userfunction regUser() { $filename
Loop column after 2 results
Hello All.Here is what I have:Client ID Company name Client ID Company nameI then need a script to echo 2 results per row then start a new row.I've tried many