Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
argh!!!! form will not submit POST values
Old 06-22-2005, 08:13 AM argh!!!! form will not submit POST values
Average Talker

Posts: 15
Trades: 0
If anyone can tell me why this form is not passing the post values from the first page to the 'formactions.php' I would be HUGELY grateful. the switch statement IS going to the right place, because the text at the bottom prints out, just for some reason the POST values are not being passed to this PHP page.
HTML Code:
					   <div class="commentsform">
                            <form action="formactions.php" method="post">
                                <div class="hidden">
                                    <input type="hidden" name="formaction" value="addcomment" />
                                    <input type="hidden" name="postid" value="<?php echo $postid; ?>" />
                                    <input type="hidden" name="commentlogid" value="<?php echo $logid; ?>" />
                                    <input type="hidden" name="returnpage" value="<?php echo $page; ?>" />
                                </div>

                                <div ><label for="name">name</label><input type="text" name="newcommentname" /></div>
                                <div ><label for="email">email</label><input type="text" name="commentemail" /></div>
                               <div><label for="body" cols="3">body</label><textarea name="commentbody"></textarea></div>
                                 <div><label></label><input type="submit" class="submitbutton" value="submit comment" /></div
                            </form>
                        </div>
PHP Code:
switch($_POST['formaction']) {
        case 
"addcomment":
        
$commentpostidsend $_POST['postid'];
        echo 
$commentpostidsend;
        
$commentnamesend $_POST['newcommentname'];
        echo 
$commentnamesend;
        if (
$commentnamesend == ""$commentnamesend "an anonymous reader";
        var 
$commentemailsend $_POST['commentemail'];
        echo 
$commentemailsend;
        var 
$commentbodysend $_POST['commentbody'];
        echo 
$commentbodysend;
        
$commentlogid $_POST['commentlogid'];
        
$commenttimesend date('H:i:s');
        
$commentdatesend date('Y-m-d');
        if (
$_POST['admincomment'] == "on")    $commentadminsend 1;
        else 
$commentadminsend 0;
        
$query3 "INSERT INTO comments (EntryID, CommentDate, CommentTime, EntryName, EntryEmail, CommentBody, Admin, logid) VALUES ('$commentpostidsend', '$commentdatesend', '$commenttimesend', '$commentnamesend', '$commentemailsend', '$commentbodysend', $commentadminsend$commentlogid)";
        
mysql_query($query3) or die('error, insert query (query 3) failed');
        echo 
"<h4>Adding comment...</h4>";
        break;

bennyboywonder is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-22-2005, 08:22 AM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
Trades: 0
I don't know if it is related, but the </div after your submit button is not closed (may have been a cut and paste oversight).

Are you trying to print out the value of $POST[formaction] in formactions.php before you send it into the switch statement? It would be helpful to know if the value is there at all as opposed to not coming through the switch statement as you expect.
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Old 06-22-2005, 10:51 AM
Average Talker

Posts: 15
Trades: 0
Quote:
Originally Posted by Kyrnt
I don't know if it is related, but the </div after your submit button is not closed (may have been a cut and paste oversight).

Are you trying to print out the value of $POST[formaction] in formactions.php before you send it into the switch statement? It would be helpful to know if the value is there at all as opposed to not coming through the switch statement as you expect.
how embarrassing. Yes closing that </div> tag seemed to solve my problem. Thanks very much :P
bennyboywonder is offline
Reply With Quote
View Public Profile
 
Old 06-22-2005, 11:22 AM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
Trades: 0
No problem -- happy coding.
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Reply     « Reply to argh!!!! form will not submit POST values
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13978 seconds with 12 queries