View Single Post
Old 03-06-2008, 08:14 AM  
Chris
Too lazy to set a custom title
 
Chris's Avatar
 
Industry Role:
Join Date: May 2003
Location: icq: 71462500 Skype: Jupzchris
Posts: 27,880
i already have one code but it doesnt work on my server

Code:
<HTML>
<HEAD><TITLE></TITLE></HEAD>
<BODY>
<?
if ($_POST['data'] != "") {
  $filedata=@explode(",",@file_get_contents("file.txt"));
  if ($filedata != "") {
    if (array_search($_POST['data'],$filedata) == FALSE) {
      $filedata[]=$_POST['data'];
      file_put_contents("file.txt",implode(","$filedata));
      echo "<h2>data added to file</h2><br /><br />";
    } else {
      echo "<h2>data already exists in file</h2><br /><br />";
    }
  } else {
      $filedata=array();
      $filedata[]=$_POST['data'];
      file_put_contents("file.txt",implode(","$filedata));
      echo "<h2>data added to file</h2><br /><br />";
  }
}


?>

<FORM method="post" action="<? echo($_SERVER['PHP_SELF']); ?>">
<input type="text" size="30" maxlength="255" name="data">
</FORM>
</BODY>
</HTML>
spits out Parse error: syntax error, unexpected T_VARIABLE in /usr/www/virtual/jupzchris/www.jupzchris.com/email.php on line 10
__________________
[email protected]
Chris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote