|
-
Feb 20th, 2006, 12:22 AM
#1
Thread Starter
Frenzied Member
How to pass value of checkbox form to another form?
Hi all i created a dynamic check box form. I let the user to select a few songs and once they click on submit all those values get passed to a second checkbox form. My first checkbox form data ouf of this query:
$query = "SELECT id,artist,track,album,title FROM files where album='$albumname' order by track";
The code beleow is part of my checkbox form.The values on bold are those that i need to display them in second page check box form. My problem is that i do not know how to pass those select checked box values to next page by using post method. I be happy if an expert show me how i can do it.Thanks
Note : the second form needs to be dynamic too since number of passed values are not the same each time!
Code:
<form method="POST" action="./Members/AddToPlayList.php" name="mp3Play"> <tr>
?>
while($row = mysql_fetch_assoc($result))
{
<td bgcolor="#C0C0C0"><p align="center"><b><?=intval( $row['track'] );?></b></p>
</td>
<td bgcolor="#C0C0C0"><input
type="checkbox" name="Id" value='<?=intval( $row['id'] );?>' /></td>
<td bgcolor="#C0C0C0"><a
href="javascript:newWindow('./mp3s/myWimpy.php?queryWhere=Id&queryValue=<?=strval( $row['id'] );?>')"><img
src="images/Speaker.gif"
alt="Listen to this Song" border="0"
width="16" height="16"
longdesc="Listen to this Song"></a> <?=strval( $row['title'] );?>
</td>
<td bgcolor="#C0C0C0"> <?=strval( $row['album'] );?> </td>
<td bgcolor="#C0C0C0"><a
href="javascript:newWindow('RateSong.asp?SongID=1')"><img
src="images/RatIt.gif"
alt="Rate This Song" border="0"
width="100" height="22"
longdesc="Rate This Song"></a></td>
<td align="center" bgcolor="#C0C0C0">0 </td>
<td bgcolor="#C0C0C0">coming Soon <!-- <a href="../site.php?songID=1&Song=Atash">Read </a>| <a href="./Members/WriteLyrics.php?SongId=1&Song=Atash">Write</a> --> </td>
<?
} //end of while
-
Feb 20th, 2006, 06:19 AM
#2
Hyperactive Member
Re: How to pass value of checkbox form to another form?
-
Feb 20th, 2006, 06:31 AM
#3
Thread Starter
Frenzied Member
Re: How to pass value of checkbox form to another form?
 Originally Posted by 308holes
Not what was looking for !!! i need to pass checkbox data to next page using post method!
-
Feb 20th, 2006, 02:36 PM
#4
<?="Moderator"?>
Re: How to pass value of checkbox form to another form?
change
PHP Code:
<input type="checkbox" name="Id" value='<?=intval( $row['id'] );?>' />
to
PHP Code:
<input type="checkbox" name="Id[]" value='<?=intval( $row['id'] );?>' />
And to check it
PHP Code:
<?
$ids = $_GET['Id'];
print_r($ids);
?>
-
Feb 21st, 2006, 09:59 PM
#5
Thread Starter
Frenzied Member
Re: How to pass value of checkbox form to another form?
 Originally Posted by john tindell
change
PHP Code:
<input type="checkbox" name="Id" value='<?=intval( $row['id'] );?>' />
to
PHP Code:
<input type="checkbox" name="Id[]" value='<?=intval( $row['id'] );?>' />
And to check it
PHP Code:
<?
$ids = $_GET['Id'];
print_r($ids);
?>
Thank u for u reply.well the thing is i have more then one check box. Does it print them all ? furthermore how to write the pased id values to mysql? I be happy if u shoe me how to do that.
-
Feb 22nd, 2006, 10:40 AM
#6
Fanatic Member
Re: How to pass value of checkbox form to another form?
tony007, your asking alot of questions about PHP and MYSQL that can be answered in any number of the books out there. I would recommend you go to a local book store and buy one. That way you wont have to post so many questions here. All the books out there provide code and can go into a much more in depth explanation of whats going on and how the code works than anyone here can really type up. Can you also start posting the code you have written? I have noticed that you only post the HTML front end stuff but not the PHP. Sorry to sound rude but everyone here is here to help, not write the code fron scratch for you. I do like how you refer to anyone as an expert
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|