php - Process image from form (image not used as submit button) -


i trying put image link form (not submit button). having trouble extracting image when process form.

here php code putting image in form...

$picture = "     <div id='photo'>         <input type='image' name='image' src='www.sampleimage.jpg'>     </div>";  <div class='formdata'>     <form action='rectodb.php' method='post'>" .          $picture .          "<input type='submit' name='todb'>     </form> </div>"; 

the image uploaded html , part works fine. once user satisfied, can hit submit button. @ point, want add image (or source of image) database. now, trying extract image code...

if (isset($_post['todb']))    {echo $_post["image"];} 

if var_dump($_post), image not in array believe image not going form, don't know problem is.

note there other things in form did not display in above code have no problem extracting.

 $picture = " <div id='photo'>     <input type='image' name='image' src='www.sampleimage.jpg'> </div>"; 

$picture should not pull html, rather should contain uploaded content.

$picture = $_post["image"]; 

then should able call $picture. understanding, trying for:

  • after image uploaded, image displayed under upload form.
  • the picture uploaded server.
  • an entry made in database url of picture.

edit: feel not getting trying accomplish. please link me whole code?
other values being inserted database? if trying accomplish image upload suggest added input.

to display errors not automatically thrown @ please add

error_reporting(e_all); ini_set('display_errors', '1'); 

after code.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -