nav33n 472 Purple hazed! Team Colleague Featured Poster

yeah.. thats unixtimestamp.. $tomorrow1=date("Y-m-d",$tomorrow1); That will convert it to the date format yyyy-mm-dd.

nav33n 472 Purple hazed! Team Colleague Featured Poster
nav33n 472 Purple hazed! Team Colleague Featured Poster

Anything is a universal set which consists of something and nothing.

nav33n 472 Purple hazed! Team Colleague Featured Poster
$result=mysql_query("SELECT leaveid,lname,date2 FROM applyleave where date3=$tomorrow1");

The query is correct. but its missing ''. $tomorrow1 should be in ''. The best way is to assign the query to a variable and then use mysql_query. Eg.

$query = "SELECT leaveid,lname,date2 FROM applyleave where date3='$tomorrow1'"; 
$result=mysql_query($query);

This way, if your query isn't working, you can print $query, execute it in phpmyadmin and then debug the error.

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

simple.

<?php
$cart = array(array("Item", 6.99),(array("Item 2", 13.99)));  //$cart is a 2 dimensional array
print_r($cart); //print the contents of cart
unset($cart[0]); //unset 0th array element
print_r($cart); //print the cart
sort($cart); //sort the cart elements 
print_r($cart); //print sorted cart
?>

Thats it. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yes but things like yelling are actually going to do more long term damage mentally to the child

What do you mean by long term mental damage ? I think its much easier to forget one's yelling than getting spanked.

nav33n 472 Purple hazed! Team Colleague Featured Poster

If the kid's behaviour is like Dennis (the menace), then he should be punished. And when i say "he should be punished", i dont mean physical abuse. Physical abuse is bad.
And hey, fiery look and a lil yelling can be useful sometimes ! :D

nav33n 472 Purple hazed! Team Colleague Featured Poster

I created the table, inserted some values to the tables. I used the following queries and i got the output.

SELECT t1.name, t2.day1, t2.time1
FROM member AS t1
INNER JOIN attend AS t2 ON t1.spid = t2.spid
WHERE t2.day1
BETWEEN '2007-12-01'
AND '2007-12-10'
LIMIT 0 , 30

This is the output that i got.

name |	day1 |	time1
-------------------------------
aaa | 2007-12-04 | 	 
bbb | 2007-12-03 |	 
ddd | 2007-12-02 |	 
ddd | 2007-12-02 |	 
fff  | 2007-12-02 |

I am querying the table to return only those rows where day1 is between dec 1st and dec 10th and return only those rows where spid in table 1 is equal to spid in table2. I wonder why it works for me and not you ! Check if you have any entries in tables. Also check how you are passing the variables $from and $to. Since its a date field, If your format is wrong, it will not return anything.
I hope this helps :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

hmm.. my suggestion is, go to phpmyadmin, export the table structure and post them here.. (both the tables). This way, it would be easier for us to know what exactly you want and what is the table structure.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Do you want unique ips to be put in that text file ? If thats the case, then you fetch the contents of the file uniqueLogs.txt as an array. Then, check if the ip address of the visitor is in that array. If it exists, then don't write the ip to the file, else, write the ip.
eg.

$ip_array=file($filename);
if(! in_array($visitor_ip, $ip_array)){
 //write $visitor_ip to $filename
} else {
// $visitor_ip is already in the file.. do nothing 
}

Basically, it all depends on how you save the ip in the text file. Make sure you write it in such a way that its easier to access and use.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Your query is wrong for 2 reasons.
1. The sub query returns more than 1 record. eg. where id = (1,2,3,4) isn't valid. You should use IN clause.
2. The sub query should return only id. You are trying to fetch day and time, which fails query 1. Anyway, your query should be

SELECT t1.name, t2.day,t2.time
  FROM table1 AS t1 INNER JOIN table2 AS t2 ON t1.id = t2.id where t2.day between '$from' and '$to';

And please dont create duplicate threads. :)

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

This is mail.html. Here you can add the checkboxes specifying the email address as values to those checkboxes.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Send mail</title>
</head>

<body>
<form action="mail.php" method="post">
<INPUT TYPE="checkbox" NAME="chk1" value="example1@example.com">Name 1 <br />
<INPUT TYPE="checkbox" NAME="chk2" value="example2@example.com">Name 2 <br />
<INPUT TYPE="checkbox" NAME="chk3" value="example3@example.com">Name 3 <br />
<INPUT TYPE="checkbox" NAME="chk4" value="example4@example.com">Name 4 <br />
<INPUT TYPE="checkbox" NAME="chk5" value="example5@example.com">Name 5 <br />
<INPUT TYPE="checkbox" NAME="chk6" value="example6@example.com">Name 6 <br />
<INPUT TYPE="checkbox" NAME="chk7" value="example7@example.com">Name 7 <br />
<input type="submit" value="Submit" name="submit">
</form>
</body>
</html>

