cwarn23 387 Occupation: Genius Team Colleague Featured Poster

On my system, the most recent replies are below the top of the reply box (so you can't see them).

The more recent replies in my system are appended to the bottom just like msn because IMO it is easier to read. That is if I fix that problem you have stated such as a javascript auto scroller.

gave me same answer as above and then stopped working. ANy way to log out? I don't like the idea of being stuck in something.

To log out just close the page and in 30 seconds without your page pinging the server your will be automatically logged out.

I just got a bunch of jiberish back. lol

It does that a lot as my Algorithm is still a work in Progress.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

it comes back with No database selected.

It means you haven't used the mysql_select_db() function. I would suggest reading up on a mysql tutorial.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi and welcome to daniweb. Could you please edit your post and add code tags. Also as for the solution change the second last line to the following:

$sql_email_check = mysql_query("SELECT email FROM mymembers WHERE email='$emailCHecker'") or die(mysql_error());

Then tell me what error that reports.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I see a bug in your code and try each of the following:

if(isset($_POST['checkbox1'])) {
echo '<p>Send me medical updates about mammography.</p>';
echo '<input type="checkbox" name="checkbox1" checked="checked" value="YES">';
}
if(isset($_POST['checkbox2'])) {
echo '<p>Keep me connected with the latest blog posts.</p>';
echo '<input type="checkbox" name="checkbox1" checked="checked" value="YES">';
}
if(isset($_POST['checkbox3'])) {
echo '<p>Let me know when the book is available.</p>';
echo '<input type="checkbox" name="checkbox3" checked="checked" value="YES">';
}

if (isset($_POST['Submit1'])) {
}
if($_POST['checkbox1']) {
echo '<p>Send me medical updates about mammography.</p>';
{echo '<input type="checkbox" name="checkbox1" checked="checked" value="YES">';
}
if($_POST['checkbox2']) {
echo '<p>Keep me connected with the latest blog posts.</p>';
echo '<input type="checkbox" name="checkbox1" checked="checked" value="YES">';
}
if($_POST['checkbox3']) {
echo '<p>Let me know when the book is available.</p>';
echo '<input type="checkbox" name="checkbox3" checked="checked" value="YES">';
}

if ($_POST['Submit1']) {
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, I am glad to announce the release of the PHP robot which stores information from daniweb topics to answer questions. You may view my bot at http://chat.cwarn23.info/ and it can answer all sorts of questions. In addition you can chat to other people who are online at the time. I would like to hear your comments on how good or bad this project looks. Thanks.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Could you please make this question clear. Are you trying to place an exel file into a database or are you trying to extract the data from excel and place that data into mysql with php?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

When using sessions you need to always place the session_start(); function on the first line of your script before any html or new line output. So delete that new line at the beginning of your file and place at the top the following:

<?php session_start();

That will enable sessions to be used.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

...bourgeois shenanigans.

I will have to use the dictionary for that.

jephthah commented: i win. :P +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

yeah.... your FACE doesnt matter!

lololololol

If your face doesn't matter does that mean your facebook doesn't matter?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The only thing I could suggest is to put a big button saying "Click Here To Exit" the same size as the thread reply button. Surely even the blind would see that and hopefully would stop these odd complains about the signup window.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

i would would suggest i dont know if this is the right way but i would make a table that has a index / username / post_id
so every time the user would click on the new post it would write to the table that he saw it you can also add the date too if you want to show him when he looked at it so then when u load the main page you just query the data into a array from the user and check it against that

I agree. Having a giant table with columns for postid, user, clicked will be able to do the job as then you can use join mysql query's when selecting and get it all to display right the first time round with better efficiency.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Just out of curiosity where did the name Bing for Microsoft's search engine come from. Did they pronounce C sharp like an instrument crossed with programming. I'm not sure and thought I would start a topic to share thoughts on Bings name.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I guess this topic doesn't matter lol.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try this:

// code to generate drop down box
		$query="SELECT title FROM content ORDER BY title ASC";
		$result = mysql_query ($query);
		echo "<select name=title value=''>Title</option>";

		while($nt=mysql_fetch_array($result)){
		echo "<option value=\"$nt[title]\">$nt[title]</option>";
		}
		echo "</select>";
				
//on the next page where its deleted the code is...
// we have something to delete
   	$SQLcmd = "DELETE FROM content WHERE title = '$title'";
 	mysql_query($SQLcmd, $con);
   
	// but did we delete anything....
   	if (mysql_affected_rows() == 0) {
      	echo "<p><font color=#C11B17>You were unsuccessful in deleting the information you requested! Please try again...</font></p>";
   		}
   		else 	{
      		echo "<p>**The information has been successfully deleted**</p>";
	}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi and welcome to daniweb. I see you have a mini tutorial and yes it may be php 101 but I hope you enjoy your time here. Good luck.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Could you provide a better description of your code (perhaps php comments) and describe in more detail why you can't do it. The theory behind it is you search through to inbox in a loop then as you retrieve them the messages go through an if statement and if that if statement passes then it will transfer that message across one by one in the loop.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Not too clear as it looks like the text is copied directly from a homework book but if I'm correct what your looking for is ajax. This is where javascript can communicate with php without refreshing the page. There is a nice tutorial at http://www.tizag.com/ajaxTutorial/
Enjoy.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well you should be able to delete entire sections of your php.ini file and delete the extensions you don't want from the php.ini and from the file system but remember to keep the dependencies. That is some dll's rely on others. The dependencies documentation can be found at php.net. Also when changing the php.ini file remember to change the right php.ini file which can be found with the php_info(); function.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, I have a vps and soon a dedicated with 3.2GHz quad but now the devil has come back to haunt me (DNS). On my current vps I can get the domain cwarn23.info to work but all of my addon and parked domains don't work (eg. chatbac.net). They simply can't resolve the host name. I know there is probably some obvious simple solution that I can't find and below is the dns record for chatbac.net

$ttl 38400
@	IN	SOA	cwarn23.info. root.cwarn23.info. (
			1271417901
			10800
			3600
			604800
			38400 )
@	IN	NS	cwarn23.info.
chatbac.net.	IN	A	110.44.25.66
www.chatbac.net.	IN	A	110.44.25.66
ftp.chatbac.net.	IN	A	110.44.25.66
m.chatbac.net.	IN	A	110.44.25.66
localhost.chatbac.net.	IN	A	127.0.0.1
webmail.chatbac.net.	IN	A	110.44.25.66
admin.chatbac.net.	IN	A	110.44.25.66
mail.chatbac.net.	IN	A	110.44.25.66
chatbac.net.	IN	MX	5 mail.chatbac.net.
chatbac.net.	IN	TXT	"v=spf1 a mx a:chatbac.net ip4:110.44.25.66 ?all"

Now does that look right because I am not sure about where it mentions cwarn23.info or whether it should be chatbac.net instead since it's the chatbac.net record. Any ideas or could somebody post a correction and if further details are required for the host name to resolve correctly then please let me know as I'm stuck in the middle of a rock and a hard place. Thanks a million to whoever can solve this.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Alternatively you may want to change the column type to a blob or char. But for a char type you will need to specify the maximum length of storage input. Also the type of character set you set a table to be can also make a difference.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The all famous classic mail bug. Try the following:

function sendVerificationEmail($email, $code){
		$to = $email;
        $subject = "Please activate your account at ".SITE_NAME;
        $from = "registration@domain.com";
        
        $headers = "From: $from\n".
						   "Reply-To: support@domain.com\n".
						   "X-Mailer: PHP/".phpversion();
				
       
        $message = "Welcome to domain.com\n" .
            "We see that you recently opened an account with us.\n" .
            "Before you can start using our services you need to activate your account.\n" .
            "Follow the link below to activate your account.\n" . 
			SITE_URL."user/activate/?e=" . $to . "&c=" . $code . "&action=activate\n\n" .
            "_______________________\n\n" . "This is an automated response from ". SITE_NAME .
            "\n\n" . "Please do not respond to this email.";

        if(mail($to, $subject, $message, $headers)){ //bug fix
        	return true;
        }else{
        	return false;
        }
	}

If that doesn't work then in addition to that you might need to change the mail() inputs.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

How do you forget your own name?

I guess by being nervous or something. I know it's hard to forget your name but when you do you can make a fool of yourself when introducing yourself or vice versa.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

In your cpanel there will be a remote sql or remote hosts section where you can add in the problem domains/ip's. Generally the hosts provide an interface to allow you to do this such as cpanel or webmin.

thanks for your reply
i will explaine the problem :
i have a server A and the server A www.example.com has a data base A ,server A is online.
i have an other Server B www.example.com i want to access to the database on the server A ,
i searched on the net i found that i have to add the IP of the Server B on the my.cnf file on the server A that called Binding-Ip look at this tutorial http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html but i can't access to the file only the host company can do this. this is my big problem

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I got a joke that is more of a prank which I accidentally did as I forgot my name. This is how it goes. You ring up a local business you know and have talked to before than they ask who is it? So you answer "It's me.". Then they'll say who? You then reply "me". They might ask how do you spell your name. So you spell "m, e.". Then they say "ok me what do you want?" and the person behind them on the phone looks at them like if the person is talking to himself/herself. So then you can say I want to speak to the worker named Bill. Well use a name of a worker that is there. Then they will shout out to back "hey Bill, there is a me on the phone for you." Bill might ask who is it. And the agent would reply "me. Not as in myself but a person called me". True story but funny joke.

jephthah commented: is not teh funnay. +0
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Could you please explain in more detail what your problem is and if necessary provide some code because it is hard to understand with very few details.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Could you elaborate on the question. Sounds like line 29 should be as follows

<form action="upload.php" method="GET">

But I could be wrong as you haven't explained your question with enough detail.
Also when sending pm's to me please just send a pm with a link to your topic page and possibly a quote from the first post as it is a lot more easier replying to forum topics than it is replying to pm's.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Why they have to find patterns in a http page?

Well one reason is because all browsers need to be able to preg_match_all the html tags. The second reason is because javascript provides some regex functions which the browser needs to be able to process.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

And so it is finding whatsupnoequalssign but places my script places an equals symbol at the end? If that is correct then the following should do the job.

$get='';
foreach ($_GET AS $key=>$val) {
$get.=(empty($get) && (!empty($key) || !empty($val)))?'?':'&';
$get.=(empty($key))?'':urlencode($key);
$get.=(!empty($key) && !empty($val))?'=':'';
$get.=(empty($val))?'':urlencode($val);
}
 
$fullurl = "http://www.mysite.com".$_SERVER['SCRIPT_NAME'].$get;
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The $_post["user"] returns a user id num from my database

Then perhaps rename the array to the variable $user and change it elsewhere in the script because using the $_POST array for database retrieval could be your problem and it's insecure too as $_POST is a global array (not good).

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

$user = stripslashes($_POST["user"]);
$dirname = "./cp/userfiles/$user/"; 
 
if (is_dir($dirname)) {    
echo "The directory $user exists";    
} else {    
mkdir("userfiles/$user", 0777);    
echo "The directory $user was successfully created.";    
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Then the following.

$get='';
foreach ($_GET AS $key=>$val) {
$get.=(empty($get))?'?':'&';
$get.=urlencode($key).'='.urlencode($val);
}

$fullurl = "http://www.mysite.com".$_SERVER['SCRIPT_NAME'].$get;
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Do you mean like the following?

$fullurl = "http://www.mysite.com".$_SERVER['SCRIPT_NAME'].'?black='.$_GET['black'];
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

i think the error might be here
$data1=mysql_result($d,0);

Did you read my previous example fully as that code has a bug in it if your following my example. Not that that particular line would effect the if statement.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Perhaps $projectassign isn't it's expected value.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 6 in C:\Program Files\Apache Group\Apache2\htdocs\Project\upload.php on line 50
$data1

Yes I received your pm and the reason for that bug would be because the query returns zero results (no rows). So to solve this use the following:

$sql2="select allocatedmemory from projects where projectname='$projectassign'";
$result=mysql_query($sql2) or die(mysql_error());
if (mysql_num_rows($result)>0) {
$data1=mysql_result($result,0);
} else {
$data1='No data.';
}
echo $data1;
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try this

if (preg_match('/[^0-9,]/', $ids_list)) {
  echo 'No good!';
} else {
  echo 'OK!'; //only 0 to 9 and commas.
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Perhaps this tutorial would help.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try this.

$sql2="select allocatedmemory from projects where projectname='$projectassign'";
    $data1=mysql_query($sql2) or die(mysql_error());
     echo '$data1';

[edit]
Oops, and the echo will need changing to suit your purposes. What are you trying to do on the echo line, trying to display allocatedmemory? If so then try the following

$sql2="select allocatedmemory from projects where projectname='$projectassign'";
$result=mysql_query($sql2) or die(mysql_error());
$data1=mysql_result($result,0);
echo $data1;

[/edit]

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It is fairly simple. The below two links will guide you through the process of using an external smtp server to send emails.
http://blog.taragana.com/index.php/archive/how-to-send-mails-using-smtp-server-in-php/
http://kb.siteground.com/article/How_to_use_Googles_free_SMTP_server.html

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If your using MAMP for Mac then although it would be harder to setup a program like mailman, api's should still work for remote smtp.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Although I haven't tried using imap with gmail I have heard of gmail api's that can be used (unofficial ones) where you can easily connect to gmail and send mail via gmail. So try googling for php gmail api or something like that.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

That's just a few thousand miles away!

And on the other side of the globe with probably a days worth of flights to get there. I hope it is a great success because if I were in Manhattan then I would certainly join. Btw this is my post 2,222 on daniweb so happy post 2222 to cwarn23. Will be looking forward to seeing the photos.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well if you are inserting and want to count then it is a little more tricky. Below is an example that may or may not work.

$time_start = microtime(true);
mysql_query($sql);
sleep(1); //let the server relax after such a big query.
$time_end = microtime(true);
 
$time_for_mysqlquery = $time_end - $time_start;
$number_of_rows=mysql_affected_rows(); //works only for INSERT in previous query

That is the theory behind it anyways. Basically mysql_affected_rows has no inputs unless you specified a linker for mysql_connect() in which case the linker for mysql connect would go between the brackets. Hope that helps.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Did anyone read this post?

A moderation que was only one of many ideas as previously posted. Like what happened to that idea where if a user is replying to a topic older than 4 months a new topic is automatically created. If you wanted to keep the new content that would probably be your best solution.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

A moderation que was only one of many ideas as previously posted. Like what happened to that idea where if a user is replying to a topic older than 4 months a new topic is automatically created. If you wanted to keep the new content that would probably be your best solution.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

IMO having the threads closed after a given time will force the average user to do one of three things:
1 - Become a member then post their first topic
2 - See there is no reply function and bump a 10 year old topic on another site
3 - Become a member and pm for help

Now I know it may seem like not much of an alternative for the average user but it is much better than what the moderators have to put up with now. Also if they were to hijack threads while the tread auto close was in place there is no way they could hijack anything that shouldn't be hijacked. Maybe even make it so that threads with a certain age that get bumped need to be approved by moderators and let there be a popup message saying "are you sure you want this topic to go into the moderation que as it is over 4 months old". I don't know about you but it doesn't look too nice when there are 3 or even 5 year old topics being bumped and sometimes ignored or like most times abused and separated.

How does it make the mods job easier to have threads closed after a given time limit?

If someone wants to post spam they will do it as a new message instead, and it still needs dealing with.

If someone cannot post a hijack to a closed thread they …

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

As it stands at the moment there is a new feature freeze on DaniWeb anyway while Dani prepares a site update, but even allowing for that I can see no compelling reason to change the way things are handled already.

I thought the obvious reason was to make the moderators job a lot easier.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I've just gave you the full query with the solution in the post above!
Did you even run that query?

Yes and to phpise it the code would be as follows

mysql_query('SELECT COUNT(*), fieldID, fieldValue FROM itemfield WHERE fieldID = 8 GROUP BY fieldValue') or die(mysql_error());
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Yes there are several things wrong with that code. One is that the Update sql query seems to be updating with empty variables unless there was something I did not read inside the include(). Also your mysql query's are venerable to sql injections. In other words people can easily hack into your database using your own script and this is a common problem for all noobs in php. That is why I would recommend reading up on the mysql_real_escape_string() function as it will solve that problem when used properly. Also in your delete line file I noticed on line 3 there is a possible syntax error since quotes aren't used but could be wrong there. And next time don't post your mysql password in public domain. Hope that helps...

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

This should be made a sticky. It means there is html or binary output before the function session_start(). Some IDE's put a binary code at the beginning of the file causing this error but one of the more common reasons is that you have some white spacing just before the <?php on line 1. So make sure there isn't even a space before the <?php.