- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 23
- Posts with Upvotes
- 20
- Upvoting Members
- 17
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
82 Posted Topics
Re: In line 91 you're trying to construct the member Patient which is a type not a member. You did it right everywhere else though. This, however, is not the only thing wrong with the 'Patient' construction in Billing. You're constructing a Patient from a Person but you haven't specified a … | |
Re: This suggests there is an error in your SQL-query on line 5. Replace line 5 with: [code] $mark = mysql_query("select * from product order by product_id DESC") or die(mysql_error());[/code] and see what you get. | |
Re: [b]mysql_query[/b] returns a boolean false when the query fails so if you fix the query (to which the second error applies) the first will disappear also. As for the second error: it's probably something to do with [b]$UserID[/b] as the rest looks alright. Maybe you could show us what the … | |
Re: In the first file $cid is never defined. I think you mean $_POST['cid'] instead of just $cid? ![]() | |
Re: This is just a suggestion but maybe it'll be the key to you figuring it out. Keep an 'items' table containing all the items in your game with a structure like: id, type, upgrades, owner Then you could just fetch all items with a certain type and a certain owner … | |
Re: You forgot a " on line 10 [code]$id1 = implode("-", $id);[/code] and $id isn't an array but a single value so you can't implode that (implode takes an array). | |
Re: Your [b]openWithCURL[/b] function doesn't return anything. I suppose you want [code]function openWithCURL($url){ $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL, $url); $result = curl_exec($curl_handle); curl_close($curl_handle); return $result; }[/code] | |
Re: Well this functions.php file prints a new line at lines 7 to 9 [code]?> <?php[/code] And you probably know that printing requires the headers to be sent so you can't change them anymore after printing. Try removing these 3 lines. | |
Re: Are you sure it failed? When you're using [b]exec[/b] like in your post, it won't output anything but only return the last line of the result of the given command. If you want all the output supply an array as second argument to [b]exec[/b]. This array will then be filled … | |
Re: How about this [code]$text = preg_replace('/(https{0,1}:\/\/([\w\-\.\/#?&=]*))/', '<span class="tweet_links_intext"><a href="$1" target="_blank">$2</a></span>', $text);[/code] | |
Re: In comes the bragging. You reached 499 points, so you achieved position 324 of 111445 on the ranking list You type 622 characters per minute You have 121 correct words and you have 0 wrong words | |
Re: How about this. [code]$string_exp = "/^[A-Za-z\x80-\x95 .'-]+$/";[/code] | |
![]() | Re: At line 7 you specify the variable [b]$path1[/b] but in the copy function on line 11 you use [b]$path[/b] which is undefined. This produces the error. |
Re: Use [b]exec[/b] instead of [b]system[/b] and specify an empty array as the 2nd variable. This will then be filled with all the lines output by the command. [url]http://www.php.net/manual/en/function.exec.php[/url] [code]$result = array(); exec('/usr/bin/whois 4.2.2.2', $result);[/code] Now you have an array filled with all the lines, excluding trailing whitespace, of the output. … ![]() | |
Re: Maybe you would also like to post your operator>> because I'm not able to solve it like this. Perhaps someone with actual coding skills might be able to, though, but to me it seems unlikely. ![]() | |
Re: By default PCRE regex patterns in PHP don't match newlines with . and maybe POSIX patterns do, I'm not sure. But since you probably have newlines in your template file, I think changing the pattern to the following should solve your issues: [code]$header = preg_replace("/".$bodytag."(.*)/is", '', $temp); $footer = preg_replace("/(.*)".$bodytag."/is", … | |
Re: It's definitely possible with the GD library but from reading your question I feel like your expectations of the capabilities of the GD library are too big. The GD library exists only for basic drawing functions, it will not check for you whether two lines are intersecting for instance. I … | |
Re: Just add [code]$rows[$k] = array();[/code] in between lines 7 and 8. | |
Re: It would help if you'd also post the error but a first suggestion would be to use [b]<?php[/b] as starting tag instead of your [b]<?[/b] on line 1. | |
Re: A for loop is set up as follows: [code]for ( inital step; condition to continue; step to execute after every loop )[/code] So your second for loop, the one supposed to decrease, has the first two arguments mixed up. This turns it into an infinite loop because [b]$row2[0] = 15[/b] … | |
Re: The closing double-quote for your MySQL query on line 39 is actually the wrong character. It should be a [b]"[/b] and you have a [b]”[/b], so the string is never closed and eats the rest of your code. | |
Re: [code]vector<string> data; vector<string>::iterator found = find(data.begin(), data.end(), "search"); int pos = found - data.begin();[/code] | |
Re: Change [code]$result = mysql_query("SELECT userid FROM user ORDER BY userid DESC LIMIT 0,1");[/code] to [code]$result = mysql_query("SELECT userid FROM user ORDER BY userid DESC LIMIT 0,1") or die(mysql_error());[/code] and you should see an SQL error. If you can't solve the error, just post it back here. | |
Re: This happens because you can't access an array's members directly inside a double-quoted string. You can either try like this [code]study_period='{$period[$i]}'[/code] that [i]might[/i] work, I'm not sure. Or just do it like this [code]study_period='".$period[$i]."'"[/code] which will work for sure. | |
Re: This error occurs because you are including a certain file multiple times and therefore trying to redefine the Figure class. I've always been taught to wrap my class header files in the following format to prevent multiple definitions: [code]#ifndef __IN_HEADERNAME #define __IN_HEADERNAME // // The original header goes here // … | |
Re: Also, may I ask why you want to do this in the first place? If it's for measuring the time the users takes to produce some input it's much easier to check the time before you ask for input, check it again right after input has been received and simply … | |
Re: [url]http://nl.php.net/manual/en/function.error-reporting.php[/url] [code]error_reporting(E_ALL ^ E_NOTICE);[/code] | |
Re: In the first file you set two variables with the username and password for MySQL. When connecting however you don't use these variables but two constants. Also, or die(mysql_error()) can be appended to any MySQL function, including mysql_connect. If you would've done that, mysql_connect would throw the first error instead … | |
Re: In [b]connection.php[/b] you are connecting with MySQL functions but in [b]Prepared_Statements.php[/b] you are trying to execute queries with the MySQLi functions. | |
Re: Because 150.000 x 150.000 floats equals ~21GB of memory. I don't think you have that much RAM in your computer. | |
Re: In short, this is what you do: [i]sign.php[/i] [code]$error = 0; if(!is_numeric($val1)) $error += 1; if(!is_numeric($val2)) $error += 2; if($error != 0) header("Location: form.php?error=$error");[/code] This sends the user back to the form and passes information about which field wasn't a numeral. [i]1 (01):[/i] The first is not a numeral [i]2 … | |
Re: Change line 11. from [code]$id = $_GET['id'];[/code] to [code]$id = $_POST['id'];[/code] | |
Re: When a PHP script is done executing all non-persistent connections will be closed. Non-persistent connections are made with the [b]_connect[/b] database functions so as long as you stick to that, there's nothing to worry about. | |
Re: Check out this function [url]http://php.net/urlencode[/url] ![]() | |
Re: Instead of assuming there are people on this forum who can simulate your server in their heads, could you maybe post what it is that is actually going wrong? Any errors? | |
Re: If you want someone to look at your source code, why not post it in your topic to begin with? It's why they invented the code-tag. | |
Re: [code]$regex = '/^[0-9]{5,}\/[a-zA-Z]\.[0-9]{2,}$/';[/code] | |
Re: You're missing a [b].[/b] at line 46. [code]'"$_POST['fd_period']."'[/code] [code]'".$_POST['fd_period']."'[/code] | |
Re: The | isn't the string concatenation operator in PHP. It's the bitwise OR operator, that's why you get the randomness. Use [code]$emailSubject = 'Work Order: ' . $_POST['company'];[/code] | |
Re: [code]bool pComp(int* a, int* b) { return *a < *b; } vector<int*> pVec; std::sort(pVec.begin(),pVec.end(), pComp);[/code] | |
Re: A quote from the PHP session_destroy manual [icode]session_destroy() destroys all of the data associated with the current session. It does not unset any of the global variables associated with the session, or unset the session cookie. To use the session variables again, session_start() has to be called. In order to … | |
Re: What you have now is: [icode]10 => 0 11 => 1[/icode] I suspect you want: [icode]9 => 0 10 => 1[/icode] Which I'd do like: [code]$ASoliderPercent = floor($attackerSoldiers/10);[/code] | |
Re: You can't do that because [b]5.0[/b] is stored as [b]5[/b]. There is nothing stored about how many insignificant zeroes you entered in your code. | |
Re: I don't think it doesn't find it but your method of checking whether it has is wrong. Instead try [code]if (inFile.is_open())[/code] | |
Re: This means your [b]mysql_query[/b] returns a [b]false[/b] because there's an error in your query. Which is the result of line 11 because your query will look like: [b]select * FROM datatable LEFT JOIN datatable2 ON datatable.numid=datatable2.numid WHERE numid='$numid' AND [/b] There is nothing following the [b]AND[/b] which produces an error. | |
Re: [code]$rands = range(300, 10000); shuffle($rands); $random1 = array_pop($rands); $random2 = array_pop($rands); $random3 = array_pop($rands); ...[/code] | |
Re: Quote from cplusplus.com [b]For the function to yield the expected result, the elements in the ranges shall be already ordered according to the same strict weak ordering criterion (operator< or comp).[/b] | |
Re: I don't know what the purpose of this code is but it looks like they want the following set of selection rules: [b]sizeof(T1) > sizeof(T2):[/b] ResultT = T1 [b]sizeof(T1) = sizeof(T2):[/b] ResultT = void [b]sizeof(T1) < sizeof(T2):[/b] ResultT = T2 With the alternative you suggested the selection rules would be: … |
The End.