255 Posted Topics

Member Avatar for waferstix
Member Avatar for rEhSi_123

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 …

Member Avatar for rEhSi_123
0
119
Member Avatar for youngstorm

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).

Member Avatar for youngstorm
0
126
Member Avatar for shanexuan

Are you programming console C++ or WinAPI/MFC? It makes a big difference in how we would help you.

Member Avatar for StuXYZ
0
106
Member Avatar for shadiadiph

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?

Member Avatar for shadiadiph
0
165
Member Avatar for spo-apt

Help you how? This book starts at the very beginning so if you don't understand it you may be in trouble...

Member Avatar for Ancient Dragon
0
293
Member Avatar for Ajitbmsce

There are millions/billions/whatever of IP addresses that make up the internet. The standard HTTP port is 80.

Member Avatar for death_oclock
0
47
Member Avatar for xonxon

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.

Member Avatar for Stefano Mtangoo
0
152
Member Avatar for Icebone1000

Try creating a new project with the same code. If it works, great. You can just ditch the broken one.

Member Avatar for Icebone1000
0
172
Member Avatar for Stefano Mtangoo

I learned so much from [URL="http://hudzilla.org/phpwiki/index.php?title=Main_Page"]this[/URL] tutorial.

Member Avatar for Stefano Mtangoo
0
100
Member Avatar for massivefermion

[URL="http://msdn.microsoft.com/en-us/library/aa383749.aspx"]MSDN's WinAPI reference[/URL]

Member Avatar for death_oclock
0
107
Member Avatar for sam1

[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.

Member Avatar for death_oclock
0
196
Member Avatar for PinoyDev

@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.

Member Avatar for cwarn23
0
429
Member Avatar for C++.java

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 …

Member Avatar for death_oclock
0
192
Member Avatar for Dsiembab

[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].

Member Avatar for death_oclock
0
209
Member Avatar for ahmksssv

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 …

Member Avatar for cwarn23
0
119
Member Avatar for localp

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).

Member Avatar for cwarn23
0
142
Member Avatar for ternor

He meant for [U]you[/U] to look at your notes. Doesn't using the resources you have make sense?

Member Avatar for ternor
0
100
Member Avatar for gangsta gama

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 :\

Member Avatar for gangsta gama
0
92
Member Avatar for puk

-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

Member Avatar for Andrieux
0
176
Member Avatar for kishore84

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.

Member Avatar for nucleon
0
272
Member Avatar for JONZ

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 …

Member Avatar for death_oclock
0
317
Member Avatar for TheBeast32

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

Member Avatar for death_oclock
0
84
Member Avatar for ahmksssv

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!

Member Avatar for almostbob
0
138
Member Avatar for PinoyDev

[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 …

Member Avatar for PinoyDev
0
168
Member Avatar for ithelp

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.

Member Avatar for death_oclock
0
5K
Member Avatar for CPPRULZ

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.

Member Avatar for death_oclock
0
151
Member Avatar for shasha821110

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

Member Avatar for almostbob
0
121
Member Avatar for Skorpion

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

Member Avatar for Prabakar
0
131
Member Avatar for serdas

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 …

Member Avatar for serdas
0
103
Member Avatar for serdas

In here: [CODE=PHP]<td width=""><p><?php echo nl2br($message); ?></p></td> [/CODE]

Member Avatar for mschroeder
0
194
Member Avatar for whitestream6

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.)?

Member Avatar for death_oclock
0
151
Member Avatar for monkey_king

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

Member Avatar for Prabakar
0
98
Member Avatar for jakx12

Backticks are [U]not[/U] the same as single quotes. [URL="http://us.php.net/language.operators.execution"]read[/URL]

Member Avatar for mschroeder
0
162
Member Avatar for wayne001

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.

Member Avatar for death_oclock
0
94
Member Avatar for CPPRULZ

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])

Member Avatar for MMahmoud
0
149
Member Avatar for EnetJohn

Javascript, specifically [URL="http://www.informit.com/library/content.aspx?b=STY_JavaScript_24_hours&seqNum=119"]this site[/URL] for info.

Member Avatar for death_oclock
0
122
Member Avatar for lldcrb328

A sample preg_match script: [CODE=PHP]$userfound = (preg_match("/\b$username\b/") === 1);[/CODE]

Member Avatar for cwarn23
0
121
Member Avatar for websurfer

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].

Member Avatar for websurfer
0
356
Member Avatar for number87

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.

Member Avatar for death_oclock
0
128
Member Avatar for abby2589

[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 …

Member Avatar for death_oclock
0
98
Member Avatar for kilahcup

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?

Member Avatar for kilahcup
0
115
Member Avatar for ammar77

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...

Member Avatar for death_oclock
0
85
Member Avatar for beanryu

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.

Member Avatar for Salem
0
151
Member Avatar for tanvi.p.41

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.

Member Avatar for phper
0
401
Member Avatar for PinoyDev

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.

Member Avatar for PinoyDev
0
123
Member Avatar for ade92uk
Member Avatar for Studio
Member Avatar for Studio
0
72
Member Avatar for kishore84

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 …

Member Avatar for William Hemsworth
0
2K
Member Avatar for ade92uk

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?

Member Avatar for death_oclock
0
73

The End.