Jump to content

mbellian

Members
  • Posts

    4
  • Joined

  • Last visited

mbellian's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. when i try stooney's example i get Warning: file() [function.file]: Filename cannot be empty in D:\Hosting\7754912\html\new\samplephpsubmit1.php on line 98 It doesn't seem to be reading the file name or variable $myfile that I have set but reads and writes the text file of the info before that code. I cant use a set file name as it changes according to your name nevermind that was my fault for not paying attention to capitalization on letters. the variable is $myFile and i was using $myfile the code seems to be working im going to write it to a file and find out.
  2. this is what prints to the screen: user submitted 1 16488 | | 2 | #1 | | 5.00 | | | Breakfast Specials | NYNF | KIT 3 | Sausage | 1 | 0.00 | M | | | Breakfast Specials | NYNF | KIT 4 | Over Easy | 1 | 0.00 | M | | | Breakfast Specials | NYNF | KIT 5 this is whats in the file: 5 and this is what I would like the text file to look like: 16488 | | 1 | #1 | | 5.00 | | | Breakfast Specials | NYNF | KIT 2 | Sausage | 1 | 0.00 | M | | | Breakfast Specials | NYNF | KIT 3 | Over Easy | 1 | 0.00 | M | | | Breakfast Specials | NYNF | KIT im trying to integrate online ordering to a pos.
  3. <?PHP $c = file_get_contents("$myFile"); $e = explode("\n ",$c); foreach ($e as $el => $es) { $el++; $fh = fopen($myFile, 'w+') or die("can't open file"); $write = ($el." ".$es); fwrite($fh, $write); print($el." ".$es); } ?> heres what i tried using doesnt seem to do exactly as i need
  4. im no expert in php and part of my site needs to take a txt file and number each line starting with 1 to the number of lines in the file starting with the second line. I have no idea how to do this . ive tried everything. ex would be line 1 line 2 line 3 line 4 TO line 1 1 line 2 2 line 3 3 line 4 any ideas? any help is appricated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.