1,038 Posted Topics
Re: [url]http://php.net/fgetcsv[/url] There's a builtin PHP function | |
Re: The AJAX response just has to send like a JSON response then you parse the response and set them in your success callback. | |
Re: You are correct, method overloading is and will never be in the language. However, there are ways to get around this. The [`func_get_args`](http://php.net/func_get_args) function can be used to retrieve an array of all arguments passed to the function. Also, as you mentioned, PHP is loosely typed but can be "Type … | |
Re: You might want to show us some code, and use code tags when you do | |
Re: It's not PHP, it's CSS. It's just a background-image applied to the textarea | |
Re: You might want to read your book or the tutorial or whatever you're using to learn PHP again because there are WAY too many things wrong with that script. | |
Re: As was noted before, they are superglobals, you can use them anywhere. However, I suggest that you don't. If you're going to go the OOP route then I would suggest abstracting dealing with GET/POST/COOKIE/SESSION variables to a class that deals with them specifically called Request or something along those lines … | |
Re: Did you look at the system event log? What did it say? | |
Re: A) Use code tags B) It's always going to echo 1 C) You're not retrieving data from the request (in this case [icode]$_POST[/icode] D) Go read the PHP manual [url]http://php.net[/url] and [url]w3schools.com[/url] | |
Re: You probably would never make much if any money creating a forum with PHPBB and its ilk out there. | |
Re: What's the point of using cNum1 and cNum2, you already have the variables first and second to use. You can do the same thing for both functions [code=c++] ComplexNum ComplexCalc::subComplex( ComplexNum &first, ComplexNum &second ) { ComplexNum* result = new ComplexNum(); result->setValues(first.real - second.real, first.img - second.img); return *result; }[/code] … | |
Re: Make sure you have indices on the column you're searching, that's probably the easiest way to speed things up but it's a size vs. speed trade-off. | |
Re: [code=php] // if you're using XHTML str_replace('<br />', "\n", $string); // if you're using HTML str_replace('<br>', "\n", $string);[/code] | |
Re: Read the FAQ | |
Re: It's actually much easier to make bar graphs with CSS than it is with PHP. Here's an quick tutorial [url]http://www.khmerang.com/index.php?p=118[/url] | |
Re: Or you could just write the method for (in your example) Person to change the name themselves. ie.,[icode]person->setName()[/icode] There is absolutely no need for a "superclass". Their true name is "god class" and it's referred to as an anti-pattern. They are the bane of good OOP principles. Don't make them. … | |
Re: Well if you're trying to extract the username you can just do this. [code=php] $url = 'http://www.myspace.com/username'; $urlparts = explode('/', $url); $username = end($urlparts);[/code] | |
![]() | |
Re: You might want to use grep for that, use can use it inside vi/vim with the ! command :!grep funcname <dir> | |
Re: [icode]"/^(\d{1,7})\.(\d{1,2})$/"[/icode] If you're testing a string you want to set the anchors "^" (beginning of string) and "$" (end of string) so you know that there is nothing else in between. [icode]"/(\d{1,7})\.(\d{1,2})/"[/icode] will match [icode]12345678.12[/icode] because it is matching, take a look at this. [code] without ^$ __________ 1|2345678.12| ---------- … | |
Re: Actually, it is a normal vector declaration. std::vectors are a templated class. To instantiate a vector you pass a type to the template. Might want to read up on templates. In this case the code looks to be function prototypes. The first function returns a vector of int's and takes … | |
Re: [code=php] $somearray = array( array('a' => 'Hello'), array('b' => 'World') ); echo $somearray[0]['a'] . ' ' . $somearray[1]['b']; // Hello World [/code] | |
| |
Re: If I had to pick four of the best I'd say Zend, Symfony, CodeIgniter and Cake. Zend is a pretty in-depth and heavy framework. Symfony is lightweight but also quite powerful with a huge community, amazing documentation (a book is published for every version). Cake is even lighter but also … | |
Re: [QUOTE=tulipputih;891025]Hello everyone, Does anyone knows any query expansion techniques that can be implemented using php other than hierarchical technique. i.e: facet , analysis, thesaurus. By implementing query expansion, the users are not only presented with the keyword they inserted, but some related words to the keyword. Thank you[/QUOTE] If you're … | |
Re: You literally just posted the equivalent of a check-engine light. You have to actually explain your problem preferably with code samples | |
Re: Was there a question or were you just showing us the code? | |
Re: Read the FAQ | |
Re: Firstly, toss an echo at the top of your php file to make sure you're even touching that file. Based on your HTML file you may not, [icode]type = "submit"[/icode] those spaces [b]may[/b] or may not be killing the submit button. | |
Re: Use <pre> or <code> tags on your output, that's pretty much it. You can do this when you store it but I would highly recommend you do it on output instead. | |
Re: If all you want to do is grab the entire contents of a file and spit it into a textbox then yes, file_get_contents is probably your best bet. If you need to process it then file() or fopen/fread might be the way to go. | |
Re: [QUOTE=Menster;910693]Now, now, I can't do your entire assignment for you :P If you get stuck on anything with php the resource to use is [URL="http://www.php.net"]http://www.php.net[/URL] or just Google "php" followed by your question. Good luck, I hope you get 10/10[/QUOTE] A) You already did his entire assignment for him. B) … | |
Re: Yeah, did you try perhaps googling it and looking at maybe any of the first 1000 results? | |
Re: [code=php] echo "document.write("Hello Dolly");\n";[/code] Use single quotes [code=php] echo "document.write('Hello Dolly');\n";[/code] | |
Re: Post an example string that is to be split, guessing based on your description will produce bad results | |
Re: remove the "ini " before ImageCreateFromJpeg on line 17 | |
Re: A) AJAX and DHTML aren't languages, they're methodologies. B) All of those languages can be used for the web C) Use Wikipedia to look up SOAP, it's an acronym hence the capital letters ![]() | |
Re: What the heck are you guys doing? He obviously posted a homework question and he never showed any of his own code in this entire thread, all he said is "thanks for the code" and you just handed him answers. | |
Re: [url=http://php.net/nl2br]nl2br[/url]. Please search before posting | |
| |
![]() | Re: Have you tried the AUTOINCREMENT property on the field in the database? Go take a look at the MySQL manual ![]() |
Re: Compare the php.ini's on your Mac and on your Ubuntu machine to see what the difference are. From your unintentionally vague description it's hard to tell what's going on exactly so the ini files are the best place to look. | |
Re: If you want everything accept for letters and numbers you can use [code=php] $pattern = '/[^a-z0-9]/i';[/code] If you are specific about \/:"?<*>| then it's this [code=php] $pattern = '#[\/:"\?<\*>|]#';[/code] | |
Re: This is a javascript issue, please post your problem in the appropriate forum. | |
Re: If you're on Windows and you're not willing to move to Linux then you can get WAMP or XAMPP. And I'll tell you right now: lose Netbeans. If you have to use such a bloated IDE use Zend IDE or Eclipse. Netbeans has no place touching PHP in my opinion. ![]() | |
Re: That's not an error, it's a warning. And C++ std::string::length() returns an unsigned int. You're using an int for your counter in your loop so the comparison [icode]j < item.length()[/icode] is comparing a signed int (default int) to an unsigned int | |
Re: PHP is server-side. It never interacts with the client directly, there is no way it can open any dialog, that's up to Javascript and HTML. | |
Re: Read the documentation for mysql_connect again. It's [icode]mysql_connect('host', 'user', 'password')[/icode]. You have mysql_connect('host', 'user@host', 'password') |
The End.