2,113 Posted Topics
![]() | Re: From php.net: http://php.net/manual/en/language.operators.logical.php > TRUE if either $a or $b is TRUE, but not both. so, here's an example: <?php $a = true; $b = true; $c = false; echo ($a xor $b) ? 'true':'false'; # output: false because $a and $b are both true echo ($a xor $c) ? … ![]() |
Hello all :) I'm experiencing a little problem in the post textbox: I can select the text but this is not highlighted, so I don't see where my selection ends. This happens if I select from the keyboard and also with the mouse. It happens with normal text and also … | |
Re: You have to use `mysql_data_seek($result, $counter);` inside the loop, so you can move the internal result pointer: http://www.php.net/manual/en/function.mysql-data-seek.php here it is an example: http://www.daniweb.com/web-development/php/threads/396784/php-mysql-while-loop#post1702034 Bye! | |
Re: While developing remove the `@` above the functions and you will see the error. At line 11 try to set an absolute path, at the moment this is relative to the script, not to the root: `$uploadfile = 'images/' . $newsid . '.jpg';` So change it to: $uploadfile = $_SERVER['DOCUMENT_ROOT'] … | |
Re: You can use explode(), basically: `explode(';', 'data;goes;here')`. An example: <?php $f = file_get_contents('/filepath/data.csv'); $f = array_filter(array_map('trim',(explode(';',$f)))); print_r($f); # in addition you can run array_chunk() this will split the array, it can be helpful in loops print_r(array_chunk($f,3)); ?> file_get_contents() is used to read data from csv file, array_filter() is used to … | |
Re: It seems your query has an extra opening parenthesis in the WHERE clause: "SELECT ... FROM articles WHERE (( ... ) OR ( ... ) GROUP BY ..." So at line 42 remove the first parenthesis. I'm not sure this will fix your problem, if not post the line error, … | |
Re: Old ok, sorry to bring this up but check dmoz.org you won't find "best" categories but you can find human-edited directories. I was a volunteer years ago, they usually accept to publish only what can bring a value to the directory, so this may be a place to start. http://www.dmoz.org/help/geninfo.html … | |
Re: I suggest something simple, easy to remember, so: Sanket Labs, Sanket Software or Sanket Solutions. Then if you are searching for domains .com, the first two are still free.. :) | |
Re: I think it depends on the different players, the first video is served by jwplayer, the second by youtube. Your friends should try to update Flash and Shockwave or just try to open those links with another browser. | |
Re: have you read the user guide? http://codeigniter.com/user_guide/libraries/javascript.html | |
Re: @jmichae3 it's not a bug, but there is a different behaviour, just try this: $a = true; $b = false; $c[] = $a and $b; $c[] = $a && $b; var_dump($c); as output you will get: array(2) { [0]=> bool(true) [1]=> bool(false) } when you should get always `false`, this … | |
Re: This is a known problem, check this comment in the function page: http://www.php.net/manual/en/function.strtotime.php#107331 There is also a note that suggest to use `DateTime::sub()`: > Using this function for mathematical operations is not advisable. It is better to use DateTime::add() and DateTime::sub() in PHP 5.3 and later, or DateTime::modify() in PHP … | |
Re: I dont' think there is a limit: http://www.php.net/manual/en/language.types.array.php but consider: an array can contain strings and/or ints, a string max lenght is ~2GB, the int limit is platform dependent, default is two billions. So the array will probably be limited by the memory_limit in php.ini or by the amount of … | |
Re: I started in '87 with Atari Basic, I was little and, at that time, it was just something fun to do, I liked to try changing little list of codes I had. After that I attended my first "programming" class, in which I learned GWBasic, it was '91/'92 I think. … | |
Re: You UPDATE query is wrong, you wrote: UPDATE table SET() WHERE VALUES(); Change it to: UPDATE users SET userid = '$_POST[userid]', firstname = '$_POST[firstname]', lastname = '$_POST[lastname]', email = '$_POST[email]', username = '$_POST[username]', password = '$_POST[password]', role = '$_POST[role]') WHERE condition = 'value'; Check this for more info: http://dev.mysql.com/doc/refman/5.5/en/update.html And … | |
Re: $_FILES[] is a superglobal variable: http://php.net/manual/en/reserved.variables.files.php You can read the Language Reference section in the PHP Manual to get the information you are searching for: http://www.php.net/manual/en/langref.php | |
Re: > $query = ("DELETE FROM users WHERE fieldname = '".$_GET["userid"]."' LIMIT 1"); Change fieldname to userid, bye! ;D | |
Re: Have you tried pspell? http://www.php.net/manual/en/book.pspell.php For precision, you can use pspell_suggest(): http://www.php.net/manual/en/function.pspell-suggest.php | |
Re: Try substr(): http://www.php.net/manual/en/function.substr.php $a = 1234; echo substr($a,-1,1); # outputs 4 | |
Re: If the tables structeres are the same then you can use UNION, something like: SELECT * FROM table1 WHERE condition = 'this' UNION SELECT * FROM table2 WHERE condition = 'this'; But if the tables are the same you will get a better performance if you merge them in a … | |
Re: I think your first script is ok but, you can check by placing `print_r($_POST); exit;` right after session_start() and see what you get from your form. Then, in your second script you have the curly brackets without any condition and `or die(mysql_error());` but I don't see any query. Try to … | |
Re: Check you code at line ~16 and if you don't find anything strange then paste your script here. @vibhaJ sorry, I didn't saw your answer! ;D | |
Re: Check this: http://xplus3.net/2010/05/31/conditional-auto-loading-of-libraries-in-codeigniter/ Or set an application only for those outputs: http://codeigniter.com/user_guide/general/managing_apps.html bye! ![]() | |
Re: What do you get if you echo `$userfile[0]` and `$userfile[1]`? Here I don't see how those variables are set. Also remove @ from mysql_query and add `or die(mysql_error());` at the end, so you can see what is wrong with your query. | |
Re: Just as side note: in addition to rch1231 suggestions, you can also consider to use a tool like Supervisord, it can help you to keep running processes in background, even if a crash happens Supervisord will restore the process by itself: [url]http://supervisord.org/[/url] bye. | |
Re: Also, you can use `$this->input->post('fieldname');` instead of `$_POST['fieldname']` and you can just write: `$this->books->save_books();` http://codeigniter.com/user_guide/libraries/input.html | |
Re: A great article about this topic, in my opinion, is this: http://www.componentowl.com/blog/2012/02/zen-coder-vs-distraction-junkie/ I'm usually the cause, the "distractor-junkie" of the situation... but when I work on something interesting for me, then I can stay on that for hours without noticing anything else. | |
Re: Something like this will work: ~~~ php <?php $file = $_FILES['file']['name']; $a = pathinfo($file); $basename = $a['basename']; $filename = $a['filename']; $extension = $a['extension']; $path = $_SERVER['DOCUMENT_ROOT'].'/up/images/'; # set upload directory $dest = $path.$basename; if(file_exists($dest)) { $b = count(glob($path.$filename.'*.'.$extension))+1; # all matches + 1 for($i = 1; $i < $b; $i++) … | |
Re: Virtually there is no limit, the session file will be stored in a server directory or into a database (if you configure it). But you have to check memory_limit in php.ini because the script will stop if you get over: http://www.php.net/manual/en/ini.core.php#ini.memory-limit | |
Re: Have you tried FORCE INDEX? http://dev.mysql.com/doc/refman/5.5/en/how-to-avoid-table-scan.html | |
Re: Something is not clear to me: your databases are all in the same server? If yes then this kind of select can be done, but you need to perform only one connection to a MySQL SERVER, actually it seems you are going to connect 100 different remote servers but your … | |
Re: Try to write `echo $_POST['year'];` if you want to use $year variable then you have to write `$year = $_POST['year'];` Also, where did you get `$_SERVER['HTTP_GSSO_USER']`? I don't find this anywhere. | |
Re: Why don't you use an enum field, something like: `alter table opentix add completed enum('y','n') default 'n' not null;` from this point when you want to check open tickets just use `select * from opentix where completed = 'n'` or similar.. anyway to make it work you need to set … | |
![]() | Re: Between line 11-13 there is no `echo` and on line 15 you are not escaping double quotes as in the other tags. Change it to: <img src=\"http://www.lisa1986.com/images/mainLogo.png\"> |
Re: Try Google Direction Api: https://developers.google.com/maps/documentation/directions/ And related to this API check this discussion: http://stackoverflow.com/questions/5000473/saving-dragable-directions-google-directions-api-v3 Bye. | |
Re: You could use Gearman: http://gearman.org/#introduction Bye! | |
Re: Where you have `//connect` place `print_r($query); exit;` and check if the query has a regular structure, probably there is something wrong with the loop above, I don't see any space beetween WHERE and conditions. | |
Re: You can use str_replace() for days of week and months. ~~~ php <?php $days_of_week_no = range(0,6); $days_of_week_translated = array( 'Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu' ); $months_no = range(1,12); $months_translated = array( 'Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Augustus', 'September', 'Oktober', 'November', 'Desember' ); $week_day = str_replace($days_of_week_no, $days_of_week_translated, … | |
Re: I would use a captcha for new users: if a user writes more than N posts in a given period of time (10~ minutes) then a response to a captcha field is requested for each new attemp. Just an idea o_o' | |
Re: Which error? Add `or die(mysql_error());` to line 27, you will get some output about the error: $result_query = mysql_query($select_query, $connection) or die(mysql_error()); bye. | |
Re: No, the server itself cannot detect a spoofed user-agent. You can fake the user-agent also by using cURL into a script, an example: [url]http://www.php.net/manual/en/function.curl-setopt.php#99399[/url] bye :) | |
Re: Add `or die(mysql_error());` both to line 2 and 4 (and also 7 if you want to check the query). Probably you need to set username, password in mysql_connect(), because if there is no database connection, mysql_query() returns false and you get that error. | |
Re: Provide the code you are using, at least the PNG creation part and the serving script. Otherwise it's hard (at least for me ^_^) to give the right answer, bye. | |
Re: Value of parameter 19 is 'verify', $activationKey is 20 (and it seems to work fine) unless you are counting from 0. If that it's a enum field then check if 'verify' is an accepted value. | |
Re: Use absolute paths, you can use `$_SERVER['DOCUMENT_ROOT'] . "/members/$securecode/$sname/..."` Also, if I upload a file with double extension, let's say `my_image.jpg.php`, it will get through the conditional statement at line 7. Bye. | |
Re: Check on Pritaeas reply on thread: http://www.daniweb.com/web-development/php/threads/418719/reducing-image-size-during-upload-php bye! | |
Re: Did you tried to `print_r($_POST);` at very top of the file to check if everyting you need is retrieved? Second: add `or die(mysql_error());` at the end of the update query, line 351 and check what happens, bye. | |
Re: Try by adding `."\n"` at the first echo: <textarea name="payment_details" cols="40" rows="3" class="inputt2"><?php echo $row['polnum']."\n"; ?> <?php echo $row['provider']; ?></textarea> bye! | |
Re: And also change line 18 to: $login = mysql_query("SELECT * FROM Jobseeker WHERE Username = '$username' and Password = '$password'") or die(mysql_error()); At the moment at line 22 the input for mysql_num_rows() is just a string, not a query result. | |
Re: As suggested by Biiim you could use symbolic links: http://php.net/manual/en/function.symlink.php In linux the command is `ln -s /path/to/file.ext /new/path/file.ext` but you can do this to the parent directory, just like an alias and have two different directory names poiting to the same files. |
The End.