death_oclock 103 Posting Whiz

You always have 5 float values and then one string. Simple: parse the first 5 as strings and leave the sixth as a string. You wont be able to store the strings in the same float array though.

death_oclock 103 Posting Whiz

Checkers would be a good example. It would be a decent way to make an "AI" for it. Use trees to see all possible outcomes of a certain move, compare that with all the other outcomes to see the best move. (adding a limitation on the depth of analysis might be appropriate for speed/difficulty purposes)

death_oclock 103 Posting Whiz

How about a System call in a separate thread? But threads aren't os independent either.

death_oclock 103 Posting Whiz

What does it say in the address bar? If it says "C:\Program Files\Apache Group\Apache2\cgi-bin\filename.php" then you aren't running it through your server. It is not being parsed as PHP. You have to view it through your server: "http://localhost/filename.php" or "http://127.0.0.1/filename.php" (the same thing).

death_oclock 103 Posting Whiz

The first parameter, hWnd (passed NULL) is the window to associate the new process with (NULL means you aren't using this feature).

The second, lpOperation, is what you want to do with the file specified in the next parameter. Here we are "open"ing it.

Speaking of which, the third is lpFile: the file you want to perform the operation on.

The fourth, lpParameters is a string of the arguments you want to pass into the new process. These are not used in this situation.

Next is lpDirectory. This is the path you want the new process to think it was started from.

Finally, we have nShowCommand: this just specifies the starting state of the window for the new process. SW_NORMAL specifies that, what do ya know, it should start in normal mode!

You can look at specifics including other possible arguments at msdn's documentation for this function.

Comatose commented: Precisely! +10
death_oclock 103 Posting Whiz

You're not displaying anything. Unless there's more to the code on this page, I don't see a single output statement.

death_oclock 103 Posting Whiz

yeah that's right I code like chef boyRD

Goto statements lead to spaghetti code. Very quickly.

death_oclock 103 Posting Whiz

No hard feelings. You should mark this as solved, however. It makes a difference.

death_oclock 103 Posting Whiz

I hope you mean "can't save .php files"! And I hope you're lying, because you can save a file with any file type you want :\

death_oclock 103 Posting Whiz

can i used it the in second page query.?

Yes, thats the whole point of sessions; they last across all pages in your site until they expire or the browser is closed.

It looks to me like you would put it in here:

$query_recstudinfo = sprintf("SELECT * FROM studentregistration WHERE username = %s", GetSQLValueString($_SESSION['MM_Username'], "text"));

I am unsure of your page flow, but I assume $_GET no longer exists on this page? If this is true you can ditch the part about getting that value. Just use your session.

death_oclock 103 Posting Whiz

Alignment like notepad, add styles? Your question is way too vague for anyone to know how to help you. Some details would be quite useful!

death_oclock 103 Posting Whiz

Answers to other questions:
2. Javascript sessions? They don't exist (or it would be a horrible shock if i discovered they do!)
3. Yep! Something like this:

$script = <<<END
<script type="text/javascript">
var myJavascriptVar = $myPhpVar
</script>
END;
print($script);

But be careful: it simply prints the variable $myPhpVar when downloading the page, it wont treat them as the same variable ($myPhpVar never existed, for all your browser knows).

death_oclock 103 Posting Whiz

I didn't say it was a good idea, but the real question here was about the compile error.

death_oclock 103 Posting Whiz

The & operator is used to pass variables by reference when in the parameter list of a function. Outside of that context it is always used to get the address of a variable. Othere than this, I am not what you are asking.

death_oclock 103 Posting Whiz

If you have an assignment to do it with a recursive function, you can't exactly do it another way and expect to get credit, can you?

The fibonacci sequence is where each successive number is the sum of the two numbers before it. A recursive function can call itself for previous states! Pass in a parameter to determine which number of the sequence to calculate. Also, remember to put "stop cases" in your function to avoid infinite recursion.

death_oclock 103 Posting Whiz

You're right, it is being used differently. In this case, it is passing the object by reference, which is just C++'s shortcut around pointers. It just means anything you do to the parameter within the method will be permanent.

death_oclock 103 Posting Whiz

A semicolon can be useful in some preprocessor commands (probably some bizarre scenario), for example its perfectly valid in a #define statement. In this case we do need to know the compiler and its definition of #pragma because its functionality is not standard.

death_oclock 103 Posting Whiz

@Shawn: I felt like I had to check out vim, and I really like it. It is tricky to learn but seems much more efficient than conventional methods. Plus its very "old-school" which I generally like.

death_oclock 103 Posting Whiz

If you are too stubborn to accept that timestamps are in fact better or are too lazy to make the change, it would look like this:

$parts = explode("-",$birthday);
$yeah = $parts[0];
$month = $parts[1];
$day = $parts[2];
$birthday = mktime(0, 0, 0, $month, $day, $year);

Good thinking on doing it all within MySQL, bob.

death_oclock 103 Posting Whiz

If you store the birthdays as timestamps rather than strings it is very easy. Something like this would do:

// $birthday has been selected from the database
if($birthday > time() && $birthday - time() <= (7 * 24 * 60 * 60))
{
  //birthday is within seven days
}
death_oclock 103 Posting Whiz

I'm loving Notepad++ with the FTP plugin so I can work on my hosted server within the greatest editor ever.

death_oclock 103 Posting Whiz

1. Use code tags.
2. Use time stamps (functions like mktime, date, etc.) this will make comparing dates much easier.
3. Don't declare functions within control structure. Its just a bizarre practice.

death_oclock 103 Posting Whiz

If you go back to the origional code you posted, a quick fix would be to quit program execution after outputting that message. So you could change that section to:

//Let the user know everything went ok.
                        echo "<p><b>You have successfully sent a private message!</b></p><br>";
die();

This is not a great solution, however; if you want to do anything else on the page it simply wont happen if your program gets to this point. Also, it is just considered bad practice to kill your program abruptly rather than using control statements. That said, I only suggest this to avoid diving deeper into your code. Have you learned much PHP? You should really go through a good thorough tutorial before working with advanced things like this.

death_oclock 103 Posting Whiz
<td width=""><p><?php echo wordwrap($message, 75, "<br />", true); ?></p></td>

Change 75 to whatever width you want.

serdas commented: thank you +1
death_oclock 103 Posting Whiz

Well you can just have records containing any information you want (titles, descriptions, date of event). When displaying the events in a category, just check the current date against the event date to see if it has already occurred. Cron jobs, as previously stated, can physically remove past events from the database every once in a while.

death_oclock 103 Posting Whiz

The real question here is whether or not macros are evaluated within strings. The answer: nope. ArkM's example is the correct approach.

death_oclock 103 Posting Whiz

From what I have seen, Daniweb is not a place for hiring freelance programmers. If you want to do it yourself, read about Ajax, SQL databases, and how PHP accesses them.

death_oclock 103 Posting Whiz

By "new to this" how new do you mean? New to this particular concept or new to PHP in general (ie. you have no idea how to access databases, print tables, etc.)?

death_oclock 103 Posting Whiz

No, the copy constructor is used only when called explicitly or when an object is being initialized. You could, however, have the assignment operator call your copy constructor.

death_oclock 103 Posting Whiz

Javascript, specifically this site for info.

death_oclock 103 Posting Whiz
int fileSize = strtoul(parts[5].data(), NULL, 0);

strtoul is defined in cstdlib

death_oclock 103 Posting Whiz

If you really want it simple, I like the "write it yourself" approach as well. Paul Hudson has a nice tutorial.

death_oclock 103 Posting Whiz

That is true, and you also cannot declare a double using quotes "". I strongly suggest you learn the basics of C first.

death_oclock 103 Posting Whiz

It will not modify and addresses but it will set all of the values of shoe_copy to the values of shoe1. It wont call a copy constructor. I have seen this called a "shallow copy" (here)

CPPRULZ commented: EXCELLENT link +1
death_oclock 103 Posting Whiz

My problem was not with your skill level because yes, I have been there. My problem was with your attitude.

death_oclock 103 Posting Whiz

I cant do it I think I should give up....

Maybe you should. Programming can be confusing and frustrating. If you can't deal with that even from a simple problem like this, maybe programming isn't for you.

death_oclock 103 Posting Whiz

Comparing the page source from both side by side, the only difference I can see is spacing. Sorry, I honestly have no idea.

death_oclock 103 Posting Whiz

TommyBs is right. You don't need 's around your field names, and definitely don't use `. Is there in fact a field named status? And try doing this query directly in MySQL (via phpMyAdmin if you have it) and see what error you get.

death_oclock 103 Posting Whiz

What is the difference between your first link and the "bare-html" version? Is the first generated by a PHP script and the other is just an .html file?

death_oclock 103 Posting Whiz

Hmmm, so you look for records with the user's selected year in it, thats where I would have started. But if we don't find any such rows, then it must already exist? I think not. Try $total > 0 .

death_oclock 103 Posting Whiz

I was originally going to look at your code but when I saw the lack of code tags I decided against it. And wouldn't it make sense to tell us exactly what errors you are getting? I thought so anyway...

death_oclock 103 Posting Whiz

Backticks are not the same as single quotes. read

death_oclock 103 Posting Whiz

printf ("*",i); What is that supposed to do? Read up on printf. Just a hint, it doesn't print "*" i times. And adding a tab before every *? I don't think thats what you want.

death_oclock 103 Posting Whiz

It may seem strange at first, but try making the diamond yourself. Go through it slowly and see exactly what your thinking is on how to do it. Unless you can understand it yourself, you won't be able to make a computer do it.

death_oclock 103 Posting Whiz
struct rest_t {
	char name[20];
	char add[20];
	char type[10];
	double cost[5];
};

needs a semicolon at the end.

struct rest_t rest[9]={{"ABC","Makati","250.00","Thai"},
	 	       {"DEF","Pasay","350.00","American"},
	 	       {"GHI","Manila","150.00","Asian"},
		       {"JKL","Muntinlupa","300.00","Thai"},
		       {"MNO","Paranaque","350.00","Thai"},
		       {"PQR","Manila","200.00","American"},
		       {"STU","Makati","400.00","Asian"},
		       {"VWX","Roxas blvd.","500.00","Asian"},
		       {"YZA","Manila","250.00","American"}};

Trying to define 9 structs in an array that can only hold 8 (and those '\t's should have been quotes)

char x;
	char temp;
	char rest1[x];

x hasn't been given a value yet, so how big should rest1 be?

rest1[x]=rest[x];

You are trying to convert a rest_t structure into a single char?

death_oclock 103 Posting Whiz

I don't see you putting any spaces to the left of your rows. C won't automatically middle align it for you...

death_oclock 103 Posting Whiz

I have never seen this sort of thing and its hard to imagine C++ would include such a feature. Just for curiousity's sake, could you provide a link to where you found this example? And AncientDragon is right, you need to call strtok() multiple times.

death_oclock 103 Posting Whiz

There's a ton of info on C, have you tried Google? And C seems more difficult because it doesn't do everything for you, like Java will. Lots of people prefer this greater control over their applications. Plus, it makes it much faster.

death_oclock 103 Posting Whiz

Your post is one of the worst i've ever seen (i'm sure others would have some stories to tell). First, you hijacked a completely unrelated thread. Secondly, you essentially demand someone write a program for you (most likely homework) with the usual fake appreciation and "urgency". Finally, you ask us to email you the code. That just doesn't happen!

death_oclock 103 Posting Whiz

Does the text overflow the width of the paragraph? Let me know if there is any CSS that would affect the <td> or the <p>.