Jump to content
Sign in to follow this  
SimonStaton

Edit a .php and .html file with given values

Recommended Posts

SimonStaton

Hi,

I am trying to have an executable file that will copy main.html and email.php and then paste a new copy of them called main1.html and email1.php,

it must then look inside main1.html and find EMAIL123 inside the code, then replace that with a user given value so I'm not sure if I could have a command prompt or something appear where they can then type in the email they want it to be replaced with.

it then has to look inside email1.php and find THEIREMAIL123 and again replace this with a user given value.

one of my friends told me to look into autoit not sure if it can do this but if you know of something that can I would be very grateful.

Simon

Share this post


Link to post
Share on other sites
SimonStaton

I found this code elsewhere on the forum which could help do a part of what I have asked:

$file = FileOpen ( "C:\Users\Simon\Desktop\Action New Customer\Email.php", 0 )
Dim $Contents
While 1
   $Line = FileReadLine ( $file )
   If @error Then Exitloop
   If $Line = "email123" Then $Line = "emailinhere"
   $Contents = $Contents & $Line & @CRLF
WEnd
FileClose ( $file )
$file = FileOpen ( "C:\Users\Simon\Desktop\Action New Customer\Email.php", 2 )
FileWrite ( $file, $Contents )

Share this post


Link to post
Share on other sites
SimonStaton

I also found this if it helps that seems to open a input box where they could asign the values:

$edit_field = InputBox('Customers Email', 'Type in User Input','name@domain.com','',163, 178, 529, 363)
If $edit_field > 'name@domain.com' Then
MsgBox(0, $edit_field, $edit_field)
EndIf

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

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.