Current location: Hot Scripts Forums » Programming Languages » PHP » Checkbox


Checkbox

Reply
  #1 (permalink)  
Old 09-20-05, 01:15 AM
arstanj's Avatar
arstanj arstanj is offline
Newbie Coder
 
Join Date: Sep 2005
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Checkbox

Hi,
I have this code:
Code:
<form name="form1" method="post" action="">
  <table width="730" border="0" align="center" cellpadding="4" cellspacing="1">
    <tr> 
      <td bgcolor="#999999"><strong>Profitera Credit &amp; Collections Management</strong></td>
    </tr>
    <?
 $sql="select * from files where cat_id = 1";
 $result = mysql_query($sql);
 if (!$result) {
    echo "Could not successfully run query ($sql) from DB: " . mysql_error();
    exit;
}
if (mysql_num_rows($result) == 0) {
    echo "No category found!";
    exit;
}

while ($row = mysql_fetch_assoc($result)) { 
 ?>
    <tr> 
      <td bgcolor="#CCCCCC"> <input name="<? echo $row["file_id"];?>" type="checkbox" id="a" value="checkbox"> 
        <?
	echo $row["file_title"];
	echo "<br>". $row["description"];
	?>
        <input name="file<? echo $row["file_id"];?>" type="hidden" value="<? echo $row["file_id"];?>"> 
      </td>
    </tr>
    <?
}

mysql_free_result($result);
?>
  </table>
</form>
Database structure:

CREATE TABLE `file_cat` (
`category_id` int(12) NOT NULL auto_increment,
`cat_name` varchar(120) NOT NULL default '',
PRIMARY KEY (`category_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

CREATE TABLE `files` (
`file_id` int(12) NOT NULL auto_increment,
`cat_id` int(12) NOT NULL default '0',
`file_pwd` varchar(120) NOT NULL default '',
`file_title` varchar(120) NOT NULL default '',
`description` varchar(200) NOT NULL default '',
PRIMARY KEY (`file_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

Basically, my idea is to make a download tracker, where a user should provide me a valid email address to which the script will send an URL of the file. That URL should expire within 10 days after it is sent.

Now, my problem is I can display those files, but when I try to get to the "provide an email" page I get stuck. How do I get the values of those checkboxes and say "Hey man, you wanted to download this files"?

regards,
Arstan
__________________
Happy coding!

----------------------------
http://www.jusupov.com - Computer Technology Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 09-20-05, 04:00 AM
mysqlautobackup's Avatar
mysqlautobackup mysqlautobackup is offline
New Member
 
Join Date: Sep 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

JavaScript in HTML page and onsubmit() function in <form>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 09-20-05, 04:27 AM
arstanj's Avatar
arstanj arstanj is offline
Newbie Coder
 
Join Date: Sep 2005
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Can you be more specific?

Quote:
Originally Posted by mysqlautobackup
JavaScript in HTML page and onsubmit() function in <form>
Hi,
can you please be more specific. I'd really appreciate your help.
__________________
Happy coding!

----------------------------
http://www.jusupov.com - Computer Technology Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
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
Checkbox Validation? bconnor ASP 0 05-18-05 06:58 AM
Using the checkbox for displaying all results mcrob PHP 2 05-12-05 05:56 PM
help for creating dynamic checkbox in asp.net l3nny ASP.NET 1 07-01-04 07:45 AM
Add sequential number to database from checkbox ajndede ASP 1 05-04-04 08:43 AM
checkbox length sCruFyGal JavaScript 1 02-24-04 04:22 AM


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