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 8608879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:43:53+00:00 2026-06-12T03:43:53+00:00

How do you insert a value inside an input box from a php file?

  • 0

How do you insert a value inside an input box from a php file?

for example i have this code

<h1><a>App Test Form</a></h1>
        <form id="form_6" class="digitalfuture"  method="post" action="#main_body">
                    <div class="form_description">
            <h2>App Test Form</h2>
            <p></p>
        </div>                      
            <ul >

                    <li id="li_8" >
        <label class="description">Name <span id="required_8" class="required">*</span></label>
        <span>
            <input id="element_8_1" name= "element_8_1" class="element text" maxlength="255" size="8" value="hello" />
            <label>First</label>
        </span>
        <span>
            <input id="element_8_2" name= "element_8_2" class="element text" maxlength="255" size="14" value="" />
            <label>Last</label>
        </span><p class="guidelines" id="guide_8"><small>Please tell us your name</small></p> 
        </li>

can anyone point out any tutorials that can help me?

  • 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-12T03:43:54+00:00Added an answer on June 12, 2026 at 3:43 am

    source.php:

    <?php
        $data = 'text';
    ?>
    

    input.php:

    <?php
        include('source.php');
        echo '<input type="text" name="example" value="', $data, '" />';
    ?>
    

    That will insert the contents of $data into the input field value.

    Or did you mean something else?

    If you want the text to be visible directly when the page is opened, you can use the html5 feature “placeholder” in the input tag. Like this:

    <input type="text" name="example" placeholder="Write your comment" />
    

    That will show an input field in the page with the text “Write your comment” visible in the field until the user clicks on it and/or writes to the field (no need to delete the placeholder text manually, it disappears automatically).

    So when you combine them, it would look like this:

    source.php:

    <?php
        $data = 'text';
    ?>
    

    input.php:

    <?php
        include('source.php');
        echo '<input type="text" name="example" placeholder="', $data, '" />';
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following html form: <form method=post action=> <input type=hidden name=userid id=user value=<?php echo
I am planning to insert value in a vba access form text box values
I have my form elements here: <li><div id=formanswer1 class=clonedInput>Answer: <input type=text id=formanswer1 value= /></div></li>
I have a simple form with three input text with a different value for
This comes from a larger context, however I have stripped alot of code to
How can I insert a value from once cell into another cell from the
When i try to insert the value from the textbox into the database, the
I am trying to insert a value to sql_variant column in sql server from
ok, today I'm making a helper HTML function. It looks like this: function Input($name,$type,$lable,$value=
so I have been researching this all morning- and I'm pretty sure the code

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.