Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8695047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:56:07+00:00 2026-06-13T00:56:07+00:00

I need to input the line in a .txt file into the value of

  • 0

I need to input the line in a .txt file into the value of the search variable in a form.
Here’s mi html code:

    <form action="http://www.wikipedia.org/search-redirect.php" method="get" target="_blank">
    <input type="hidden" name="search" value=""/>  
    <input type="hidden" name="language" value="en" />
    <input type="image" src="/img/masinfo.png" width="218" height="40" alt="mas informacion"  name="go" value="Mas informacion del artista" />
    </form>

On the other hand i have this php code to extrat the line from the .txt file:

<?php
$file = "file.txt";
$f = fopen($file, "r");
while ( $line = fgets($f, 1000) ) {
  $line = preg_replace("/^example.*/", "example", $line);
  $line = preg_replace("/0[0-9]{2}/", "", $line);
 print $line;

}
?>

Is there a way to input this line into the search value of the form?

Edit: the line is something like

 124 hello world - universe
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:56:08+00:00Added an answer on June 13, 2026 at 12:56 am
    <?php 
    $file = "file.txt"; 
    $f = fopen($file, "r"); 
    while ( $line = fgets($f, 1000) ) { 
      $line = preg_replace("/^example.*/", "example", $line); 
      $line = preg_replace("/0[0-9]{2}/", "", $line); 
    } 
    ?> 
    
    <form action="http://www.wikipedia.org/search-redirect.php" method="get" target="_blank"> 
    <input type="hidden" name="search" value="<?php echo $line; ?>"/>   
    <input type="hidden" name="language" value="en" /> 
    <input type="image" src="/img/masinfo.png" width="218" height="40" alt="mas informacion"  name="go" value="Mas informacion del artista" /> 
    </form> 
    

    If your $line variable will contain characters like " you should replace it before echoing it

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to read from a file and then break the line into 3
StackOverflow people, Need Java Advice and Code which reads a file(File.txt) and prints to
I need help on this code. The input is stored in a text file
Here's my code: StreamReader reader = new StreamReader(war.txt); string input = null; while ((input
I need to write a program that takes input line at a time and
I have a homework assignment where I need to take input from a file
How do I ignore an empty first line in input.txt? I don't necessarily know
I have a (ANSI) text file (filters.txt) on my computer, on each line is
I need to input four variables into a C++ program (Win32) from a text
A simulation program I'm using requires a text based input file. I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.