mayankjoin3

appaji_v2

May 31st, 2022 (edited)
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1. import re
  2.  
  3.  
  4. def main():
  5.     with open("input.txt", "r") as f:
  6.         data = f.read()
  7.  
  8.     pattern = re.compile(r"\$(\w+)\s*=\s*Input::get\(\'\w+\'\);")
  9.     new_data = re.sub(pattern, r"$\1 = mysqli_real_escape_string($conn,$\1);", data)
  10.     new_data_1 = re.sub(pattern, r"$\1 = strip_non_printable($\1);", data)
  11.    
  12.    
  13.     with open("output.txt", "w") as f:
  14.         f.write(new_data_1)
  15.         f.write("\n\n")
  16.         f.write(new_data)
  17.  
  18.  
  19. if __name__ == "__main__":
  20.     main()
  21.  
  22.  
  23. #File1.php :
  24.  
  25. #<?php
  26. #  function first($int, $string){ //function parameters, two variables.
  27. #    return $string;  //returns the second argument passed into the function
  28. #  }
  29. #?>
  30. #Now Using include to include the File1.php to make its content available for use in the second file:
  31.  
  32. #File2.php :
  33.  
  34. #<?php
  35. #  include 'File1.php';
  36. #  echo first(1,"Hello edureka");
  37. #?>
Add Comment
Please, Sign In to add comment