Current location: Hot Scripts Forums » Programming Languages » PHP » Nothing happen if checkbox checked


Nothing happen if checkbox checked

Reply
  #1 (permalink)  
Old 09-21-06, 02:10 AM
zoliky's Avatar
zoliky zoliky is offline
Aspiring Coder
 
Join Date: Jun 2006
Posts: 537
Thanks: 0
Thanked 0 Times in 0 Posts
Nothing happen if checkbox checked

PHP Code:

if(isset($_POST['submit'])) 

{
    
$users explode(","$_POST['name']);
    
$find  mysql_query("SELECT user_id, username FROM register WHERE username IN('"implode ("', '"$users) ."')");
        
    
mysql_query("INSERT INTO messages (id, subiect, message, send_date) VALUES (0, '".$_POST['subiect']."', '".$_POST['mesaj']."', NOW())"); 
    
$messages_id mysql_insert_id();
    
    while (
$row mysql_fetch_array($find)) 
    {    
        
mysql_query("INSERT INTO pm (id, msg_id, fromuserid, fromusername, touserid, folderid, messageread) VALUES (0, '".$messages_id."', '".$_SESSION['uid']."', '".$_SESSION['username']."', '".$row['user_id']."', '0', 'no')") or die(mysql_error());    
        
$pm_id mysql_insert_id();

        
// send files if exist
        
if (isset($_FILES['file']['tmp_name']) && $_FILES['file']['tmp_name']) 
        {
            foreach (
$_FILES["file"]["name"] as $key => $name
            {
                
$rand substr(md5time() . $_FILES['file']['name'][$key]), 015);
                
$target "/home2/devfirst/files/"
                
$target $target $rand;

                if(
move_uploaded_file($_FILES['file']['tmp_name'][$key], $target)) 
                {        
                    
mysql_query("INSERT INTO files (id, name, newname, size, type) VALUES (0, '".$_FILES['file']['name'][$key]."', '".$rand."', '".$_FILES['file']['size'][$key]."', '".$_FILES['fisier']['type'][$key]."')") or die(mysql_error()); 
                    
$idarray[] = mysql_insert_id(); 
                }        
            }    
    
            foreach (
$idarray as $value)
            {
                
mysql_query("INSERT INTO files_parent (id, pmid, filesid, fromuserid) VALUES (0, '".$pm_id."', '".$value."', '".$_SESSION['uid']."')") or die(mysql_error()); 
            }
        
            
mysql_query("INSERT INTO pm (id, msg_id, fromuserid, fromusername, touserid, folderid, messageread) VALUES (0, '".$messages_id."', '".$_SESSION['uid']."', '".$_SESSION['username']."', '".$row['user_id']."', '-1', 'no')");
            
$pm_id mysql_insert_id();
          
              foreach (
$idarray as $value)
            {
                
mysql_query("INSERT INTO files_parent (id, pmid, filesid, fromuserid) VALUES (0, '".$pm_id."', '".$value."', '".$_SESSION['uid']."')") or die(mysql_error()); 
            }
        }  
// Finish sending files
            
    
}
    
        
// This IF not work
        
if (isset($_POST['receipt']))
    {
        print 
'hello';
    }
show_sendmsg();

isset($_POST['receipt']) not work, the code between braces not executed. Any idea why ?

My HTMl source is :

Code:
<form name="foo" enctype="multipart/form-data" action="sendmsgu2.php" method="post">
<p><input type="checkbox" name="receipt">Confirm message</input><br />
</form>
Nothing happen if checkbox selected. Any idea, why?
Reply With Quote
  #2 (permalink)  
Old 09-21-06, 02:13 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Code:
<input type="checkbox" name="receipt">Confirm message</input>
This is not correct. Try.
Code:
<input type="checkbox" name="receipt" value="1" />Confirm message
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get values from checked checkboxes? Godwin PHP 3 09-19-06 12:17 AM
[SOLVED] Check and clear all checkbox zoliky JavaScript 6 08-28-06 05:50 AM
Displaying Mysql data as checked checkboxes djnaf PHP 7 03-24-06 05:10 AM
checkbox problem jonnekke PHP 2 01-04-06 07:28 AM
checkbox checked = skip UPDATE (Mysql) eq1987 PHP 9 05-29-04 09:11 AM


All times are GMT -5. The time now is 07:29 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.