nav33n 472 Purple hazed! Team Colleague Featured Poster

bbman, Why are you talking to yourself ?

Sulley's Boo commented: haaa i wonder O_o .. tu waapas aaja +8
nav33n 472 Purple hazed! Team Colleague Featured Poster

Since when did Daniweb turn into a "Tips for dating" site ? :-/

nav33n 472 Purple hazed! Team Colleague Featured Poster

I love the 'End' key on my keyboard :)

Only if you knew where "Start new thread" button is. Else, it's just another key, like, Page up or Page down.

And I agree, many people (newcomers) are still searching for this button. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

...
.....
You guys have a massive superiority complex which prevents you from ever achieving anything, as you think you don't have to achieve anything because of that inherent superiority you think to have.
I see this in a lot of Indians. Instead of trying to improve their own skills they try to get others to do their work for them, then claim the results as their own.

Jwenting, Why is it that whenever I see a racist remark, I see your name next to it ?

1) because the vast majority of Indians (at least the current crop, not talking about professionals who got their education in the UK and US up to about a decade ago) don't care about getting an education, all they care about is raking in the certificates without any actual effort on their part because that's what gets their resumes selected by bodyshops and sold to US firms so they can get fraudulent H1b work permits.

Fail. Do you even know that there are top class universities [read IIMs, IITs, Birla Institute of Technology, etc] in India ? You don't have to go to UK or the US to get education. Though I agree that UK or US have better education system than ours, the above mentioned universities aren't doing any bad job either.

Oh, FYI, Having only the certificates will not get you a job. You should be qualified and should have what it takes [knowledge] to clear …

maydhyam commented: Well said!!! +0
nav33n 472 Purple hazed! Team Colleague Featured Poster

If you hover over the popularity bar, You'll see the total number of views for that thread. I remember Dani mentioning this sometime ago.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Here are some Did you know? facts to you, signature spammers.

1. Did you know that guest users cannot see your signatures ? So, whatever you are trying to do[sig spam ie.,] is futile.
2. Did you know that 99% of the registered members WILL NOT click on your spam links ? The regulars here know what to click and what not to click.
3. Did you know that your links in the signature are not followed [ nofollow attribute] by Daniweb ? [ie.,your signature serves no purpose to increase the pagerank of your site.]

Do you now feel enlightened ? :icon_rolleyes:

nav33n 472 Purple hazed! Team Colleague Featured Poster

I have emailed you what I have in my code. Thank you

Please keep it on the site. That's what the forum is for. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yes, 2 [1 and 2] major issues have been fixed. However,

* If you type a reply and click on "Post reply to this thread", it will ask me to register [not log in]

still asks me to register instead of login. Good job Dani! Yay!:)

nav33n 472 Purple hazed! Team Colleague Featured Poster

This is one of the case.

1. You get a mail saying you got a PM from a member. You click on the link in the mail, which is something like this.
http://www.daniweb.com/forums/private.php?utm_source=vBMail&utm_medium=email&utm_campaign=NewPM
If you are on a public computer and if you haven't saved a cookie, it will ask you to log in. When you enter your username and password, username and password is processed, http://www.daniweb.com/forums/login.php?do=login . You get a message, which says,

Thank you for logging in, nav33n.

Click here if your browser does not automatically redirect you.

This redirects you back to http://www.daniweb.com/forums/private.php?utm_source=vBMail&utm_medium=email&utm_campaign=NewPM . Clicking on Click here if your browser does not automatically redirect you. doesn't log me in either.

2. The same thing happens when somebody replies to a thread you have subscribed to. You get a mail. You click on the link to open the thread. Like this for example.
http://www.daniweb.com/forums/post1237554.html#post1237554 . Here too,
* If you type a reply and click on "Post reply to this thread", it will ask me to register [not log in]. url: http://www.daniweb.com/forums/newreply.php?do=newreply&t=238667
* If you just click on "Post reply to this thread" without entering anything, it will ask me to login. url: http://www.daniweb.com/forums/newreply.php?do=newreply&t=238667

if(!isset($_SESSION['userid'])) {
    if(!empty(quickeditor)) {
      show_registration_screen();
    } else {
        show_login_screen();
    }
}

I didn't try registering again. But login screen doesn't log me in, but redirects me back to the same url.

So, I am guessing, …

nav33n 472 Purple hazed! Team Colleague Featured Poster

