Jump to content

[SOLVED] Not recieving the value from the form


Anxious

Recommended Posts

I have done echo fields where the form is processed, and its not receiving an value..

 

In the form, I have this code

 <?php if($form->value("likes") == ""){
   echo $database->getUserProfileInfo['likes'];
}else{
   echo $form->value("likes");
} ?>

The above code works, however...

 

 <?php if($form->value("dislikes") == ""){
   echo $database->getUserProfileInfo['dislikes'];
}else{
   echo $form->value("dislikes");
} ?>

The above code doesn't.

The form action is process.php, so I put an echo in and it doesn't recieve the values... Yet both codes are exactly the same setout, as I've been reading the code for 5-6 days now. Just don't understand why it don't recieve the values.

 

It seems to be a big problem, I would deeply appreciate it if someone can assist me.

Link to comment
Share on other sites

Its POST.

I don't understand why it all works, except the "Dislikes" and "Music" section

 

 <form action="process.php" method="POST">
    <table width="708" border="0" align="center" cellpadding="3" cellspacing="0">
      <tr>
        <td width="151">Profile Header:</td>
        <td width="377"><input name="slogan" type="text" value="
<?php if($form->value("slogan") == ""){
   echo $database->getUserProfileInfo['slogan'];
}else{
   echo $form->value("slogan");
} ?>" size="60" maxlength="100"></td>
      </tr>
  <tr>
  <td><br>
  Full Name:</td>
  <Td><p> <br>
  <input name="fullname" type="text" value="<?php if($form->value("fullname") == ""){
  echo $database->getUserProfileInfo['fullname'];
  }else{
  echo $form->value("fullname");
  } ?>" size="60" maxlength="100">
      <tr>
        <td><br>
          Location:</td>
        <td><p> <br>
                <input name="profilelocation" type="text" value="<?php if($form->value("profilelocation") == ""){
   echo $database->getUserProfileInfo['profilelocation'];
}else{
   echo $form->value("profilelocation");
} ?>" size="60" maxlength="100">
        </td>
      </tr>
      <tr>
        <td><br>
          School/Job</td>
        <td><p> <br>
                <input name="schooljob" type="text" value="<?php if($form->value("schooljob") == ""){
   echo $database->getUserProfileInfo['schooljob'];
}else{
   echo $form->value("schooljob");
} ?>" size="60" maxlength="100">
        </td>
      </tr>
      <tr>
        <td><br>
          Martial Status</td>
        <td><p> <br>
                <select name="status" value="value""<?php if($form->value("status") == ""){
echo $database->getUserProfileInfo['status'];
}else{
echo $form->value("status");
} ?>">
                  <option value="" selected></option>
			  <option value="Not Saying"></option>
                  <option value="Single">Single</option>
                  <option value="Dating">Dating</option>
                  <option value="In A Relationship">In A Relationship</option>
                  <option value="Engaged">Engaged</option>
                  <option value="Marriage">Marriage</option>
                  <option value="Swinger">Swinger</option>
                  <option value="It's Complicated">It's Complicated</option>
                </select>
        </td>
      </tr>
      <tr>
        <td><br>
          Likes:</td>
        <td><p> <br>
                <textarea name="likes" cols="60" rows="10" value"<?php if($form->value("likes") == ""){
   echo $database->getUserProfileInfo['likes'];
}else{
   echo $form->value("likes");
} ?>"></textarea>
        </p></td>
      </tr>
      <tr>
        <td><br>
          Dislikes:</td>
        <td><p> <br>
                <textarea name"dislikes" cols="60" rows="10" value"<?php if($form->value("dislikes") == ""){
   echo $database->getUserProfileInfo['dislikes'];
}else{
   echo $form->value("dislikes");
} ?>"></textarea></p>
      </tr>
      <tr>
        <td><br>
          Music:</td>
        <td><p> <br>
                <textarea name"music" cols="60" rows="10" value"<?php if($form->value("music") == ""){
   echo $database->getUserProfileInfo['music'];
}else{
   echo $form->value("music");
} ?>"></textarea></p>
      </tr>
      <tr>
        <td> </td>
        <td><br>
        
        <td><br></td>
      <tr>
        <td colspan="2" align="right"><input type="hidden" name="subeditprofile" value="1">
            <input name="submit" type="submit" value="Submit Changes"></td>
      </tr>
      <tr>
        <td colspan="2" align="left"></td>
      </tr>
    </table>
</form> 

Link to comment
Share on other sites

should it be like this

 

   <textarea name"dislikes" cols="60" rows="10"><?php if($form->value("dislikes") == ""){
   echo $database->getUserProfileInfo['dislikes'];
}else{
   echo $form->value("dislikes");
} ?>
                </textarea> 

 

and then it should work?

Link to comment
Share on other sites

I changed it to this

 

       <tr>
        <td><br>
          Likes:</td>
        <td><p> <br>
                <textarea name="likes" cols="60" rows="10"><?php if($form->value("likes") == ""){
   echo $database->getUserProfileInfo['dislikes'];
}else{
   echo $form->value("likes");
} ?></textarea>
        </p></td>
      </tr>
      <tr>
        <td><br>
          Dislikes:</td>
        <td><p> <br>
                <textarea name"dislikes" cols="60" rows="10"><?php if($form->value("dislikes") == ""){
   echo $database->getUserProfileInfo['dislikes'];
}else{
   echo $form->value("dislikes");
} ?></textarea>
</p>
      </tr>
      <tr>
        <td><br>
          Music:</td>
        <td><p> <br>
                <textarea name"music" cols="60" rows="10"><?php if($form->value("music") == ""){
   echo $database->getUserProfileInfo['dislikes'];
}else{
   echo $form->value("music");
} ?></textarea>
</p>
      </tr> 

Link to comment
Share on other sites

I did that, and when I submitted the form, all that comes up is this..

 

POST:Array

(

    [slogan] => Administrator of MyVee

    [fullname] => Jeanie Tallis

    [profilelocation] => East Yorkshire

    [schooljob] => Wolfreton Upper School

    [status] => Single

    [likes] => dgdfdg

    [subeditprofile] => 1

    [submit] => Submit Changes

)

 

 

Dislikes and Music aren't submitted. So a value isn't got.

Link to comment
Share on other sites

There is an = sign missing in your dislikes text field - name = "dislikes"

 

<textarea name"dislikes" cols="60" rows="10"><?php if($form->value("dislikes") == "")

 

should be:

 

<textarea name="dislikes" cols="60" rows="10"><?php if($form->value("dislikes") == "")

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.