2,113 Posted Topics

Member Avatar for arcticM
Re: xor

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

Member Avatar for diafol
0
169
Member Avatar for cereal

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 …

Member Avatar for Dani
0
230
Member Avatar for mwenyenia07

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!

Member Avatar for junior_rosul
0
114
Member Avatar for Mihujoy

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'] …

Member Avatar for cereal
0
170
Member Avatar for Elandir

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 …

Member Avatar for Elandir
0
179
Member Avatar for collinskawere

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

Member Avatar for pzuurveen
0
354
Member Avatar for webecedarian

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 …

Member Avatar for vegaseat
0
193
Member Avatar for sanket044

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

Member Avatar for cereal
0
29
Member Avatar for GoodLuckChuck

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.

Member Avatar for JorgeM
0
108
Member Avatar for Ctechnology24
Member Avatar for McLaren

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

Member Avatar for cereal
0
325
Member Avatar for Buppy

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 …

Member Avatar for cereal
0
143
Member Avatar for unikorndesigns

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 …

Member Avatar for unikorndesigns
0
172
Member Avatar for NetJunkie

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

Member Avatar for Reverend Jim
0
966
Member Avatar for BoB3R

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 …

Member Avatar for BoB3R
0
173
Member Avatar for ak47carbon

$_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

Member Avatar for cereal
0
148
Member Avatar for BoB3R

> $query = ("DELETE FROM users WHERE fieldname = '".$_GET["userid"]."' LIMIT 1"); Change fieldname to userid, bye! ;D

Member Avatar for BoB3R
0
120
Member Avatar for shahbaz13

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

Member Avatar for shahbaz13
0
517
Member Avatar for showman13

Try substr(): http://www.php.net/manual/en/function.substr.php $a = 1234; echo substr($a,-1,1); # outputs 4

Member Avatar for cereal
0
92
Member Avatar for ehpratah

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 …

Member Avatar for neatric
0
8K
Member Avatar for Octet

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 …

Member Avatar for cereal
0
8K
Member Avatar for Kewne

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

Member Avatar for Kewne
0
130
Member Avatar for Dani

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!

Member Avatar for diafol
0
175
Member Avatar for realworldmedia

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.

Member Avatar for realworldmedia
0
122
Member Avatar for serdas

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.

Member Avatar for cereal
0
452
Member Avatar for Miss Scarlet

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

Member Avatar for Miss Scarlet
0
134
Member Avatar for McLaren

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.

Member Avatar for Coloradojaguar
0
171
Member Avatar for hankmeyer

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++) …

Member Avatar for cereal
1
4K
Member Avatar for t_thakar

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

Member Avatar for cereal
0
491
Member Avatar for Dani

Have you tried FORCE INDEX? http://dev.mysql.com/doc/refman/5.5/en/how-to-avoid-table-scan.html

Member Avatar for Dani
0
284
Member Avatar for RazorRamon

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 …

Member Avatar for Biiim
0
1K
Member Avatar for rrahulrroshan

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.

Member Avatar for gokulllrajjj
0
214
Member Avatar for anime_stargazer

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 …

Member Avatar for smantscheff
0
2K
Member Avatar for Ian159

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

Member Avatar for cereal
0
126
Member Avatar for JoeMc

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.

Member Avatar for cereal
0
84
Member Avatar for Chuckleluck
Member Avatar for cereal
0
225
Member Avatar for ashhadiqbal

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.

Member Avatar for |-|x
0
236
Member Avatar for basketmen

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

Member Avatar for cereal
0
154
Member Avatar for Dani

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'

Member Avatar for cereal
0
169
Member Avatar for tubesnube

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.

Member Avatar for cereal
0
144
Member Avatar for adit_kr

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

Member Avatar for cereal
0
142
Member Avatar for collinskawere

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.

Member Avatar for mohamedasif18
0
235
Member Avatar for Danny159

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.

Member Avatar for Danny159
0
179
Member Avatar for ebanbury

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.

Member Avatar for cereal
0
84
Member Avatar for DaveyMoyes

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.

Member Avatar for cereal
0
184
Member Avatar for dualzNZ

Check on Pritaeas reply on thread: http://www.daniweb.com/web-development/php/threads/418719/reducing-image-size-during-upload-php bye!

Member Avatar for dualzNZ
0
116
Member Avatar for jdgieschen

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.

Member Avatar for joshmac
0
305
Member Avatar for DGULLIVER

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!

Member Avatar for niranga
0
185
Member Avatar for j23

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.

Member Avatar for baig772
0
157
Member Avatar for danielsikes

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.

Member Avatar for pritaeas
0
244

The End.