Dani! You still haven't fixed this one.

nav33n 472 Purple hazed! Team Colleague Featured Poster

I love to be in social networking sites and any community based site.

Why ? to spam ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Cheers! If your problem is solved, mark this thread as "Solved". :)

nav33n 472 Purple hazed! Team Colleague Featured Poster
if ($result)
			{  
				while($row = mysql_fetch_assoc($result)) {
				$referral[] = $row['title'];

				}  
                          }
			return $referral;

		}

You use a while loop to loop through all the result returned by the query, put it in an array and return the array.
Then call the function,

$poems = $database->getLastPoems();
foreach($poems as $poemname) {
  echo $poemname;
}

Something like that.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Check php's mysql_insert_id or mysql's last_insert_id

Both functions return the auto increment id from the previous insert query.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Huh! You don't know about Spammy apple, spam sandwich and of course, the world famous spamified pasta? It used to be healthy, but not anymore. But, I guess, Ana12 can give you a list of the best, healthy spam! :icon_biggrin:

nav33n 472 Purple hazed! Team Colleague Featured Poster

First of all, echo $referral in file1 will definitely not print anything because, the scope of the variable $referral is local to the function getLastPoems and is not available outside the function.

I modified your code a bit and tried it. The problem is with the query.

$q = "SELECT title FROM". TBL_POEMS. "LIMIT 0,10";

This will be,

SELECT title FROMpoemtablenameLIMIT 0,10

You see what I am saying ? You need to have a 'space' after FROM and before LIMIT.
ie.,

$q = "SELECT title FROM ". TBL_POEMS. " LIMIT 0,10";

Cheers!
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

Okay, Have you turned off your errors ? Can you post all the related code ?

I hope you are using this function getLastPoems in a class and can connect to the database without any problems.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Did you print the query and execute it in mysql console ? Maybe the query itself is returning an empty result set. Also print $referral value inside the function to see if it has any value.

nav33n 472 Purple hazed! Team Colleague Featured Poster

This doesn't make any sense to me.

Question Answered? Mark this Thread as Unsolved

Why would someone mark a "solved thread" as "Unsolved" if they got their questions answered ? :-/

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hi. Welcome to Daniweb.

Instead of returning $referral, you are returning $result. $result will have the mysql result resource from the previous query [select query] if the query was successful OR it will have 'false' if the query fails.
Read more on mysql_query here.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Thanks for the information. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

@shekar.bdn,

Don't create multiple threads asking incomplete questions like these. Read forum rules and follow it.

Thread closed.

nav33n 472 Purple hazed! Team Colleague Featured Poster
<?php 
//get which column clicked, if empty, assign first column as default.
$col = $_REQUEST['col'];
if(empty($col)) {
	$col = "siteid";
}
//sort type asc or desc. Defaults to asc
$sort = ($_REQUEST['sort'] == "asc") ? "desc" : "asc";
//display table. I have used href tag to show how it works. href has 2 variables col [column] and sort [sorting order]
echo "<table cellpadding=2 align=center cellspacing=2 width=90% style='font-family:Calibri,Arial' >";
echo "<tr>";
echo "<td bgcolor=#666666 width='250px'><a href='testing.php?col=siteid&sort=$sort'>Site ID</a></td>";
echo "<td bgcolor=#666666 width='250px'><a href='testing.php?col=code&sort=$sort'>Code</a></td>";
echo "<td bgcolor=#666666><a href='testing.php?col=ownername&sort=$sort'>Owner Name</a></td>";
echo "</tr>";
$i =0;
//while loop to assign/fetch values. In your case, mysql_fetch_assoc
while($i < 10) {
	$info['SiteID'] = 134+$i;
	$info['Code'] = 34+$i."a";
	$info['OwnerName'] = "testuser".$i;
	$dataholder[] = $info;
	$i++ ;
}
//in this foreach loop, I am separating every individual clickable column to a separate array. You can do it in the while loop itself. 
foreach ($dataholder as $dataholder_key => $row) {
    $siteid[$dataholder_key]  = $row['SiteID'];
    $code[$dataholder_key] = $row['Code'];
    $ownername[$dataholder_key] = $row['OwnerName'];
}
if($sort == "asc") {
//here, I have used variable variables. ${$col} corresponds to ${siteid} [the default value] or whatever the user has clicked. 
array_multisort(${$col},SORT_DESC,SORT_STRING,$dataholder);
} else {
array_multisort(${$col},SORT_ASC,SORT_STRING,$dataholder);
}

