NewbieBryan Posted July 5, 2009 Share Posted July 5, 2009 Hi All, I am extremely new to php (and this forum) and am hoping to get some assistance. If this is not the right place to ask this question, if not; MODs please move the post to the correct section and apologies What I am trying to do: create a form that asks for an image name and then display that image on the next page. Sounded easy when I thought about it .... but, doesnt appear so. ??? All the images I want to display are in the folder where the code is. Code: Input page <html> <body> <form action="display.php" method="post"> Name: <input type="text" name="imagename" /> <input type="submit" /> </form> </body> </html> Code: display.php page <?php $Image = "$_POST[imagename]"; //to check my variable from the form echo $Image; ?> <html> <head> <title>Test image output page</title> <A href="test.php">Go back to submit again</A>. </head> <body> <img src="<$_POST["company"]>" width="200" height="200" </body> Now .... Clearly this doesn't work - I have triend putting the <imgscr> in the php section but that just bombs .... I have spent the last 5 hours on this (searching the net / trial and error / etc) and am going around in circles .... Any help would be appretiated. Thx Bryan Quote Link to comment https://forums.phpfreaks.com/topic/164849-solved-displaying-a-picture-from-a-form-input/ Share on other sites More sharing options...
nbarone Posted July 5, 2009 Share Posted July 5, 2009 <html> <head> <title>Test image output page</title> </head> <body> <A href="test.php">Go back to submit again</A><br> <img src="<?php echo $_REQUEST['imagename']; ?>" width="200" height="200"> </body> Quote Link to comment https://forums.phpfreaks.com/topic/164849-solved-displaying-a-picture-from-a-form-input/#findComment-869251 Share on other sites More sharing options...
NewbieBryan Posted July 5, 2009 Author Share Posted July 5, 2009 Works like a charm. Thank you NBarone, much appretiated... Quote Link to comment https://forums.phpfreaks.com/topic/164849-solved-displaying-a-picture-from-a-form-input/#findComment-869262 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.