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

What are you exactly trying to do ? It would be really helpful if you use code tags to wrap your code.

nav33n 472 Purple hazed! Team Colleague Featured Poster

if(category==("servicetype"))

should be,

if($_POST['category'] == "servicetype") {
//do this
}
nav33n 472 Purple hazed! Team Colleague Featured Poster

Cool ! Good job :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Can you post your code ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Are you planning to store the lyrics in a database ? If your answer is Yes, then all you need is one page. Just fetch the lyrics (of a particular song) and display it the way you want.

nav33n 472 Purple hazed! Team Colleague Featured Poster

I hope you have session_start in all the required pages. If so, you can try to print out the session variables first, to see if it really has the values.
Try print_r($_SESSION); in all the pages and check if the session variables are really storing any values.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Well, Whenever you start a session, a cookie is set (if you have configured sessions with cookies). That will have the current session's id. PHPSESSID is its name. You can do 2 things to delete the cookies.
1. Name your session using session_name and use setcookie to delete the cookie while destroying the session.
2. If you don't want to name your session, just use setcookie to destroy the cookie with name PHPSESSID. I have tried it and it works!

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

Strange! Now, execute this query in mysql console or phpmyadmin. If it still doesn't update, check the column datatype. :S I don't see any problem with the query.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Well, Thats because, $_SESSION['getdisplayname']=$displayname; is being set after you include/require outlineget.php . That is, $_SESSION is empty on the first run. So, outlineget.php will not display anything.

$conn=mysql_connect(".....") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db('db1') or die (mysql_error());

$displayname = $_SESSION;

$displayname is null here. The solution is to make sure $_SESSION has a value before you include outlineget.php.

I hope its pretty clear. Eh ?

Kavitha Butchi commented: thanx a ton , this simple analysis really solved my problem +1
nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. OmniX, isn't this problem solved yet ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Before while have this. print mysql_num_rows($r1); I believe, your query doesn't return any records. :)
The above print statement, will print the number of records found for the select query.

nav33n 472 Purple hazed! Team Colleague Featured Poster

What exactly does it print ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Right.. :) But one thing though.

But still the point I had about the third quotation mark (or apostrophe) needs to be put to use if you are using MySQL 5.*

Its optional and not mandatory.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Its the property (or the structure) of the table.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Well,

<?php
  setcookie("user", "Alex Porter", time()+3600);
  
 	setcookie("user", "", time()-3600);

  	print "<pre>";
		print_r($_COOKIE);
  	print "</pre>";

?>

First, comment out deleting the cookie part and execute the script. Open "Tools -> Options -> Privacy -> Show cookies". You will see a cookie from localhost.
Now, uncomment deleting the cookie part and execute the script. Again, check if a cookie exists from localhost.
I have tested it and it deletes the cookie from localhost.

nav33n 472 Purple hazed! Team Colleague Featured Poster

:-/ Did you see the table structure of the OP ? I am talking about column name "thread". Btw, a "row" represents "data" of the table and "column" represents the "columnname" (irrespective of how it displays the structure).

nav33n 472 Purple hazed! Team Colleague Featured Poster

Well, here is the table structure for you.

+---------------+-------------+------+-----+---------+----------------+
| Field         | Type        | Null | Key | Default | Extra          |
+---------------+-------------+------+-----+---------+----------------+
| idx           | int(11)     | NO   | PRI | NULL    | auto_increment | 
| name          | varchar(20) | NO   |     | NULL    |                | 
| passwd        | varchar(20) | NO   |     | NULL    |                | 
| title         | varchar(80) | NO   |     | NULL    |                | 
| date          | varchar(10) | NO   |     | NULL    |                | 
| time          | varchar(8)  | NO   |     | NULL    |                | 
| hit           | int(11)     | NO   |     | NULL    |                | 
| contents      | text        | NO   | MUL | NULL    |                | 
| thread        | int(11)     | NO   | UNI | NULL    |                | 
| depth         | int(11)     | NO   |     | NULL    |                | 
| is_comment    | int(11)     | NO   |     | NULL    |                | 
| parent_thread | int(11)     | NO   |     | NULL    |                | 
| comment_num   | int(11)     | NO   |     | NULL    |                | 
+---------------+-------------+------+-----+---------+----------------+
13 rows in set (0.00 sec)

