Guest User

Untitled

a guest
Nov 23rd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. $string = "Hola = 1"
  2.  
  3. $valor = 2;
  4. $string = "Hola = 1";
  5. $final = $string + $valor;
  6. echo $final;
  7. //Salida: Hola = 3
  8.  
  9. <html>
  10. <head>
  11. <title>Aumentar Valor</title>
  12. </head>
  13. <body>
  14. <form action="./aumentar.php">
  15. <button type="submit" name="aumentar" value="1">
  16. <button type="submit" name="aumentar" value="2">
  17. <button type="submit" name="aumentar" value="3">
  18. </form>
  19. </body>
  20. </html>
  21.  
  22. <?php
  23. include "connect-database.php";
  24. $valor = mysqli_real_escape_string($conn, $_POST['aumentar']);
  25. $archivo = fopen("numero.txt", "r");
  26. $string = fread($archivo);
  27. fclose($archivo);
  28. $final = $string + $valor;
  29. $archivo = fopen("numero.txt", "w");
  30. $string = fwrite($archivo, $final);
  31. fclose($archivo);
  32. echo $final;
  33. exit();
  34.  
  35. $valor = "2";
  36. $string = "Hola = ";
  37. $final = $string + $valor;
  38. echo $final;
  39.  
  40. int($valor);
  41. ToString($valor);
Add Comment
Please, Sign In to add comment