Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

422
Views
Cómo guardar formulario en dos archivos txt html y php

Estoy tratando de enviar un formulario con dos entradas de texto y tratando de guardar las dos entradas en dos archivos de texto separados pero sin éxito. Puedo guardar las dos entradas en un archivo, pero no puedo deslizar las entradas en dos archivos de texto separados.

Esto es lo que he intentado:

formulario HTML:

 <form action="run.php" method="post"> Link:<br><input type="text" name="linkisv" value=""><br> Email:<br><input type="text" name="emailisv" value=""><br> <input type="submit" id ="submitButton" value="Submit"> </form>

La solución PHP:

 <?php $linkisv = $_POST["linkisv"]; //You have to get the form data $emailisv = $_POST["emailisv"]; $file = fopen('configurationSettings.txt', 'w+'); //Open your .txt file ftruncate($file, 0); //Clear the file to 0bit $content = $linkisv. PHP_EOL .$emailisv; fwrite($file , $content); //Now lets write it in there fclose($file ); //Finally close our .txt die(header("Location: ".$_SERVER["HTTP_REFERER"]));?>
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Con este código:

 <?php $linkisv = $_POST["linkisv"]; //You have to get the form data $emailisv = $_POST["emailisv"]; // SAVING FIRST FILE $file = fopen('configurationSettings.txt', 'w+'); //Open your .txt file ftruncate($file, 0); //Clear the file to 0bit $content = $linkisv; fwrite($file , $content); //Now lets write it in there fclose($file); //Finally close our .txt // SAVING SECOND FILE $file = fopen('second_file_name.txt', 'w+'); //Open your .txt file ftruncate($file, 0); //Clear the file to 0bit $content = $emailisv; fwrite($file , $content); //Now lets write it in there fclose($file); //Finally close our .txt // REDIRECT die(header("Location: ".$_SERVER["HTTP_REFERER"]));?>
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!