Thread is a column name of type int.

nav33n 472 Purple hazed! Team Colleague Featured Poster

If MySQL 5.* is being used then it is most likely you have this all wrong. This is because on some servers, MySQL 5 requires the apostrophe or as I would call it, the third quotation mark. Also the structure of the code is wrong as you need to refer to the column first.
So try the following.

$query = "SELECT * FROM `freeboard` WHERE `field` = 'is_comment' AND (`Type` ='0' OR `Null` = '0' OR `Key` = '0' OR `Default` = '0') ORDER BY 'thread' desc";

The only part of the above code I am not sure about is the following as it does not refer to any appropriate columns and I don't think there are any:

ORDER BY 'thread' desc

Also as a general notice, make sure you have the right code to connect to the MySQL database as that can cause the same error message.

1. ` can be used and not '
2. I don't know what Type, Null, Key or Default you are talking about in your query.
3. As I can see from the table structure posted by OP, there is a column called thread.

nav33n 472 Purple hazed! Team Colleague Featured Poster

There is no function called equals. Have you written a function called equals ?
Btw, == is the comparison operator. if($value1 == $value2)

nav33n 472 Purple hazed! Team Colleague Featured Poster

space ? &nbsp; :S I don't think I understood your problem there!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yes I do have one. Please pm to get the bulk coupon.
Anybody interested in buying itechbids v7.0 @ 10% discount? Please use
my reseller coupon: RES3215.

Don't you think you have spammed enough for the day ?

nav33n 472 Purple hazed! Team Colleague Featured Poster
$query = "SELECT * FROM freeboard where is_comment = 0 order by thread desc";

Notice that I have removed unwanted '.

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

Yes I do have one. Please pm to get the bulk coupon.
Anybody interested in buying itechbids v7.0 @ 10% discount? Please use
my reseller coupon: RES3215.

I wonder why the mods haven't banned you yet.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Post your code. Lets see where you have gone wrong.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Okay. Do this.

$query = "update client set dod='$dod', mod='$mod',yod='$yod' where id='$id'";
echo $query;
mysql_query($query);

Tell us what it prints.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Okay. This is how you do it.

$res = mysql_query("select * from table1 where column1='value'"); 
while($row = mysql_fetch_array($res)) {
$value2 = $row['column2']; //assign column2 value to $value2
$query = mysql_query("update table2 set col2='$value2'"); //update col2 in table2
}
?>
nav33n 472 Purple hazed! Team Colleague Featured Poster

if somebody could point out the error..

mysql_query("update client set dod='$dod', mod='$mod',yod='$yod' where id='$id'");

seems perfectly fine. Your 3 queries are also fine. I don't see any error as there isn't any.

nav33n 472 Purple hazed! Team Colleague Featured Poster

add this to your httpd.conf file

AddType application/x-httpd-php .php

and also add this line if it isn't there already.

LoadModule php5_module "c:/wamp/php/php5apache2_2.dll"

nav33n 472 Purple hazed! Team Colleague Featured Poster

This is how you fetch the record and this is how you insert it.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can do a session check. For example, in the contact form, set a session variable, say, $_SESSION['valid'] = "true"; In the script which does the processing, check if $_SESSION is set and its true. If yes, then process the form.

<?php
session_start();
if(isset($_SESSION['valid']) && $_SESSION['valid']=="true") {
 //process
} else {
 echo "You are in the wrong place!";
}

Or, you can also do it this way.
In the contact form, assign the value of session_id() to a hidden textbox. Then in the script, check if $_POST value is equal to session_id().

nav33n 472 Purple hazed! Team Colleague Featured Poster

Try this.

$message = 
"Cape Town Alive - Cape Xtreme Booking Request <br> Name: ". cleanPosUrl($_POST['posName']) ."Email: ". cleanPosUrl($_POST['posEmail']) ."Staying: ". cleanPosUrl($_POST['posStaying']) ."Country:". cleanPosUrl($_POST['posCountry']) ."Contact: ". cleanPosUrl($_POST['posContact']) ."Actvity: ". cleanPosUrl($_POST['posActivity']) ."Comments: ". cleanPosUrl($_POST['posComments']);

Umm.. Why are you having ; at the end of every function call ? Moreover, <br> is a html tag and it should be in quotes.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Do you have mysql_connect and mysql_select_db in database.php ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

1. How are you determining whether the user is a student or the teacher ? Do you have a form where the user selects whether he is a student or a teacher ?
2. If you have a dropdown in page1 where the user can select what type of user he is (student or teacher), then you can take respective action in page2 depending upon his choice in page1.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yes I do have one. Please pm to get the bulk coupon.
Anybody interested in buying itechbids v7.0 @ 10% discount? Please use
my reseller coupon: RES3215.

Stop advertising.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm..so, for example, if the admin uploads a file called "naveen_1.txt" and "naveen_2.txt" , If I log in (with username naveen), then it has to list only these 2 files ?
If that's the case, then open the dir(where the uploaded files are placed) , check if the username (naveen in this case) is a part of the filename and list those files.

nav33n 472 Purple hazed! Team Colleague Featured Poster

The menus aren't the same in all the pages. In this page, http://worldofpakistan.net/cms/controlpanel.php , user control seems cluttered. And also, in index.php, website statistics is out of place. See the screenshot to see what I am talking about. Good job btw !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Just like how you do it for text fields. $value = $_POST['dropdownboxname'];

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) You are welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Then this will do the trick for you.

<?php
// connect (host, usr, and pwd are previously defined, correctly)
$cid = mysql_connect( $host, $usr, $pwd );

// get all columns from the table 'accounts', $db was previously defined (database name)
$query = "DELETE FROM accounts where usern='caughtusername'";
$result = mysql_db_query( $db, $query, $cid );
?>

Ofcourse, $db, $host,$usr and $pwd has to be defined..

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. Let me get something clear.. You want to delete only the records where the usern field has the value "caughtusername". Right ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Example,

<?php
session_start();
if($_SESSION['user'] == "admin") {
 echo "<a href=link.php?user=$username&hash=some_hash_to_check_a_valid_user> Click here </a>";
} 
?>

If the user is admin, then it will show the above link. Also, in link.php, have a security check to cross check if the user is really an admin!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Why so many "\n" between every line ? Anyway,

I have coded this, but it shows me errors. I guess i may be mixing HTML and PHP code at some place, but am unable to figure it out... pls help me out if u can...

What are the errors ?
And what exactly are you trying to do ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

What exactly are you trying to do ? I mean, Do you have to show that message at the end ? ie., spared and deleted ?
If no, You can use the query,

$query = "delete from accounts where usern = 'caughtusername'";
mysql_query($query);

This will delete all the records from table accounts where usern is "caughtusername".
But, If you want to display that message, you can try this way.

$cid = mysql_connect( $host, $usr, $pwd );

// get all columns from the table 'accounts', $db was previously defined (database name)
$query = "SELECT * FROM accounts";
$result = mysql_db_query( $db, $query, $cid );

// run through each row looking for column 'usrn' with the value 'caughtusername'
while( $row = mysql_fetch_array($result)) {
	$username = $row['usern'];
	$id = $row['id'];
	if($username == "caughtusername") {
		$query = "DELETE  FROM accounts WHERE id=".$id;
		// execute the deletion statement
		$result = mysql_db_query( $db, $query, $cid );
		echo "<b>Deleted: </b>" . $username . "<br>";
	} else {
		echo "<b>Spared: </b>" . $username . "<br>";
	}
}

Give it a try and tell us if it works!

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can use crossloop !

nav33n 472 Purple hazed! Team Colleague Featured Poster

What exception does it throw ? I don't see anything wrong with your script :S
Umm.. one question though. Why don't you query the table using the condition where usern="caughtusername"; and delete all those records ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Huh.. Can you post your code ? (because I have never heard of this problem before!)

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

how would you reccomend cleaning it up.

Like this ?

$letter = $_GET['LETTER'];
if(!empty($letter)) {
$sql = "SELECT `EndowmentNumber`,`LotSize`,`Letter`,`Section`, `LotNumber`,`LotOwner`,`LastName`,`FirstName`,`MiddleInitial`, `MaidenName`,`Suffix`,`Born`,`Died`,`VeteranInfo`,`MiscInfo` FROM `BurialsTable` WHERE Letter='".$letter."' ORDER BY `Letter`, `LastName`, `FirstName`, `FirstName`, `Section`, `LotNumber` ";
}

This one query will do exactly what you are trying to do with so many conditions and queries.