Jump to content

problems with a form, can upload a picture but loose username and password


hasjem

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

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.