nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome !

nav33n 472 Purple hazed! Team Colleague Featured Poster

You got it wrong.. Its not ' but `.

nav33n 472 Purple hazed! Team Colleague Featured Poster

-956

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. Sorry ! I don't understand what exactly your code does.. But, you can do it as I have said in my previous post.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Can you be more specific ? If you post your code and the database structure, it will be easier for us to help you !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb Rodney :) I am glad you have some nice stuff in your brains! I hope you will share it with us ;) !
Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb Dharmender Khosla ! But you aren't supposed to post the url of your website! (You can have it in your signature though!)..

nav33n 472 Purple hazed! Team Colleague Featured Poster

When the user registers, set the value for activation column as 0 (for that user) in the user table. When the user activates, update activation column to 1 for that user. Then, when the user tries to log in, while checking for username and password, also check if activation=1. If it isn't 1, promt him to activate first.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You are welcome! Btw, php parser doesn't parse a variable if you put it within ' '. More about it here .

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb annajee and tonydestiny1988 ! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb !

how do I post in the forums, I don't see a post button in hardware?

Just like you posted here ! :-/

nav33n 472 Purple hazed! Team Colleague Featured Poster

Try this.

mysql_query("SELECT * FROM $quiz_name");

If this doesn't work, print out the query and run it in phpmyadmin/mysql console. See what the problem is.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Do you have the database connection in your script ? And Check if $quiz_name isn't empty.

nav33n 472 Purple hazed! Team Colleague Featured Poster

$result = mysql_query("SELECT * FROM '$quiz_name'");
$num_rows = mysql_num_rows($result12);

$result12 should be $result.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Oh thanks.. But wouldn't it affect the query if we do it like

select team_ID,teamname,teampassword from teams where teamemail='{$email}'

Because, anything between ' ' will be considered as a value.. isn't it ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) You are welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

$teampassword=getvar("teampassword")

Missing ; at the end. Didn't you get any parse error ? Hmm! And

select team_ID,teamname,teampassword from teams where teamemail='{$email}'

shouldn't that be

select team_ID,teamname,teampassword from teams where teamemail='$email'

And also here,

<input type='text' name='email' value='{$email}'>

Why is value='{$email'} ? When you query the table, it will look for email, for example, {test@test.com} !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. you are passing the id as a parameter. Why are you trying to assign the value of $id to t (in javascript function) ?

<html>
<head>
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
<!--
function login(t) {
alert(t);
}
-->
</SCRIPT>
</head>
<body> 
<?php
$id=$_GET['id'];
print "<input type='button' name='button' value='button' onClick=login('$id')>";
?>
</body>
</html>

This works just fine !

peter_budo commented: Another great snippet +7
nav33n 472 Purple hazed! Team Colleague Featured Poster

-950

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

-947

nav33n 472 Purple hazed! Team Colleague Featured Poster

You are welcome ;)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Almost correct. When you submit the page, the checkboxes which were checked will be passed on to the next page. You can use foreach to get the checked values. Query the table and get the rows for these ID's.

<?php
foreach($_POST['checkboxname'] as $value){
$query = "select * from table where id='$value'";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)) {
 $school = $row['school'];
$date = $row['date']; //and so on..
//Then insert these values to the table
$insert = "insert into table2 (col1,col2) values ('$school','$date')";
mysql_query($insert);
}
}
//so, it will insert a row in the table for every checked checkbox value

I hope thats clear..

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Then query the table with the ID's passed.. Get the row and insert it to another table.

nav33n 472 Purple hazed! Team Colleague Featured Poster

I dont understand.. You already have a record in the table and you want to insert another record for the same ID ? Can you explain in detail what exactly are you trying to do ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

What are you doing with the ID ? Are you using it to do anything important ? Like updating/inserting any value to a table ? If so, you need ID field. Umm.. Hey, why not do it this way. ID represents a row in the table. For example, If ID = 1, all the other details, $a_row, $a_row and $a_row will have the relevant value. Why not query the table and get the data when the user submits the form ?
Ie., from your code, you have passed 2 values to the next page.

Array ( [0] => 9 [1] => 14 )

Query the table and get the rows where ID = 9 and 14 respectively.

<?php
foreach($_POST['checkboxname'] as $value){
$query = "select * from table where id='$value'";
//execute the query and get the rows and print it..
}
nav33n 472 Purple hazed! Team Colleague Featured Poster

Thanks :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Well, if you wish to use sessions, its going to be a lil tedious because, say for example, there are 10 checkboxes and the user selects 5. You need to have an array of session variables and get only the selected index of the checkbox. Thats going to be very difficult !
But you can try this alternative. Instead of,

<input type="checkbox" name="hello[]" value="'.$a_row.'">

pass $row, $row and $row as the value.

$value = $row['date']. ";".$row['school'].";".$row['people'];
<input type="checkbox" name="hello[]" value=".$value.">

So, when a checkbox is checked, all these values are passed onto the next page as the checkbox value.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. you want a php script that sends email, but dont want to install php on the server ?
:-/ I am not sure where you will find one like that!

nav33n 472 Purple hazed! Team Colleague Featured Poster

You mean, you want to see all the other details like

<td style=\"color:Black\">".$a_row."</td>".
"<td style=\"color:Black\">".$a_row."</td>".
"<td style=\"color:Black\">".$a_row."</td>".

? You cant. If you want all these details to be passed onto the next page, have textboxes assign these values to the textboxes and then you can get these values in the next page. Or, use session.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

I searched google for days and I couldn't find anything that works for me.

Did you search in php.net ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

In the next page, if you do, print_r($_POST); you will see ONLY the list of checkboxes which were checked..

nav33n 472 Purple hazed! Team Colleague Featured Poster

I dont see line 30 in that code snippet !
And btw, instead of echo "<td>$row['last_name']</td>"; Try, echo "<td>".$row['last_name']."</td>";

nav33n 472 Purple hazed! Team Colleague Featured Poster

hmm.. All the best !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome Tring!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

can the $_request variable be used to recall a page instead of an textarea?

Nope.. You can only use $_REQUEST to get the value from a form.
Umm.. I think you can try, $message = implode("",file("broad_prev.php")); Not sure, but you can try that.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Why not write a new script ? You can check this example here to send mails with attachments.
http://www.webcheatsheet.com/PHP/send_email_text_html_attachment.php

nav33n 472 Purple hazed! Team Colleague Featured Poster

i think that is how you wanted me to put it. it is now giving me an error when i try to load the page saying unexpected $ at the end of the code but this must have something to do with the $message=. within the html code.

No.. there is an unclosed bracket.. Find it and close it !

nav33n 472 Purple hazed! Team Colleague Featured Poster

AFAIK, Its not possible.