2,113 Posted Topics
Re: Hi, If you are referring to the value of the variables then check it before executing the query: if( ! is_null($trans_autista) && ! is_null($cat)) { # execute query } If instead you are referring to the table rows, then create a unique index of `autista` and `ditta` columns. And then … | |
Re: It happens because the query returns FALSE instead of returning a result set, there is an error in your query, try to add the quotes around `$name`: ... category = '$name' ... **But** you should really switch to prepared statements: * http://php.net/mysqlinfo.api.choosing * http://php.net/manual/en/pdo.prepared-statements.php * http://php.net/manual/en/mysqli.quickstart.prepared-statements.php | |
Re: Hi, do you have some sort of [referer](http://en.wikipedia.org/wiki/Referer_spam) [filter](http://stefaanlippens.net/refererspam) that could block the access from your company network? Are you using [access control directives](http://httpd.apache.org/docs/2.4/howto/access.html) to block an IP range or some specific user agents? If not, then ask the hosting company if they banned your IPs from their network. | |
Re: Hi, you can set only one `thead` for each table, here you're setting two of them, and the number of columns must match those in the `tbody` block. You can set multiple `tbody` blocks, for example you can create a tbody block to emulate the second header. Otherwise you have … | |
Re: By using PDO you can execute two prepared statements, for example: <?php try { $pdo = new PDO("mysql:dbname=db", "user", "pass"); } catch (PDOException $e) { die('Connection failed: ' . $e->getMessage()); } $value1 = 10; $value2 = 2; $stmt = $pdo->prepare("SET @a = ?"); $stmt->execute(array($value1)); $stmt = $pdo->prepare("UPDATE van SET position … | |
Re: What's your purpouse? You cannot access the client path of an uploaded file, because the browser operates in a sandbox and will send only the file and the name. If instead you simply want a link, then you cannot use the **file** input control, use **text** or if using HTML5, … | |
Re: Hi, try to understand how the infection was accomplished, if by using a compromised FTP account (check server logs, change passwords, secure client machines) or because of a code bug, in this last case there's a lot of documentation you can read: * http://php.net/manual/en/security.php * http://phpsec.org/projects/guide/ * https://www.owasp.org/index.php/PHP_Security_Cheat_Sheet * http://phpsecurity.readthedocs.org/en/latest/ … | |
Re: Hi, let me understand, you get two arrays from a form, for example: $a = [1,2,3,4,5]; $b = [10,11,12,13,14]; Then you combine them to have `$a` as keys and `$b` as values and finally you loop them and use each pair as `WHERE` conditions in your update queries. So what's … | |
Re: In report.php class, line 94 you echo inside the class but you should use return:[code]return $employee_id; #last id of multiple insert[/code] In same function you should set a mysql_query() in order to insert. But it seems you want to send groups of arrays, reordered by report.php view, but there is … | |
Re: The first error happens because the `throwExceptionOnError()` method is missing from your class. Regarding the second warning, as explained by the message: define the default timezone in your php.ini file or use: date_default_timezone_set('UTC'); More information here: * http://php.net/manual/en/timezones.php * http://php.net/manual/en/function.date-default-timezone-set.php By the way, the following class seems to match your … | |
Re: Hi, not tested, but according to the library, dompdf works in a *chroot* so it will not consider files outside of his path, this is defined here: /** * ==== IMPORTANT ==== * * dompdf's "chroot": Prevents dompdf from accessing * system files or other files on the webserver. * … | |
Re: MySQL can store up to **16TB** per table, but it depends on OS/filesystem in use, with linux the limit is **4TB** per table, source: * http://dev.mysql.com/doc/refman/5.6/en/table-size-limit.html MSSQL seems capable of **16TB**: * https://msdn.microsoft.com/en-us/library/ms143432.aspx I will add PostgreSQL to the comparison, which can handle up to **32TB** per table: * http://www.postgresql.org/about/ | |
Re: Hi, have you asked support to the AVS helpdesk? | |
Re: Hi, your configuration seems fine, but try to remove the `mod_auth_form` directives from the .htaccess file, most of these can be applied only to **directory** context, not in .htaccess: * http://httpd.apache.org/docs/2.4/mod/mod_auth_form.html Also, did you encoded the passwords in the `AuthUserFile` with **htpasswd**? Docs: * http://httpd.apache.org/docs/current/mod/mod_authn_file.html | |
Re: Go to: https://github.com/laravel/laravel Click on download in the right side of the page, unzip the file and move everything to the folder that will run the website. Use the [installation notes](http://laravel.com/docs/installation) to be sure to create a public_html directory, this is where you have to publish css and javascript files. … | |
Re: Yes, but if you can give more details we can suggest proper solutions... just to consider a possible scenario: if these are going to be used in a search query you can convert them into a CSV string and use the MySQL `FIND_IN_SET()` function: * http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_find-in-set For example: <?php $pdo … | |
Re: Hi, check for **GD** or **Imagick** libraries, these are both part of PHP: * http://php.net/manual/en/book.image.php * http://php.net/manual/en/book.imagick.php Also, when saving the images you should optimize them for the web, or at least reduce their quality, read about this topic here: * http://docs.gimp.org/en/gimp-using-web.html * https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/image-optimization Anyway don't look only to the … | |
Re: Do you want to save the files or only the names? In the former case then use something like this: <form method="post" enctype="multipart/form-data" action="/upload_file"> <input type="file" name="file" /> <input type="submit" name="submit" value="upload" /> </form> And these methods in the **router.php** file: Route::get('/upload_form', function() { $data['files'] = Attachment::get(); return View::make('uploads.form', $data); … | |
Re: Check if this thread helps you: http://codeigniter.com/forums/viewthread/71999/ Bye. | |
Re: The `$headers` variable is not initialized, if you check the error log you should see a notice: PHP Notice: Undefined variable: $headers in ... for this reason the `mail()` function will fail, to solve the problem you can remove it (since it's an optional argument), set it to `NULL` or … ![]() | |
Re: Hi, I suppose **SimpleImage** is this: - https://searchcode.com/codesearch/view/69726118/ Or a similar version of the above, the error in your code is that you're overwriting the variable `$final_image` with the new instance of SimpleImage: $final_image = '/path/to/file.jpg'; $final_image = new SimpleImage(); # <- value overwrite $final_image->load($final_image); # <- error So change … | |
Re: Hi, at the moment this is not a good idea, two or more users could share the same IP address at the **same time**, if using a proxy or a connection from an office, a library... or in **different days**: most users use dynamic addresses, so **user A** today has … | |
Re: Hello, it's exec**ut**e, not exec**tu**e , so change line 7 to: $getpic->execute(); | |
Re: Hi, since you write: echo form_open("email/send"); The receiving controller should look like: <?php class Email extends CI_Controller { public function send() { # code here } } More information here: * http://www.codeigniter.com/user_guide/general/routing.html | |
![]() | Re: If you want to save multiple values then use **checkboxes** not **radio buttons**, from a group of radio buttons you must get only one value, assign the same `name` but different `value`: <input type="radio" name="pain" value="1"> Headache <input type="radio" name="pain" value="2"> Acidity <input type="radio" name="pain" value="3"> It's lupus Then in … |
Re: Hello! I'm having few small issues when using Google Chrome on Ubuntu. #Problem 1# It does not seem to indent correctly code snippets, an example here: * https://www.daniweb.com/web-development/php/code/488524/parse-google-gmail-aliases **Screenshots:** [Parsed](http://i.imgur.com/QxYqlui.png) & [Plain-Text](http://i.imgur.com/KowYF6L.png) It happens only with Google Chrome on Ubuntu, latest version: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) … | |
![]() | |
Re: In which script do you set the value for this session index? Also: do you know that using single quotes will NOT return the value of a variable? If you do: echo '$banner'; You get `$banner`, literally. While using double quotes you get the value of the variable, if this … | |
Re: The method `result_array()` will return an array, or an empty array if the query does not return any results, so: if(count($events) > 0) { foreach($events as $event_item) { # ... code here ... } } else { echo 'No items.'; } | |
| |
Re: Without seeing your code it is difficult to answer. Are you using an API to submit these requests? | |
Re: In addition. It does not work because `$to` exists only in the function scope and since you declare it as function argument `$b`, you should get PHP notices: PHP Notice: Undefined variable: b in line 9 PHP Notice: Undefined variable: b in line 11 if you want to get the … | |
Re: Hi, can you explain your issue? The only problem I see is indentation and the variable `$Ok` at line 9 which should be `$ok`, PHP is case sensitive. | |
Re: Uh, I think a local server is required so the template can be processed by PHP. If you're using **PHP 5.4+** then you can start the built in server to load the pages. Open a command line an type: php -S localhost:8000 -t /path/to/website More information here: * http://php.net/manual/en/features.commandline.webserver.php | |
Re: Hi, **@SalmiSoft** sorry I just saw your answer! **@Osagie_1** the problem is given by the regular expression in `preg_match()`, right now you are checking if there is a digit, not for a specific format, so if the expression matches `1` in `100%` it goes through. `strtotime()` will return false, so … | |
![]() | Re: Hi! I've experienced this kind of issue in past, it was due to a mismatch of mime-types and I fixed by updating the *application/config/mimes.php* file. But I was trying to upload PDFs and images. Set the `environment` constant in the main **index.php** file to the `development` stage, set the `log_threshold` … ![]() |
Re: There are not specific advantages for web pages, but for their components yes: from a performance point of view, serving images (and in general static contents) from different subdomains, will improve the rendering speed of the page. This because browsers limit parallel downloads to two images per domain, so if … | |
Re: Wait, let's try to simply the task: 1. you want to write text to an image? 2. Or you want to extract text from an existing HTML code? | |
Re: Hi hi! If considering only Apache you can try with the `Location` directive: <Location /mypage/> order deny, allow deny from 10.0.0.120 </Location> The applicable **context** for this directive is **server config** or **virtual host**, it means you cannot apply it into the **.htaccess** file and after each change you need … | |
Re: Check the value of `LimitRequestBody` in the Apache configuration file, every request larger than this limit will be blocked, PHP will not even reply. After you adjust the value reload Apache, otherwise the change will not apply. Docs: http://httpd.apache.org/docs/current/mod/core.html#limitrequestbody By the way: if you check the response headers to the … | |
Re: Create `$friends` like this: foreach($results as $row) { $friends[$row['id']]['first_name'] = $row['first_name']; $friends[$row['id']]['last_name'] = $row['last_name']; } So you save the user ID as index key of the array, when you want to compare use `array_keys()` to generate an array of IDs: $friend_keys = array_keys($friends); foreach($friend_keys as $key) { if( ! in_array($key, … | |
Re: Hi, with `mysqli_connect_errno()` you check if there is an error, if yes then, with the same function, you get the error code, which is an integer, while with `mysqli_connect_error()` you get a string that describes the error. The error code allows you to easily create a switch statement to perform … ![]() | |
Re: What kind of values are returned by `crse.preReq` in the sub query: integers, CSV? If CSV then the `IN()` clause is not the correct solution, because it can return something like this: IN('2,3', '11,17,20', '5') In order to work each value should be separated, not grouped by the row result, … | |
Re: Try video.js: http://www.videojs.com/ it is open source. | |
When using emails as usernames you want them to be unique over your table, but this can be a problem if you consider a GMail account, because of their [username](https://support.google.com/mail/answer/12096?hl=en) [policy](https://support.google.com/mail/answer/10313?hl=en). They allow: * dots * digits * letters * plus addressing text by using the `+` sign, i.e. `orange+juice@gmail.com` … | |
Re: **@pzuurveen** sorry, I didn't saw your reply! ;D **@zebnoon1** There are few errors: `session_start()` must be placed in top of both files. Then, you're submitting the form to **session2.php**, so the code between lines `14` and `21` of **session1.php** file will not work: because it runs when you open the … | |
Re: You can use a view, for example: CREATE VIEW test_view AS SELECT fruit FROM t1 WHERE id IN(1,2) UNION SELECT fruit FROM t1 WHERE fruit = 'cherries'; Or you can use a temporary table: CREATE TEMPORARY TABLE IF NOT EXISTS test_memory ENGINE = memory AS SELECT fruit FROM t1 WHERE … | |
Re: Check if the MySQL daemon is up and if the path to the socket is correct: this is defined in the configuration file of MySQL, i.e. `/etc/mysql/my.cnf`, in distro-specific configuration files, like `/etc/mysql/debian.cnf`, and in the PHP configuration file through `pdo_mysql.default_socket=`. Cascading rule is applied: the PHP configuration overrides debian.cnf … | |
The End.