topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Wednesday December 4, 2024, 7:43 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: SOLVED: Easy use of a variable to edit a php (text) file in a batch file  (Read 5234 times)

questorfla

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 570
  • Fighting Slime all the Time
    • View Profile
    • Donate to Member
Not sure where I am missing something . It may be that editing a .php" file doesn't the same rules as a .txt file but i am using a text editor to modify manually.
the file "config.php" need for line 3 which states :   $directory   = "directory";   .  to change the word in quotes to the value of %inputb%.  Once that is done, the config.php file is used to continue to creation of the folder.  That's about it. 
The prior operations would have loaded the correct value for the name "directory" into the variable %inputb%  I know inputb has the correct data in it as I can print it on screen with echo but I cannot get it to edit the config.php file as shown without exiting the batch which was the whole point in doing it :(
so that after building the layout it ends with that file modified to reflect the value of the variable at the time it was loaded.
The php file has 54 lines total and i only need to add the name of the directory in line 3.  I cant just use the variable itself because of other scripts that would use the same config file that would not provide the information for %inputb%


questorfla

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 570
  • Fighting Slime all the Time
    • View Profile
    • Donate to Member
Whoops.  Sorry Skwire.  I may be in the wrong forum.

questorfla

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 570
  • Fighting Slime all the Time
    • View Profile
    • Donate to Member
http://www.dostips.c...Batch.FindAndReplace
>>Excellent bit of craftsmanship! <
Whew!  Finally found the answer and it even worked!  I just did not look hard enough. 

Skwire, can you please remove this whole thread or post somewhere if it might be of use to others.
Thanks
(I regret to say i do not know how to close or move one :(  )