Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- def main():
- with open("input.txt", "r") as f:
- data = f.read()
- pattern = re.compile(r"\$(\w+)\s*=\s*Input::get\(\'\w+\'\);")
- new_data = re.sub(pattern, r"$\1 = mysqli_real_escape_string($conn,$\1);", data)
- new_data_1 = re.sub(pattern, r"$\1 = strip_non_printable($\1);", data)
- with open("output.txt", "w") as f:
- f.write(new_data_1)
- f.write("\n\n")
- f.write(new_data)
- if __name__ == "__main__":
- main()
- #File1.php :
- #<?php
- # function first($int, $string){ //function parameters, two variables.
- # return $string; //returns the second argument passed into the function
- # }
- #?>
- #Now Using include to include the File1.php to make its content available for use in the second file:
- #File2.php :
- #<?php
- # include 'File1.php';
- # echo first(1,"Hello edureka");
- #?>
Add Comment
Please, Sign In to add comment