//then displaying the result
foreach($dataholder as $key => $value) {
	$bgcolor = ($bgcolor == '#cccccc') ? '#ffffff' : '#cccccc';
	echo "<tr>";
	echo "<td bgcolor=$bgcolor>" . $value['SiteID'] . "</td>";
	echo "<td bgcolor=$bgcolor>" . $value['Code'] . "</td>";
	echo "<td bgcolor=$bgcolor>" . $value['OwnerName'] . "</td>";
	echo "</tr>";
}
echo "</table>";
 ?>

This is just a quick example on how to use array_multisort. I hope you …

nav33n 472 Purple hazed! Team Colleague Featured Poster

Sorry, I don't have any example/material to explain. Please ask your system admin or do a search in google. That will probably show you the right direction.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Run a cron job every day/night. Check if the date saved in the table has passed expiry date.
If yes,
send mail,
update the table with relevant changes.
If no,
do nothing.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Use Ajax. Refer this .

nav33n 472 Purple hazed! Team Colleague Featured Poster

Use array_multisort. Look at the examples to see the usage.

nav33n 472 Purple hazed! Team Colleague Featured Poster

I stopped eating spam when I realised its not healthy anymore :( [Too much bad cholestrol]

Spam nowadays are low on nutrition and taste. Sigh.

What is the world turning into ?
A place where people can dish out cheap, low level spam and get away with it ?
Noooo! :'(

nav33n 472 Purple hazed! Team Colleague Featured Poster

Now even Daniweb has the same color theme [purple] as my company's website :( .I see purple even in my dreams now! :icon_frown:

Anyways, The layout looks nice and is definitely faster than before. But I have a few complaints.

1. Mouseover quote. It really hurt my eyes to follow the dancing browser.
2. Laaarge "Post reply to this thread" and "Use advanced Editor" when compared to the buttons "Submit Reply" and "Preview Post" in Advanced editor. Even the font size is inconsistent throughout the website.
3. "Mark this forum read" redirects me to the main category! Not sure if it was made this way or a bug.
4. As it has been discussed numerous times already, "Click to hide/show forums" toggle is hard to find.
5. I can't right click on 1 Day Ago and open the thread in a new tab/window. I now have to open the thread, scroll to the end of the page [or press End key] and then click on the last number.
6. I didn't like the integration of voting sytem with the reputation system. If I downvoted someone, I could still give positive rep in the old layout. Now, If I make a mistake, I can't do anything about it!
7. My Favorite Forums, the text looks odd and out of place. No alignment, mixture of CAPS and small case. Eg.

Community Introductions 33 MINUTES AGO

But I like the static bottom menu though. It's …

nav33n 472 Purple hazed! Team Colleague Featured Poster

niths, Read forum rules.

Do not post threads with generic subjects such as "HELP ME" or "PROBLEM". Instead, clearly state a phrase describing the problem as the thread's title. Do not flood the forum by posting the same question more than once (ie in multiple forums).

Use your other thread.
Thread closed.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Ask customtshirts guy! I'm sure he's got a storehouse of funny quotes :P

How about,

"Warning and Infractions can't stop me from posting spam!"
"I am a sig spammer. Shoot me!"
"I <3 1337"
"I hate spammers."
"Favorite passtime: Reporting spammers!"
"I'm a n00b. plzzz help !!!!11"
"Homework kiddo"

:)

nav33n 472 Purple hazed! Team Colleague Featured Poster

First, try print_r to see all the form elements are posted correctly. Try printing the query and see if it executes in mysql console/phpmyadmin.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Nothing wrong with the above code. Do you get any errors ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Honestly, If you had read post # 3 from jeniF, you would have known.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Wow! This Later-- trend is catching up. Later--

nav33n 472 Purple hazed! Team Colleague Featured Poster

But how about alternate ways of handling navigation? What are the most used techniques?

I am not really sure of your question. As far as I know, there is either
* long, dirty urls, like,
http://www.somewebsite.com/edit.php?id=1234&key=xy&somevar=v
or
* friendly urls, like,
http://www.somewebsite.com/edit/1234/xy/v

I am not aware of any other navigation techniques.

Are some ways worse to handle navigation than others? Is the last mentioned way ineffective?

