255 Posted Topics
Re: Multiplication is repetitive addition. Use loops. | |
Re: Each mysql record is one message, contains the message body, title, time etc. and the users it is to and from. The user fields would optimally be references to the ids inside a user table. You can then perform queries to get all the message to a user (inbox), all … | |
Re: 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). | |
Re: Are you programming console C++ or WinAPI/MFC? It makes a big difference in how we would help you. | |
Re: I can't see how this would work even with one file; there are no PHP tags! Furthermore, can you describe what doesn't work when you input two files? Actual PHP errors, or it doesn't add one/both to the message? | |
Re: Help you how? This book starts at the very beginning so if you don't understand it you may be in trouble... | |
Re: There are millions/billions/whatever of IP addresses that make up the internet. The standard HTTP port is 80. | |
Re: If you have been given an assignment, that would insinuate that you have been to class. Have you payed attention at all? Taken any notes? Instructors don't often make you do things they have never instructed you on. | |
Re: Try creating a new project with the same code. If it works, great. You can just ditch the broken one. | |
Re: I learned so much from [URL="http://hudzilla.org/phpwiki/index.php?title=Main_Page"]this[/URL] tutorial. | |
Re: [URL="http://msdn.microsoft.com/en-us/library/aa383749.aspx"]MSDN's WinAPI reference[/URL] | |
Re: [QUOTE=sam1]when i include html tags the redirect doesnt work[/QUOTE] Very true. You can't send header information (thats where you're redirecting) [I]after[/I] outputting anything. All you could do is put your meta tags after the redirection code. That would be useless though, because your program will never get to this point. | |
Re: @Blocker: You keep saying it doesn't run. What does that mean exactly? PHP errors? Or does it always disable the button? Does it never disable the button? It helps to be as specific as possible. | |
Re: The problem practically gives away what you need to do. Have you been to class at all? Taken any notes? All you need is a simple (very simple) loop, a few counters, and the basic math knowledge to perform squares and cubes. Oh, and some form of getting input (also … | |
Re: [QUOTE=Dsiembab]yeah that's right I code like chef boyRD[/QUOTE] Goto statements lead to [URL="http://en.wikipedia.org/wiki/Spaghetti_code"]spaghetti code[/URL]. [U]Very quickly[/U]. | |
Re: 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: [CODE=PHP] $script = <<<END <script type="text/javascript"> var myJavascriptVar = $myPhpVar </script> END; print($script);[/CODE] But be careful: it simply prints the variable $myPhpVar when … | |
Re: 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). | |
Re: He meant for [U]you[/U] to look at your notes. Doesn't using the resources you have make sense? | |
Re: 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 :\ | |
Re: -Use code tags so I can see where line 16 is -Why are you performing the same query twice? [ICODE]$q_user[/ICODE] is essentially the same is [ICODE]$query[/ICODE] -You should check that the query result ([ICODE]$q_user[/ICODE]) is not false before checking the number of rows | |
Re: 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. | |
Re: 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 … | |
Re: How about a System call in a separate thread? But threads aren't os independent either. | |
Re: 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! | |
Re: [QUOTE=blocker]can i used it the in second page query.?[/QUOTE] 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: [CODE=PHP]$query_recstudinfo = sprintf("SELECT * FROM studentregistration WHERE … | |
Re: A semicolon can be useful in some preprocessor commands (probably some bizarre scenario), for example its perfectly valid in a [ICODE]#define[/ICODE] statement. In this case we do need to know the compiler and its definition of [ICODE]#pragma[/ICODE] because its functionality is not standard. | |
Re: 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. | |
Re: I'm loving Notepad++ with the FTP plugin so I can work on my hosted server within the greatest editor ever. | |
Re: I don't see you putting any spaces to the left of your rows. C won't automatically middle align it for you... | |
Re: 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: [CODE=PHP]//Let the user know everything went ok. echo "<p><b>You have successfully sent a private message!</b></p><br>"; die(); [/CODE] This is not … | |
Re: In here: [CODE=PHP]<td width=""><p><?php echo nl2br($message); ?></p></td> [/CODE] | |
Re: 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.)? | |
Re: The real question here is whether or not macros are evaluated within strings. The answer: nope. ArkM's example is the correct approach. | |
Re: Backticks are [U]not[/U] the same as single quotes. [URL="http://us.php.net/language.operators.execution"]read[/URL] | |
Re: 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. | |
Re: 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" ([URL="http://www.fredosaurus.com/notes-cpp/oop-condestructors/copyconstructors.html"]here[/URL]) | |
Re: Javascript, specifically [URL="http://www.informit.com/library/content.aspx?b=STY_JavaScript_24_hours&seqNum=119"]this site[/URL] for info. | |
Re: A sample preg_match script: [CODE=PHP]$userfound = (preg_match("/\b$username\b/") === 1);[/CODE] | |
Re: 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 [ICODE]$total > 0[/ICODE]. | |
Re: 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. | |
Re: [CODE=C]struct rest_t { char name[20]; char add[20]; char type[10]; double cost[5]; }; [/CODE] needs a semicolon at the end. [CODE=C]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"}}; [/CODE] Trying to define 9 structs in an array that can only hold 8 (and those '\t's should have … | |
Re: 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? | |
Re: 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... | |
Re: There's a ton of info on C, have you tried Google? And C [I]seems[/I] 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. | |
Re: Store it in a [URL="http://us2.php.net/session"]session[/URL] 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 [CODE]selected="selected"[/CODE] inside the <option> tag. | |
Re: Learn database functions for whatever db server your client uses (MySQL, whatever). A tutorial on SQL statements and the [URL="http://us2.php.net/manual/en/"]php manual[/URL] will help you with this. | |
Re: Okay, so what doesn't work about it? | |
Re: This [URL="http://www.daniweb.com/forums/thread173849.html"]thread[/URL] might help. | |
Re: This code: [CODE=C]picked[value] = 1; // hasn't been picked yet. Assign to array, // flag as picked. [/CODE] 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 … | |
Re: 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? |
The End.