2,113 Posted Topics

Member Avatar for Mhecha

Hi, at line 7 you have: $update_id = $post_id; while `$post_id` is initialized at line 68: $post_id = $row_post['post_id']; Which in practice depends on `$edit_id` defined at line 60: $edit_id = $_GET['edit_post']; So, it seems that you open the page like this: page.php?edit_post=123 All you have to do is to …

Member Avatar for Mhecha
0
5K
Member Avatar for happygeek
Member Avatar for happygeek
1
923
Member Avatar for patk570
Member Avatar for Stefce

Hi! You can use `pathinfo()` or a [directory iterator:](http://php.net/manual/en/class.directoryiterator.php) $ext = pathinfo($file)['extension']; BUT right now the `img()` function can, potentially, allow the access to the contents of any directory on the server, by adding `../` to the variable, as example you can write the following and access `/etc/`: pictures.php?imageID=images/../../../../etc It …

Member Avatar for cereal
0
556
Member Avatar for Latrell_vie

From the [documentation:](http://php.net/return) > If called from within a function, the return statement immediately ends execution of the current function, and returns its argument as the value of the function call. It is like doing: echo 'hello'; exit; echo 'world'; so in your function you can store the value that …

Member Avatar for Latrell_vie
0
233
Member Avatar for ridoy

Hi, I do not see the conditional statement to apply the comma. Do you have an example of the input?

Member Avatar for cereal
0
167
Member Avatar for iamthwee

If you use: $config['sess_encrypt_cookie'] = TRUE; $config['sess_use_database'] = TRUE; And create a session table: CREATE TABLE IF NOT EXISTS `ci_sessions` ( session_id varchar(40) DEFAULT '0' NOT NULL, ip_address varchar(45) DEFAULT '0' NOT NULL, user_agent varchar(120) NOT NULL, last_activity int(10) unsigned DEFAULT 0 NOT NULL, user_data text NOT NULL, PRIMARY KEY …

Member Avatar for owlowl076
0
8K
Member Avatar for Sumier

At line 26 there is an extra `}`, but it does not raise a syntax error, so if on top you have a condition like: if($_POST) { # open connection here # other code ... } # <-- line 26 in your code # close connection here then, when you …

Member Avatar for cereal
0
8K
Member Avatar for surprino

Hi, which version of curl are you using? I don't have the `-W` option and I don't find it in the documentation. Have you tried the PHP curl library? http://php.net/manual/en/book.curl.php Also you could use Guzzle: http://docs.guzzlephp.org/en/latest/ An example with Guzzle: <?php require_once dirname(__DIR__) . '/vendor/autoload.php'; use GuzzleHttp\Client; use GuzzleHttp\Psr7\Request; $config …

Member Avatar for cereal
0
415
Member Avatar for UI

**@UI** Hi! in addition to previous comments, if you are learning PHP for work, sooner or later you will handle legacy code, you will be asked to add functionalities, not always to port it. You cannot always choose the version to work with. For example, something simple like: $i = …

Member Avatar for UI
0
305
Member Avatar for Maheshwaran
Member Avatar for Dani

It is really sad, I have used a lot and I have been a volunteer editor for few years sometime ago. Is there anything else similar?

Member Avatar for Otir
0
277
Member Avatar for gahhon

> Whenever I press a button on B.php, the value ID=1 gone. Can you clarify this? Right now it seems the issue is not related to A.php but just to what happens inside B.php.

Member Avatar for gahhon
0
289
Member Avatar for new_coder

Hi, this `mysq_num_rows()` does not exists, you may want to use: http://php.net/mysqli_num_rows A part that, don't forget to use prepared statements, otherwise sooner or later you may receive a visit from [Bobby Tables.](http://bobby-tables.com/)

Member Avatar for cereal
0
347
Member Avatar for UI

Hi, in this case the error message is very descriptive: > PHP Parse error: syntax error, unexpected '"', expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /home/sn/public_html/sn/home.php on line 168 It points to a specific file and line of the code. If you don't find the …

Member Avatar for cereal
0
182
Member Avatar for happygeek
Member Avatar for janicemurby

It's line 4: echo '<td>'.<img src='images/blank_big.jpg' height='150px;' width='150px;' />.'</td>'; The way you are using the concatenation operator (dot operator) is not correct, as `<img ...` is a string, so it must be quoted. Do: echo "<td><img src='images/blank_big.jpg' height='150px' width='150px' /></td>"; Bye!

Member Avatar for cereal
0
371
Member Avatar for UI
Member Avatar for janicemurby

Hi, can you show the insert query? Also if you add error checking do you get any additional information?

Member Avatar for janicemurby
0
253
Member Avatar for janicemurby

Hi Janice, the error is given by this `$_SESSION['last_id']`, because is not set. Before running the query you can make sure the index is set by running: if(TRUE === array_key_exists('last_id', $_SESSION)) { # execute query }

Member Avatar for janicemurby
0
1K
Member Avatar for Dani

Between *Ask* and *Discussion* I prefer *Submit* as it fits both.

Member Avatar for rproffitt
0
601
Member Avatar for Furkan_2

Hi, the regular expression used to validate first and last name can fail if there are special characters or a dot, like in `Björk` or `Aldous L. Huxley`, see: * https://www.w3.org/International/questions/qa-personal-names So here you may want to use filter_input with FILTER_SANITIZE_STRING: $fname = filter_input(INPUT_POST, 'firstname', FILTER_SANITIZE_STRING);

Member Avatar for cereal
0
465
Member Avatar for phphp

If the query does not return a result set, then the loop will not assign any value to $_SESSION and the print statement will show the previous value associated with that index: `$_SESSION['status']`. I take the above for an example, but if $muser and $mypass are not set then the …

Member Avatar for ahmad.albab.87
0
385
Member Avatar for SimonIoa

Hi, do: print_r($_GET); inside allSearches.php and see what you get. //Edit Oh, wait, I'm not sure I have understood your request. You want to perform an AJAX request with the GET method?

Member Avatar for SimonIoa
0
301
Member Avatar for double_cola

> I have a form that creats a json array from user input data. > I need to send that to a php curl file so that it can be sent to an ip address. > How do I populate the curl data array from that json file? Hello, if …

Member Avatar for cereal
0
1K
Member Avatar for koneill

Hello koneill, > What happens is that even though the information page has checks that data is filled in - the checkout file if a search crawl hits the page it sends blank info to the generic e-mail box. Is this script checking on server side too? Since you are …

Member Avatar for koneill
0
402
Member Avatar for kaungzaythu

**@Prasanna_5** Hello, please open a new thread and search also the forum, this thread could help you: * https://www.daniweb.com/programming/web-development/threads/506840/autocomplete

Member Avatar for cereal
0
5K
Member Avatar for Reverend Jim

> I've also been getting a lot of sex spam. I wonder if someone got my email address off a database somewhere ^_^ Me too and they try to add my account to Hangouts, so I reply to add my "other" account instead, which is the email address of a …

Member Avatar for cereal
0
463
Member Avatar for cereal

Hello, so, I'm playing a bit with **MariaDB 10.0.29** and I cannot understand why `FOUND_ROWS()` keeps returning the `1` whatever happens to the latest select query. Here's my test: > CREATE TABLE `test` (`id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `msg` VARCHAR(100) NULL) ENGINE = InnoDB; Query OK, 0 rows affected …

Member Avatar for cereal
0
3K
Member Avatar for Dani

It seems the Apple News app does not support RSS format anymore since last summer, try to load an ATOM feed or follow their format: https://developer.apple.com/news-publisher/

Member Avatar for Dani
0
313
Member Avatar for genieuk

Hi, use `r+` to read and write from the top or `a+` in case you want to append data: $fopen = fopen($filename, 'r+'); With the `w+` flag the file is cleared: > Open for reading and writing; place the file pointer at the beginning of the file and truncate the …

Member Avatar for genieuk
0
377
Member Avatar for Dani

Hi! I think jkon refers to this https://www.w3.org/TR/wsdl20/ i.e. a document that describes the features of the API endpoints. This is widely used in SOAP. See also: * http://www.ibm.com/developerworks/webservices/library/ws-restwsdl/

Member Avatar for diafol
0
968
Member Avatar for diafol

Italy? :D They need to improve a lot, but here we felt the change in their approach, hope to see some great games this year!

Member Avatar for cereal
1
223
Member Avatar for Antony Rayan

Hi, codeIgniter can log errors. If enabled set it to max verbosity (through application/config/config.php) and see if it gives you some additional information.

Member Avatar for Dani
0
119
Member Avatar for Aeonix

Consider also that you could serve Google Fonts from your web server, just download them and set the paths in the CSS file.

Member Avatar for cereal
0
474
Member Avatar for life assosication

Another random fact: sometimes in logs you see Google's bot user agent but it's just another crawler trying to avoid filters.

Member Avatar for Cristy_1
-2
505
Member Avatar for Stefce

This line will raise an error and kill the execution: trigger_error('Wrong SQL: ' . $sql . ' Error: ' . $conn->error, E_USER_ERROR); If you want to use it, then you have to create a condition, something like this: if( ! $result) trigger_error('Wrong SQL: ' . $sql . ' Error: ' …

Member Avatar for cereal
0
331
Member Avatar for gentlemedia

Hi! You could try with: $url = get_field('url'); if(FALSE === $url) { # code for empty value } else { # code for assigned value } See: https://www.advancedcustomfields.com/resources/code-examples/#using-conditional%20statements

Member Avatar for cereal
0
2K
Member Avatar for AndreRet

Hi, the recommended way to hash passwords in PHP is through `password_hash()`, see the examples in the documentation page: * http://php.net/password-hash The example #3 seems similar to your request. If you will use PHP 7, then you can enable strict mode and you can write something like this: <?php declare(strict_types=1); …

Member Avatar for AndreRet
0
575
Member Avatar for cereal

I was asked to fix few bugs, looking at the code, this is what I saw at the end, 600 lines later: } } } } } } } } Looks like vertical [brainf4ck code.](https://en.wikipedia.org/wiki/Brainfuck) You can imagine how it looks the rest.

Member Avatar for Dani
0
165
Member Avatar for amith_ami

So, something like this extension: https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=29709&sort=date_added correct?

Member Avatar for cereal
0
472
Member Avatar for SimonIoa

Hello, I just saw your question, so according to FB best practises: > Use images that are at least 1200 x 630 pixels for the best display on high resolution devices. At the minimum, you should use images that are 600 x 315 pixels to display link page posts with …

Member Avatar for cereal
0
288
Member Avatar for Stefce

The sponsor badge appears also if you have received positive reputation points. From the green banner here in the page: > Questions asked by members who have earned a lot of community kudos are featured in order to give back and encourage quality replies. Now: > Is there something which …

Member Avatar for Dani
0
190
Member Avatar for Dani
Member Avatar for Dani

Here are the reasons: * https://dev.mysql.com/worklog/task/?id=6073 Mainly because the new default engine in 5.7 is InnoDB.

Member Avatar for rch1231
0
288
Member Avatar for Siberian

> I've googled a bit for you, but it seems you're out of luck. You should've forked your first pen. I can confirm is not supported, people use Gists on GitHub to versioning the code, but it requires to save **and** export to GitHub each time, manually. More info here: …

Member Avatar for gentlemedia
0
337
Member Avatar for mark_62

It seems spam. The Mozilla support forum is this: * https://support.mozilla.org/en-US/kb/get-community-support not the one linked by Remote_1.

Member Avatar for Reverend Jim
0
191
Member Avatar for Carlo_1

What rproffitt said. The support form for the plugin is: * https://translate.wordpress.org/projects/wp-plugins/tablepress An answer by the plugin's author to your same request: * https://wordpress.org/support/topic/is-it-possible-to-create-an-input-form-that-updates-the-table/

Member Avatar for rproffitt
0
837
Member Avatar for davy_yg

The reason is this: 554 delivery error: dd This user doesn't have a yahoo.com account (deacleodor@yahoo.com) In other words the email address does not exists.

Member Avatar for cereal
0
207
Member Avatar for davy_yg

Hi, are you loading the database library? You can do that in the `application/config/autoload.php` file, to make it available in all controllers and models: $autoload['libraries'] = array('database'); Instead, if you do not want to load it for every resource, you can load it in the constructor of the model or …

Member Avatar for davy_yg
0
2K

The End.