As long as you take good measures to sanitize user's inputs it's okay. For example,

<?php
//mysql connection
//get the page from the url, sanitize it with mysql_real_escape_string
$page = mysql_real_escape_string($_GET['page']);
// $page = home or report
switch($page) {
   case "home":
      //include/print home's contents
    break;
    case "report":
    //include/print report's contents
   break;
   default:
   //show error page
   break;
}

In the above example, a user can only access to only 2 pages, "home" and "report". If he tries anything else, it will take him to the error page [the default case].

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster
<body onload='document.getElementById("username").focus();'>

This will pass the focus to the textbox with id "username" after the document is loaded.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hi,

The bot doesn't quite work as expected.

Welcome to the PHP chat room.

nav33n
Chat to PHP robot

Robo answer
Alright you can build a dynamic xml playlist using php to complete this task but you'll need to have flash coding under you belt plus know how to use flashvars the send from the swf to the php script using post methods or get methods to send to the dynamic php xml script then you'll have to use some flash code to read the xml and the attributes with in the player but this is better to be done by write your own player in flash else if you download a player from some one else this task would not be possible unless the have set up this codes and commands with in the compiled flv to swf before hand and if this is the case you would need to look through there documentation to build the proper php script for the player if you need to learn php and flash together you can go to developphp.

I copied robo answer and pasted it in the window and it generated *a lot* of incomplete, unrelated result which didn't make much sense.
Although, the chat room script is working as intended. The only problem is, when you ask a random question, like, "What is php?", the robo answers only 1 time to the user who is asking the question. But, it ll repeat the same …

nav33n 472 Purple hazed! Team Colleague Featured Poster

It's called friendly urls. It's done through mod_rewrite with apache. Search in php forum, as there have been many threads on this already. I haven't worked on it , so this is all I can say.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Online02 will you please read the rules before posting!!

Online02 has been warned. Please report spammers to keep Daniweb clean :) Thanks.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Gawd! customtshirts, Do you even have a job ? Oh wait, you *do* have a job. Your job is to create stupid dumb threads like these ones and promote your signature links. Wow! I get it. It must be your dream job ? eh?

Please give us all a break, take all your t-shirts, yes, the custom-made ones and just disappear!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Where is the "T shirt"? I didn't find anything like this in your post.

You have all the "T shirt" in your signature, why ask for more ? What's the point in bumping this thread ? I am sure you want to promote your website/signature. eh ? Did you know spammers go straight to hell when they die ? :icon_wink:

nav33n 472 Purple hazed! Team Colleague Featured Poster

If you have no more questions to ask, please mark this thread as solved. :)

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster
$info[] = $row['columnname'];
nav33n 472 Purple hazed! Team Colleague Featured Poster

To disable all notices and errors, use,

error_reporting(~E_ALL);

If you disable errors, You will have a tough time trying to find out where exactly is the problem. Instead, use configuration directive, display_errors. Set this to "off" to hide any kind of error, and "on" to display errors.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You are welcome! Glad I could help. :)

Edit:

I am not really sure how the above code worked. Technically, It shouldn't because nothing is selected yet. :S

nav33n 472 Purple hazed! Team Colleague Featured Poster

Eg.

<?php
$rec_in_table = 2;
?>
<select name='designation'>
<option value='1' <?php if($rec_in_table == 1) { echo "selected"; } ?>>1</option>
<option value='2' <?php if($rec_in_table == 2) { echo "selected"; } ?>>2</option>
<option value='3' <?php if($rec_in_table == 3) { echo "selected"; } ?>>3</option>
</select>
nav33n 472 Purple hazed! Team Colleague Featured Poster

Great :) Good job.

Cheers!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hi. You can do any of these 3 things.
1. Initialize every variable before using.

$x = ""; 
$y = 0; 
$z = array(); ....

2. Change your php.ini file and set error_reporting to the following.

error_reporting = E_ALL & ~E_NOTICE

This will show all the errors except notices.
3. Add this line in your script. This is a runtime setting to show all errors except notices.

<?php
error_reporting(E_ALL & ~E_NOTICE);
//your code here
?>
nav33n 472 Purple hazed! Team Colleague Featured Poster

You have a typo.

if ($_POST["$submit"])
{

should be

if ($_POST["submit"])
   {

And please indent your code. Indented code is easier to debug and find faults.