Reputation: 5
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
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