[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Why the image is not echoed?

Posted on 2009-04-06
6
Medium Priority
?
184 Views
Last Modified: 2012-05-06
here image is not shown why ?

<?php
echo $_POST['image'];
?>

<form action="1.php" method="post" name="form"  enctype="multipart/form-data">
<input type="file" name="image" id="image" />
<input type="submit">
</form>
0
Comment
Question by:designersx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 8

Expert Comment

by:mostart
ID: 24077072
because file uploads are handled by other POST variables:

try to echo these:

$_FILES['image']['name'] <- filename on client machine
$_FILES['image']['type']  <- mime-type
$_FILES['image']['size'] <- size
$_FILES['imgae']['tmp_name'] <- name on server

more info here:

http://de.php.net/manual/en/features.file-upload.post-method.php
0
 
LVL 14

Expert Comment

by:shobinsun
ID: 24077083
Use :

<?php
echo $_FILES['image'];
?>

<form action="1.php" method="post" name="form"  enctype="multipart/form-data">
<input type="file" name="image" id="image" />
<input type="submit">
</form>
0
 
LVL 14

Accepted Solution

by:
shobinsun earned 200 total points
ID: 24077128
Hello,

Use for printing the name of the file:

<?php
echo $_FILES['image']['name'];
?>

<form action="1.php" method="post" name="form"  enctype="multipart/form-data">
<input type="file" name="image" id="image" />
<input type="submit">
</form>
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 14

Expert Comment

by:shobinsun
ID: 24077210
Hello,

<?php
$source = $_FILES['image']['name'];
$target = './'.$_FILES['image']['name'];
move_uploaded_file($source, $target);

echo "image: <img src='./".$target."'><br>";

?>

To display the image that you have uploaded

Regards.
0
 

Author Comment

by:designersx
ID: 24084035
ok thanks.
0
 
LVL 8

Expert Comment

by:mostart
ID: 24085498
oh come on this is not fair. I was the first who answered and I gave you the same and even some additional information. The answer you accepted did only repeat parts of what I already wrote before, so at least you could split the points.
Its not fun helping people if they act like this, don't you think so ?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question