Amin Sh
Amin Sh

Reputation: 5

How can I change this html code that take value from text-box after enter submit button?

I have a text box and a submit button that are connected to html form by event function.

Html code is as below. I would like instead of Pic.jpg, the value of text box select after enter submit button.

<html>
    <body>
        <img src="http://example.com/images/Pic.jpg"/>
    </body>
</html>

In other word, I want the last part of address which is name of image get value from text box.

Here Is my Submit Button Code in html.

<input type="submit" id="Button1" onblur="ShowObject('Html_Form', 1);return false;" name="" value="Lookup" style="position:absolute;width:99px;height:25px;">

And textbox html code:

<input type="text" id="Editbox1" style="position:absolute;line-" name="q" value="" placeholder="Enter You Code Here!">

Upvotes: 0

Views: 404

Answers (1)

user4257783
user4257783

Reputation:

You can read the value from the posted textbox with:

$_REQUEST, $_POST or $_GET

<?php

$pic_file_name = $_REQUEST['inputbox'];

?>

<html>
    <body>
        <img src="http://example.com/images/<?php echo $pic_file_name; ?>"/>
    </body>
</html>

Upvotes: 1

Related Questions