hasjem Posted May 5, 2010 Share Posted May 5, 2010 I have the following form to upload a picture, that works <form name="newad" method="post" enctype="multipart/form-data" action=""> <table> <tr> <td> <input type="file" name="image"> </td> </tr> <tr> <td> <input type='hidden' name='naam' value"<?echo$naam;?>"> <input type='hidden' name='wachtwoord' value"<?echo$wachtwoord;?>"> </td> </tr> <tr> <td><center> <input name="Submit" type="submit" value="Upload afbeelding"></center> </td> </tr> </table> </form> but in this way the hidden information (username and password) are not send. how can I do that? probably comes because of enctype="multipart/form-data" but i need that to send the picture. how do i send a picture AND the userinformation? thanks lex moen Link to comment https://forums.phpfreaks.com/topic/200760-problems-with-a-form-can-upload-a-picture-but-loose-username-and-password/ Share on other sites More sharing options...
callesson Posted May 5, 2010 Share Posted May 5, 2010 I tryed to use the <?echo$something?> and nothing happend, then i typed <?php echo$something?> and it responded. I dont know it will help, but try add "php" ;<?php; EDIT Also i see that your missing equal sign = value="<?php Not Value"<? Link to comment https://forums.phpfreaks.com/topic/200760-problems-with-a-form-can-upload-a-picture-but-loose-username-and-password/#findComment-1053434 Share on other sites More sharing options...
Muddy_Funster Posted May 5, 2010 Share Posted May 5, 2010 You should always put php code between <?php ... ?> Some servers still support short tags but you would need a space after the opening ? and before the closing one eg <? echo... ?> There is also nothing in the code that you have posted that assignes the $namm and $watchwoord variables. try adding this above your table code if you don't have it anywhere else: <?php if(isset($_POST['namm']){ $namm = $_POST['namm'];} else{$namm = '';} if(isset($_POST['watchwoord']){ $watchwoord = $_POST['watchwoord'];} else{ $watchwoord = '';} Link to comment https://forums.phpfreaks.com/topic/200760-problems-with-a-form-can-upload-a-picture-but-loose-username-and-password/#findComment-1053443 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.