2,113 Posted Topics

Member Avatar for bolfescu

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 …

Member Avatar for bolfescu
0
222
Member Avatar for subbu_1

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

Member Avatar for subbu_1
0
271
Member Avatar for Riptyed

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.

Member Avatar for JorgeM
0
171
Member Avatar for Sammys.Man

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 …

Member Avatar for Sammys.Man
0
139
Member Avatar for asaidi

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 …

Member Avatar for asaidi
0
284
Member Avatar for showman13

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

Member Avatar for showman13
0
253
Member Avatar for edbr

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

Member Avatar for edbr
0
370
Member Avatar for asaidi

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 …

Member Avatar for asaidi
0
352
Member Avatar for socialmd

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 …

Member Avatar for Ashvin_1
0
5K
Member Avatar for SimonIoa

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 …

Member Avatar for SimonIoa
0
194
Member Avatar for Anuj877

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

Member Avatar for cereal
0
2K
Member Avatar for Santanu.Das

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/

Member Avatar for Santanu.Das
0
160
Member Avatar for Chris920
Member Avatar for Samyx

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

Member Avatar for cereal
0
2K
Member Avatar for darrylnuyda

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

Member Avatar for Le_1
0
1K
Member Avatar for janicemurby

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 …

Member Avatar for cereal
0
184
Member Avatar for SimonIoa

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 …

Member Avatar for cereal
0
668
Member Avatar for jaspertan

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

Member Avatar for Mike_21
0
15K
Member Avatar for saadi06

Check if this thread helps you: http://codeigniter.com/forums/viewthread/71999/ Bye.

Member Avatar for chetra
0
782
Member Avatar for imti321

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 …

Member Avatar for iamthwee
0
470
Member Avatar for SimonIoa

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 …

Member Avatar for SimonIoa
0
486
Member Avatar for Whilliam

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 …

Member Avatar for matrixdevuk
0
277
Member Avatar for nadiam
Member Avatar for nadiam
0
738
Member Avatar for Ventech_IT

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

Member Avatar for cereal
0
194
Member Avatar for anmol.raghuvanshi1

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 …

Member Avatar for cereal
0
5K
Member Avatar for Dani

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

Member Avatar for Dani
3
702
Member Avatar for diafol
Member Avatar for davy_yg

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 …

Member Avatar for Taywin
0
106
Member Avatar for Ventech_IT

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.'; }

Member Avatar for Ventech_IT
0
258
Member Avatar for AntonyRayan
Member Avatar for AntonyRayan
0
224
Member Avatar for Vishnu_4

Without seeing your code it is difficult to answer. Are you using an API to submit these requests?

Member Avatar for cereal
0
99
Member Avatar for kazkuzzer007

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 …

Member Avatar for kazkuzzer007
0
104
Member Avatar for imti321

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.

Member Avatar for imti321
0
206
Member Avatar for <M/>

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

Member Avatar for <M/>
0
183
Member Avatar for Osagie_1

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 …

Member Avatar for cereal
0
868
Member Avatar for iamthwee

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

Member Avatar for iamthwee
0
9K
Member Avatar for ankit1122

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 …

Member Avatar for ankit1122
0
100
Member Avatar for adsegzy

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?

Member Avatar for cereal
0
435
Member Avatar for ademmeda

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 …

Member Avatar for cereal
0
289
Member Avatar for msz900

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 …

Member Avatar for imti321
0
403
Member Avatar for uchejava

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

Member Avatar for uchejava
0
168
Member Avatar for UK-1991

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 …

Member Avatar for Zagga
0
323
Member Avatar for joshmac

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

Member Avatar for joshmac
0
235
Member Avatar for ravi142
Member Avatar for cereal

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

Member Avatar for cereal
2
662
Member Avatar for zebnoon1

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

Member Avatar for cereal
0
217
Member Avatar for aditipriya

MySQL does not support the `varray` type, you can use `varchar` or `text` to store CSV lists and then use functions like `FIND_IN_SET`: - http://dev.mysql.com/doc/refman/5.6/en/string-functions.html

Member Avatar for cereal
0
49
Member Avatar for Daniel_31

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 …

Member Avatar for janissantony
0
224
Member Avatar for nadiam

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 …

Member Avatar for janissantony
0
861
Member Avatar for coder123

Are you using indexes? You can enable the slow query log to see in which conditions this happens: * http://dev.mysql.com/doc/refman/5.6/en/slow-query-log.html

Member Avatar for janissantony
0
390

The End.