This is mail.php. Here you loop through all the posted variables, check if its value is submit, if it is submit, then skip it, else, send a mail !

<?php //mail.php
foreach ($_POST as $key => $value){
	if($value !="Submit"){
		$to = $value;
		$email="noreply@yoursite.com";
		$subject="Test mail !!!!";
		$message = "Hey ! I dont have any message !";
		mail($to,$subject,$message,"From:".$email);
	}
}
?>

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

Is The Problem and this is the reason this world will continue fighting whether jihadi or other forces.

Now that makes me a jihadi ? eh ? :(

nav33n 472 Purple hazed! Team Colleague Featured Poster

thanks venomlash :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

I am not afraid of "natural death",cuz one has to die some day. But, I dont like getting shot. :)
oh, btw, I dont care where i go after death.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Alright.. There are few mistakes in your mail script. \n should be put in "". Well, Here is the corrected code.

<?php //mail.php
function checkOK($field)
{
if (eregi("\r",$field) || eregi("\n",$field)){
die("Invalid Input!");
}
}

$name=$_POST['name'];
checkOK($name);
$email=$_POST['email'];
checkOK($email);
$comments=$_POST['comments'];
checkOK($comments);
$to="existing.user@gmail.com";
$message=$name."just filled in your comments form. They said: \n". $comments ."\n\nTheir e-mail address was:".$email;
if(mail($to,"Comments From Your Site",$message,"From: $email.\n")) {
echo "Thanks for your comments.";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>

Hope it helps..

nav33n 472 Purple hazed! Team Colleague Featured Poster

U see you love your life alone...

Nope. I love everything which has life, even those clean/dirty cockroaches which live in gutter. I just hate people who kill others in the name of jihad or allah.

nav33n 472 Purple hazed! Team Colleague Featured Poster

opinion of a person depends on his beliefs and sometimes,facts.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Are you high?

I wish i was :( ! But the 'end result' (of giving a burnt USB drive to your enemy) depends on your enemy. There are still good people, you see :D

nav33n 472 Purple hazed! Team Colleague Featured Poster

Thanks for your explanation Mr.Peace.

Mr. nav33n
There are muslims at large in India...if you ever confront with any Mujahid or Jihadi then ask him that whether he even has the knowledge about all the Muslim states existing in the world and whether he has any knowledge of Quran other than the topic of Jihad.
Any criticism is welcomed

I really DONT want to have any face to face talks with a mujahid or a jihadi. I love my life. Thanks again !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Mr. Peace, can you explain a bit more on jihad ? can you also explain why some terrorists call themselves jihaadis ?

http://en.wikipedia.org/wiki/Jihadi ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

cool..

thanks for the link as well.. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

The only possibility is
mysql.allow_persistent is turned off in your php.ini file or it must be commented.

Uncomment it and change it value to On. Restart apache/web server and try again.

nav33n 472 Purple hazed! Team Colleague Featured Poster

what we do in php is, open the csv file using fopen. Then using the filepointer of fopen, we store the csv values in an array. Then access that array. for example, (in php ie.,)

<?php
$fp = fopen("test.csv", "r"); //open the csv file
while ($contents = fgetcsv ($fp, 1000, ";")) { // fetch the contents of the csv file. ';' is the delimiter of the fields in csv file
		$name=$contents[0]; //first element of array $contents has $name	
//insert to table
$age=$contents[1]; //age is the 2nd element of array
//update the table
}
?>

Look for a similar function in jsp. (to open the file and get the contents of csv).

Hope it helps.
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

Airlines built in germany are the best.

nav33n 472 Purple hazed! Team Colleague Featured Poster

you are welcome.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Try <script type="text/javascript">

I haven't worked on IE7 though.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Sir Naveen is pretty famous here.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Alright. You need to check these 2 things.

1. The form has no name. name = "userdetails" is missing.
2. Textarea name is caddr, but you are checking for address.

Other than that, I dont see anything wrong. This should work.

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can just validate it through javascript(Or to check if that field has some value or not.) But, Its much easier if you do it in php. eg.

if(isset($_POST['sci_name'])){
echo "Scientific name is ". $_POST['sci_name'];
}
if(isset($_POST['name'])){
echo "General name is ". $_POST['name'];
}
nav33n 472 Purple hazed! Team Colleague Featured Poster

in php, you have fpdf classes to convert html/text to pdf. I guess there are classes in .net to do the same . Which server side scripting language are you using ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

it works for me though. oh, btw, textbox1 and textbox2 holds the range of rank. And unless you show us what you have done so far, its difficult for us to know what exactly you want.

nav33n 472 Purple hazed! Team Colleague Featured Poster

select * from table1 where id=$id IN (select id from table2 where rank BETWEEN 'textbox1' AND 'textbox2' )
i want to know whether the above query is correct...i want something like that

Why don't you test it yourself. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Send it as a gift to your foe. He will be happy that hes getting "something" from his "enemy". He will then stop hating you :D

nav33n 472 Purple hazed! Team Colleague Featured Poster

why does the admin selects the student's name from the dropdown list ? anyway, you can use this query. select * from table1 where id IN (select id from table2 where rank BETWEEN 'textbox1' AND 'textbox2' ) This query will select all the rows in table 1 whose rank is between 1 and 10 of table2.

nav33n 472 Purple hazed! Team Colleague Featured Poster

give us what you have written so far.

nav33n 472 Purple hazed! Team Colleague Featured Poster

can you show the table structure and what columns do you want from both the tables and on what criteria ? If you want to use joins, you can do it this way. select table1.id, table1.name, table2.col_name1,table2.col_name2 where table1.id=table2.spid; This will list all the records from table1 and table2 based on the condition id(table1) = spid(table2).

nav33n 472 Purple hazed! Team Colleague Featured Poster

You have mentioned you want the rest of the data from 2nd table. But in your query, why do you have a where clause ? where are you passing the id from ? from a php page ? its not a bug. its a syntax error.
http://www.webdevelopersnotes.com/tutorials/sql/tutorial_mysql_in_and_between.php3
This is the way to use IN clause. Can you provide us more information ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

http://www.daniweb.com/forums/thread99569.html

Thats a simple example on how to sort records based on a column.

And about the password, if you are storing the username/password in the database, ask the user to enter username and password. Check if that username & password are in the table. If true, then redirect the user to this table page. Else, redirect him to error page.

What do you mean by search for data on that page only ? are you having a textbox to accept search string or are you talking about control + F /find ?

nav33n 472 Purple hazed! Team Colleague Featured Poster
<?php
session_start();
$id=$_GET['fileid'];
if($id=="1")
{
$dwnld = "File1.zip";
}
else if($id=="2")
{
$dwnld = "File2.zip";
}
else if($id=="3")
{
$dwnld= "File3.zip";
}
if($id)
{
 header("Content-type: application/octet-stream"); //to specify the content-type of the file. 
header("Content-Disposition: attachment; filename=".$dwnld."\n\n"); //to 'generate' that file save dialog box
echo $dwnld; // writing the contents to that file.
}
?>

I hope it helps.

nav33n 472 Purple hazed! Team Colleague Featured Poster
if($chapter!=0){  // if chapter has some value and if its not 0.
   $prev_link=$chapter - 1; //set previous link as chapter - 1.
} else {
$prev_link=0; //if chapter = 0, then theres no previous link, make it 0 as well.
}
if($chapter < count($lines)){ //if the chapter is less than the number of lines, next_link is valid.
   $next_link=$chapter + 1; //assign next chapter to $next_link
}


echo "<a href='file.php?chapter=$prev_link'>Previous chapter</a><br>";
echo "<a href='file.php?chapter=$next_link'>Next  chapter</a><br>

Thats it, i guess. Btw, most of the people dont use vars anymore. Its outdated. You can do something like this.
[inline]
$file_select=(isset($_REQUEST))?$_REQUEST: "ttc_intro";[/inline] Here you are checking if file_select has been set by any of the methods, $_GET or $_POST. if its set, then assign that value to $file_select, else, assign ttc_intro to $file_select. You can do the same thing while checking for chapters as well..

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

word game is what we are playing and the title says its fantastic.

nav33n 472 Purple hazed! Team Colleague Featured Poster

again you have ended your sentence with "again" !!!

nav33n 472 Purple hazed! Team Colleague Featured Poster

team spirit is what we lack.

nav33n 472 Purple hazed! Team Colleague Featured Poster
<?php
$data[0]=88;
$data[3]=44;
$data[4]=2232;
echo "
<html>
<head>
<script type=\"text/javascript\">
function test(){
	
alert('$data[0]');
}
</script>
</head>
<body onload=\"javascript: test();\">
</body>
</html>";
?>

This is how you can use php variables in your javascript. This is just an example.

nav33n 472 Purple hazed! Team Colleague Featured Poster

you are welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

using order by clause.

order by date asc | desc

nav33n 472 Purple hazed! Team Colleague Featured Poster

sick-ness is one thing that doesn't bother me.

nav33n 472 Purple hazed! Team Colleague Featured Poster

topic is interesting, I agree, but where is everyone ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

how does the admin enter the dates? does he have a form ? what is the name of those text fields ? basically, this will work.

$sql="select * from table where date between '$start_date' and '$end_date'";

$start_date and $end_date are post variables of the form.