Jump to content

Recommended Posts

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

 

 

 

 

 

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.