2,113 Posted Topics
Re: 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 … | |
Re: Test: https://http2.akamai.com/demo //Okay, it's not due to HTTP/2 :p | |
Re: Hi, can you provide the error message? ![]() | |
Re: 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 … | |
Re: 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 … | |
Re: Hi, I do not see the conditional statement to apply the comma. Do you have an example of the input? | |
![]() | Re: 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 … |
Re: 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 … | |
Re: 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 … | |
Re: **@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 = … | |
Re: 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? | |
Re: > 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. | |
Re: 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/) | |
Re: 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 … | |
Re: 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! | |
Re: Hello, please share the code otherwise we cannot help. | |
Re: Hi, can you show the insert query? Also if you add error checking do you get any additional information? | |
Re: 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 } | |
Re: Between *Ask* and *Discussion* I prefer *Submit* as it fits both. | |
Re: 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); | |
Re: 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 … | |
Re: 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? | |
Re: > 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 … | |
Re: 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 … | |
Re: **@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 | |
Re: > 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 … | |
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 … | |
Re: 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/ | |
Re: 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 … | |
Re: 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/ ![]() | |
![]() | Re: 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! |
Re: 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. | |
Re: Consider also that you could serve Google Fonts from your web server, just download them and set the paths in the CSS file. | |
Re: Another random fact: sometimes in logs you see Google's bot user agent but it's just another crawler trying to avoid filters. | |
Re: 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: ' … | |
Re: 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 | |
Re: 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); … | |
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. | |
Re: So, something like this extension: https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=29709&sort=date_added correct? | |
Re: 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 … | |
Re: 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 … | |
Re: Here are the reasons: * https://dev.mysql.com/worklog/task/?id=6073 Mainly because the new default engine in 5.7 is InnoDB. | |
Re: > 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: … | |
Re: 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. | |
Re: 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/ | |
Re: 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. | |
Re: 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 … |
The End.