View Single Post
  #2 (permalink)  
Old 06-16-04, 08:37 AM
Worm's Avatar
Worm Worm is offline
Newbie Coder
 
Join Date: Jun 2004
Location: Germany, Frankfurt am Main
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Bonzo
I think I am totaly lost again !!

I have a form that I want to use to create a php settings type page, I am doing it this way as people may not be happy altering php code !

PHP Code:

// Form

<form enctype="multipart/form-data" ACTION="write.php" method=POST>
  Upload directory : <input name="normal" size="60" type="text" value=" <?php echo $server.$base_url?>/up"><br>
<input name="submit" size="20" type="Submit">
<input name="reset" size="20" type="Reset">
</form>

// Write to text file
$filename = 'data.txt'; // Save information to this file
if (file_exists("$filename")):   // IF data.txt File exists
  $cartFile = fopen("$filename","a[b]");   // Open data.txt File
  fputs($cartFile,$normal);   // Write data (put) to File
  fclose($cartFile);   // Close data.txt File
else:
  $cartFile = fopen("$filename","a[b]");   // IF data.txt doesn't exists - create it!
  fputs($cartFile,$normal);
  fclose($cartFile);
endif;
This all basicly works OK.

The problem then is that I cant pass e.g. $normal=public_html........ as the "$" gives a problem.

So I thought pass the "public_html........ " in the text file and then link it to the $normal in the php code but I have a problem with the "$" here as well which means joining then adding the after "$" which is all a bit long winded.

Can anyone help ?

Anthony
I read your code and I read your problem but i couldnt understand it. Could you explain what you mean with: "... i get a problem with the "$" ... " ?
Reply With Quote