death_oclock 103 Posting Whiz

Have you tried setting the width of <td> to an actual value? <p> tags should word wrap automatically if the width is specified.

death_oclock 103 Posting Whiz

If you have already picked a random word to replace ($choice), why do you need/use $randomWord?

death_oclock 103 Posting Whiz

This code:

picked[value] = 1; // hasn't been picked yet.  Assign to array,
                                // flag as picked.

won't work unless you defined picked with enough space for all the random integers possible (RAND_MAX). This of course is not a great idea because you would waste an awful lot of space. Try setting each array element to the random number generated. To check if it has already been picked, loop through the array and see if there are any matches to the number generated.

death_oclock 103 Posting Whiz

Okay, so what doesn't work about it?

death_oclock 103 Posting Whiz

A sample preg_match script:

$userfound = (preg_match("/\b$username\b/") === 1);
death_oclock 103 Posting Whiz

I don't know where you got the "#s"s from, but you should replace those with a "/" like cwarn23 suggested. Doesn't PHP give you an error on your regexp lines?

death_oclock 103 Posting Whiz

You are declaring insertseek1 as a normal function but then calling it from an object ($db) that doesn't exist in this context. Just do this:

$res=insertseek1($user,$pss);
death_oclock 103 Posting Whiz

In here:

<td width=""><p><?php echo nl2br($message); ?></p></td>
death_oclock 103 Posting Whiz

This thread might help.

death_oclock 103 Posting Whiz

Store it in a session if you need to keep it for an indefinite amount of time. If you need the user to re-enter some information but keep this value the same, add

selected="selected"

inside the <option> tag.

death_oclock 103 Posting Whiz

clock() will get the number of "ticks" since your program started. If this statement is executed at the same point in the program several times (likely), you will see repetition. time() is the better choice, if not for randomness, then just for commonality.

death_oclock 103 Posting Whiz

A waveform is made up of digital samples or frames. You don't need to do this operation in real time, rather you can calculate the length of each sample and set how ever many you need to "low".

death_oclock 103 Posting Whiz

Apart from it you can initiate a char array and then get the input through simple scanf() function.

Scanf can look simple, but it actually does a lot of work under the hood which obviously will slow down your code. Also, it can cause lots of problems if you don't know exactly how it is matching input. It seems like a good idea at first but it is generally regarded as bad coding practice in most cases.

death_oclock 103 Posting Whiz

This is a very minimal login script, but it should work.
This:

