Jump to content

[SOLVED] Very weird.


Daney11

Recommended Posts

Hey guys, this is starting to get on my nerves now..

 

Bascially i have a submit form. Im doing everything right to submit my data.. well at least i think i am.

 

Snipplets of code

 

<input type="text" name="comment_coverageid" value="<?php echo $coverage_id ?>"><textarea name="comment_body" rows="6" cols="55" onclick=javascript:storeCaret(this); onchange=javascript:storeCaret(this); onselect=javascript:storeCaret(this); value="<?php if (isset($_POST['comment_body'])) echo $_POST['comment_body']; ?>"></textarea>

`coverage_id` displays a number, which works fine.

`comment_body` you have to input your comment.

 

Now for the submitting.

 

$query = "INSERT INTO `coverage_comments` 
          (
           comment_id, 
           comment_teamid, 
           comment_coverageid,  
           comment_date, 
           comment_author, 
           comment_body
      )";

        $query .= " VALUES 
          (
           'NULL',
           '$team_url',
           '$coverage_id',
           NOW(),
           '".$HTTP_SESSION_VARS['valid_user']."',
	   '$comment_body'
           )";

 

Everything but `coverage_id` submits perfectly, but i dont understand why when the form shows the number inside the box, everything is named how it should be :S

 

Very confusing.

 

Any ideas guys?

 

Thanks

Link to comment
Share on other sites

First off, <TEXTAREA> doesn't accept a VALUE attribute.. change it to this:

 

<input type="text" name="comment_coverageid" value="<?php echo $coverage_id ?>"><textarea name="comment_body" rows="6" cols="55" onclick=javascript:storeCaret(this); onchange=javascript:storeCaret(this); onselect=javascript:storeCaret(this);><?php if (isset($_POST['comment_body'])) echo $_POST['comment_body']; ?></textarea>

 

And for the other, try echoing coverage_id by itself and see what it shows

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.