if(($rec['username']==$userid)&&($rec['password']==$password)){

is a strange way of checking a result; if there is a result, of course username is going to be equal to $userid.
Better done by (in my opinion):

if($rec && mysql_num_rows($rec) == 1){
death_oclock 103 Posting Whiz

fgets to get the string, strtok to tokenize it. To do this multiple times, just put your code inside the body of a loop.

death_oclock 103 Posting Whiz

Check out topcoder. They have competitions (good for the motivation thing) in three different difficulty levels. The competitions are for designing algorithms and it can be very challenging. You can program in Java, among other languages.

death_oclock 103 Posting Whiz

Pdf files aren't encoded in plain text; if they were there would be no point to having another file type.

death_oclock 103 Posting Whiz

Yes, I understand what you want to do. What is the problem with your code? What is it doing wrong?

death_oclock 103 Posting Whiz

I don't think AJAX would be the best choice, instead use javascript to change the button's style.display value. If you don't know how to do this, I suggest this javascript tutorial (it covers this topic directly). It is always better to actually learn something about a language instead of just getting someone else's code.

death_oclock 103 Posting Whiz

It would help if you learned some PHP yourself so you could tell which ones are "good" or not. Most of them use a basic structure of storing login info in session variables, but more advanced ones will use database features to log user activity and/or provide protection against session fixation, etc.

death_oclock 103 Posting Whiz

You could add another method to check if the number is in the array first. Then only search for it if it is there. Then you don't have to worry about returning "null", or just return 0 since it shouldn't matter (provided the programmer uses your code correctly).

death_oclock 103 Posting Whiz

What exactly do you mean by "online practice"? But check out this thread: C / C++ FAQ's and Practice problems. Yes, thats the C++ forum, but most of the problems can be done just as well in java.

death_oclock 103 Posting Whiz

That's a sensitive thing to do

But the correct thing to do, as "\n" is a pointer, not a char. Comparison between a char and a pointer to a char cannot be expected to work properly (who knows what "properly" even means here?)

death_oclock 103 Posting Whiz

Why use getche? As well as being compiler-specific, it is not very c++-like to use such functions. Here is some info on how C++ does i/o.

death_oclock 103 Posting Whiz

So, what code have you done already, and what are your problems? (In case you haven't heard, we won't do your homework)

death_oclock 103 Posting Whiz

Use a database to store car info (names, image files, etc.) as well as the number of votes that car has gotten. When a car gets a vote, just increase this number by 1.

death_oclock 103 Posting Whiz

Specifically for this purpose, you would likely use serialize and its opposite, unserialize, to store an object as text.

death_oclock 103 Posting Whiz

Learn database functions for whatever db server your client uses (MySQL, whatever). A tutorial on SQL statements and the php manual will help you with this.

death_oclock 103 Posting Whiz

Using <?= is shorthand for printing whatever is between the tags. I don't understand your problem, however. Do you have PHP code stored in a database that you would want to execute?

death_oclock 103 Posting Whiz

How experienced are you in PHP? Things to study would be forms and database manipulation. The database could hold the filenames of all the images you want to keep track of. Forms would be used for uploading and deleting images (that is, telling PHP to do this). A gallery page is as simple as selecting all the image records in the database and printing them in <img /> tags.

death_oclock 103 Posting Whiz

Okay, so what does your code actually output?

death_oclock 103 Posting Whiz

EDIT: Sorry, Aia beat me to it.

death_oclock 103 Posting Whiz

Returning 1 (or some value > 0) is a common way of reporting that the program did not execute correctly.

death_oclock 103 Posting Whiz

Use "%e" in printf. And what do you even think "%1f" is doing for your code?

death_oclock 103 Posting Whiz

Using .inc files is a bad idea in terms of security. If a user tries to view that file directly and the server doesn't interpret it through PHP, the user will be able to see your code!

death_oclock 103 Posting Whiz

Put this:

if (!$user_check) {
die('Invalid query: ' . mysql_error());
}

in between this:

$user_check = mysql_query("SELECT userdb_user_name FROM default_userdb WHERE userdb_user_name='$reciever'");

and this:

$user_check = mysql_num_rows($user_check);

and tell us what is displayed.

serdas commented: many thans. you were just great and patient +1
death_oclock 103 Posting Whiz

Google "php image gallery" or something along those lines. Plenty of results come up.

death_oclock 103 Posting Whiz

In addition to the XHTML comment, tags need to be closed properly. And is this really the place for yet another PHP tutorial? There are some really great ones out there already.

death_oclock 103 Posting Whiz

Wave files follow the IFF standard which makes it easier to read. This page describes the inner structure of wave files. I trust you can do low-level file operations?

death_oclock 103 Posting Whiz

You have posted quite a bit already, so you should know how to use code tags. Do it.

death_oclock 103 Posting Whiz

Can you explain that? I understand what Ancient Dragon did, but what about the "lock" concept?

death_oclock 103 Posting Whiz

I hate to suggest something so drastic, but you may want to install another version of PHP. But even if mktime is incorrect, if you are only doing relative comparisons and date fixes mktime's mistake (somehow) does it really matter?

death_oclock 103 Posting Whiz

The else doesn't have a condition, but the syntax error could lead you to think that. The code should be:

if (blink_status ==1){ //If led is bliking, stop it
P1OUT &= ~ 0x01; // Turn Led off
blink_status=0;
}else{
blink_status=1;
}

blink_status=1 is simply a statement. This code just flips blink_status between 0 and 1.

death_oclock 103 Posting Whiz

mysql_fetch_array returns an array, just a the name implies, so this statement:

$new_Number_value = $query_results_Number++;

is trying to increment an array?
You want some thing like this:

$new_Number_value = $query_results_Number["Number"]++;
death_oclock 103 Posting Whiz

Just because you're printing your HTML with PHP doesn't mean this is a PHP issue...
And you can change this:

."<tr><td bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\"><b>Tel:</b>$phone</td></tr>\n"

To this:

."<tr><td bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\"><b>Tel:</b> $phone</td></tr>\n"

Added a space before $phone. Simple.

death_oclock 103 Posting Whiz

mktime likely uses a more complex algorithm for computing the timestamp, it would have to include leapyears for example. If you want to let PHP handle dates, use it for creating the timestamp and for decoding it. If you want to use your own algorithm, you must use that at both ends instead. Mix-and-matching won't work.

death_oclock 103 Posting Whiz

Try reading about bitwise operators, that will clear things up for you.

death_oclock 103 Posting Whiz

There are a few ways to do this. For one, let us define i as any index of the 1D array. The corresponding row of this element is

r = i / 25;

The column is

c = i % 25;

Alternatively (would likely be faster too), have three counters: r, c, and i. r would iterate (for loops) through 0 to 11, c through 0 to 25 (not inclusive). i would start at zero. The assignment would go like:

array2D[r][c] = array1D[i++];
death_oclock 103 Posting Whiz

Do not use goto: in C applications. It is very bad coding practice (see spaghetti code). Instead, use control structures like conditional statements, loops, etc.

death_oclock 103 Posting Whiz

Learn WinAPI or MFC.