2,113 Posted Topics

Member Avatar for sashiksu

Hi, are you sure the database system allows remote connections? The default setup for MySQL listens on localhost. Consider also that some hosting services provide access only from a restricted range of IPs, usually their web servers.

Member Avatar for Marlon_3
0
5K
Member Avatar for masimies
Member Avatar for masimies
0
3K
Member Avatar for Marco_4

> I wondered if their syntax was safe against sql attacks, though in fact could be improved with the inclusion of the bind, but do not know how to make them better. Use prepared statements, add a second parameter to the `getOne()` and `getAll()` methods and send an array, for …

Member Avatar for cereal
0
187
Member Avatar for godfreysseki

Hi, I didn't downvoted but I suspect it happened because you should show some efforts on your side and share the code you've written to achieve the requested goals. This forum is not a code service. In other words if you have doubts about a specific step of your code, …

Member Avatar for cereal
-1
58
Member Avatar for Amaina

Hi, look at the result message: Query OK, 0 rows affected, 33 warnings (0.00 sec) Records: 11 Deleted: 0 Skipped: 11 Warnings: 33 by running `SHOW WARNINGS;` after the load query, you should get some information about the statement issues.

Member Avatar for Amaina
0
4K
Member Avatar for janicemurby

Hi, it seems fine to me. Make sure the database connection is available by adding an error check: if ($db->connect_errno) { die('Connect Error: ' . $db->connect_errno); } Check also if you get through each IF condition by placing something like `die('stop at ' . __LINE__);` and so on after each …

Member Avatar for cereal
0
294
Member Avatar for vishalsingh1080

Hi, check these white papers: * https://research.facebook.com/publications/storage-infrastructure-behind-facebook-messages-using-hbase-at-scale/ * https://research.facebook.com/publications/finding-a-needle-in-haystack-facebook-s-photo-storage/ * https://research.facebook.com/publications/f4-facebook-s-warm-blob-storage-system/

Member Avatar for vishalsingh1080
0
162
Member Avatar for jKidz

Hi, the attachment is sent to Gmail servers. Yahoo will only deliver the mail. In practice the email body attachment part is composed by an header and by the content, some examples here: * https://tools.ietf.org/html/rfc2183#section-2.10

Member Avatar for koupon
0
290
Member Avatar for RikTelner

Look also at a PHP Accellerator like APC: https://en.wikipedia.org/wiki/List_of_PHP_accelerators

Member Avatar for jkon
0
234
Member Avatar for masimies

Hi, you can find a fork of the original code on GitHub, which has been updated to MySQLi, here's the link to the code: * https://github.com/ug2215/RegistrationForm The upgraded fork was started after the pull request was not merged, as you can read here: * https://github.com/simfatic/RegistrationForm/pull/11 Bye!

Member Avatar for masimies
0
882
Member Avatar for sashiksu

The column is a string type and the value is literally something like `0 values` or is an integer, float column? Can you show the table schema and an example of data?

Member Avatar for AndrisP
0
364
Member Avatar for FarrisFahad

Hi, in practice this is a page that waits for a POST form submission, made by the PayPal service. An example can be found in their GitHub account: * https://github.com/paypal/ipn-code-samples/blob/master/paypal_ipn.php You receive data and send it back to check if it's valid, then you can use save it. Source: * …

Member Avatar for FarrisFahad
0
352
Member Avatar for James_43

Hi, it could be a problem with the `innodb_buffer_pool_size`, the default value is 128MB of RAM, try to increase it, you can follow the suggestions in the documentation: * https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_buffer_pool_size If this does not help check the others processes to see if something else (the web server) is using too …

Member Avatar for James_43
0
542
Member Avatar for AntonyRayan

Hi, how did you applied the color to the box? Stylesheets? And if affirmative, did you used a media print stylesheet? For example: <link rel="stylesheet" href="/styles/print.css" media="print"> And: are you sure the print is not preset to grayscale?

Member Avatar for cereal
0
137
Member Avatar for joshl_1995

> I'm thinking not because I don't really want "smutt" related to my website. It's probably the same for your other clients, I doubt they would like to be associated with an adult site.

Member Avatar for jkon
0
719
Member Avatar for James_43

Is there a specific reason for this setup? Some points to consider: 1. MySQL does not support socks connections, you can create a socket unix file, but it's not the same thing 2. you will have to setup Tor nodes in both ends: application server and database server 3. you …

Member Avatar for cereal
0
1K
Member Avatar for Maryam_7

Hi, you're mixing *object* `$conn` with *procedural* `$link` and opening two indipendent connections to the database, if you want to stick with procedural, then change: $result = mysqli_query($conn, $sql); to: $result = mysqli_query($link, $sql); and then it should work properly.

Member Avatar for cereal
0
4K
Member Avatar for suraj32

Hi, check the **Process States** documentation: * http://supervisord.org/subprocess.html#process-states * http://supervisord.org/configuration.html?highlight=exitcodes In practice: define the expected `exitcodes` for the script and then set `autorestart=unexpected` so that it will restart only when it does not match.

Member Avatar for cereal
0
405
Member Avatar for Natsu123

By the way, you're missing the `$` symbol in the `$_POST` array: $blood_typeA = _POST['Blood_TypeA']; $blood_typeB = _POST['Blood_TypeB']; $blood_type0 = _POST['Blood_Type0']; $blood_typeAB = _POST['Blood_TypeAB']; Should be: $blood_typeA = $_POST['Blood_TypeA']; And so on.

Member Avatar for cereal
0
861
Member Avatar for abhi10kumar

Hi, if you have, or can enable, the **intl** extension then use the [`IntlDateFormatter`](http://php.net/manual/en/class.intldateformatter.php) class: * http://php.net/manual/en/intldateformatter.format.php Look also at the comments in the documentation page.

Member Avatar for cereal
0
122
Member Avatar for Hamis_2

Hi, A good point to start to investigate the issue is **sale2.php on line 58**, can you show us that part of code? I mean: paste the relevant code not just that line.

Member Avatar for Hamis_2
0
204
Member Avatar for Natsu123

Not tested but try: $sql = <<<EOD INSERT INTO T_Student(Name, Surname, Street, City, F_ID_Teacher) VALUES('$Name', '$Vorname', '$Strasse', '$Plz', '2'); SET @id = last_insert_id(); INSERT INTO T_Class(Subjekt, Number, F_ID_Student) VALUES('', '', @id); INSERT INTO T_School(Name, Street, City, F_ID_Student) VALUES('', '', '', @id) EOD; Here the student id is retrived by the …

Member Avatar for Za3mi
0
270
Member Avatar for James_43

When you use double quotes you can include the variable and this will be expanded to the associated value. The curly braces `{$var}` are used to write complex expressions when the variable is: an index array, an object or an anonymous function. Few examples: # array $str = "Hello {$data['name']}"; …

Member Avatar for diafol
0
430
Member Avatar for azegurb

Hi, PHP does not have a $_PUT method (unfortunately) so, in order to accept such input you have to listen for stdin streams. The following documentation explains how you can upload a file through this method: * http://php.net/manual/en/features.file-upload.put-method.php A part this solution, some frameworks and APIs use fake PUT (and …

Member Avatar for cereal
0
270
Member Avatar for shashigowda

Hi, if you want to return the value of a variable then use double quotes, if you want to return plain text, then use single quotes. For more information check the documentation: * http://php.net/manual/en/language.types.string.php

Member Avatar for cereal
0
265
Member Avatar for Stefce

Hi, supposing `31.170.161.176` was your IP address, you cannot connect directly from your computer to the 000webhost MySQL server because remote connection is disabled, unless you upgrade your account: * https://www.000webhost.com/faq.php?ID=27 It means that, with the basic plan, they only allow connections to the databases from a defined range of …

Member Avatar for Stefce
0
346
Member Avatar for Fiorentino01^
Member Avatar for overwraith

> It doesn't look like JSON or anything. It looks like byte codes or something. (I DID NOT WRITE THIS APPLICATION) So, you have decoded the base64 string and you're seeing some strange code? What is the variable for? It could be an icon. An easy method to see the …

Member Avatar for almostbob
0
273
Member Avatar for jmishal

Hi, you can access the key by doing: $item['data'][0]['is_fav'] For the first array, then repeat the same for `$item['data'][1]...`. You should, also, use *prepared statements* with MySQLi or PDO, the MySQL API has been removed from the latest PHP release. To increase performance you can also create a batch insert. …

Member Avatar for cereal
0
3K
Member Avatar for mohammed_22

Hi, first of all, you have to run `$this->load->view('page', $data);` in your method controller. Also could you indent your code of the **view page**?

Member Avatar for cereal
0
1K
Member Avatar for mexabet

Hi, You are not executing the query: $rows = "SELECT * FROM admin WHERE username = '$username'"; Where is the `execute()`? Besides, the IF statement will fail because the `crypt()` function will generate a different hash each time you run it. So change line **30** to: if (password_verify($_POST["password"], $row["hash"])) It's …

Member Avatar for mexabet
0
411
Member Avatar for tony75

Hi, you should not need the win32 version, just download the archive to a specific path, for example `~/sources/`, extract and create a link to `/usr/bin/` so that the script is available through the system: wget https://github.com/pyinstaller/pyinstaller/releases/download/v3.1/PyInstaller-3.1.tar.gz tar -zxf PyInstaller-3.1.tar.gz cd PyInstaller-3.1 sudo ln -s $PWD/pyinstaller.py pyinstaller.py -h | less …

Member Avatar for tony75
0
6K
Member Avatar for Acurapassion

**@rookhaven** you can use special characters, but you have to escape, for example instead of: mysql -uroot -pabc!def do: mysql -uroot -pabc\!def and it will work, bye!

Member Avatar for cereal
0
529
Member Avatar for brianbabu

Hi, if you haven't found a solution, could you show the Product model and the table definition?

Member Avatar for cereal
1
190
Member Avatar for MissMolly

If you're using PHP 5.5+ then you could use `array_column` with `implode()`, for example: <?php // example contents $_POST['data'][] = ['a' => 1]; $_POST['data'][] = ['a' => 2]; $_POST['data'][] = ['a' => 3]; // $data = $_POST['data']; $data = implode(' ', array_column($data, 'a')); print $data; That will print `1 2 …

Member Avatar for cereal
0
135
Member Avatar for MissMolly

Hi, you could use the [Nowdoc syntax](http://php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc), I prefer it because the code is more readable, but it's your choice, an example: <?php $id = rand(1,1000); $name = 'MissMolly'; $email = 'email@email.tld'; $request = <<<'EOD' <?php $to = "%1$s"; $subject = "Invoice Request"; $message = "%2$s is requesting %3$d quote"; …

Member Avatar for diafol
0
234
Member Avatar for janicemurby

Hi, look here `user_id = '".$_SESSION['userid']."' ")"` remove the second-last quote, so that changes to: `)"`. Then it should work, but consider that an **INSERT** query does not support the **WHERE** statement, unless this is into an `INSERT ... ON SELECT` query: * http://dev.mysql.com/doc/refman/5.7/en/insert-select.html

Member Avatar for diafol
0
357
Member Avatar for Daudi_1

Hi, the error is telling you the index key `cid` does not exists in the `$_GET` array. So, are you submitting the `cid` attribute through the form or through the action link? I mean, like this: <form action="script.php" method="post"> <input type="hidden" name="cid" value="123"> or like this? <form action="script.php?cid=123" method="post"> By …

Member Avatar for cereal
0
1K
Member Avatar for janicemurby

Hi, at line 9 do: mysqli_query($MySQLi_CON, $delete) or die(mysqli_error($MySQLi_CON)); You should get the error returned from the database server.

Member Avatar for diafol
0
214
Member Avatar for rpv_sen

So, you get the email but not the query contents, correct? Is the `$conn` resource set in the included **config.php** file?

Member Avatar for rpv_sen
0
669
Member Avatar for Chris920

Hi, about this: $clean["text"]=str_replace("malicious", " ", $_POST[text]); In all cases these quotes are used to define a string, in: $clean["text"] You are defining an index key on an array defined in the `$clean` variable, the other two, instead, are arguments of the `str_replace()` function. In this case, unless `text` is …

Member Avatar for cereal
0
251
Member Avatar for NONONO123

Hi, look at the manual: http://php.net/manual/en/mysqli-result.fetch-array.php The argument must be a constant, in your case `MYSQL_ASSOC` without the quotes, the constant in this case is an integer and his value is `1`, for `MYSQL_BOTH` instead is `3`, so you could write: $result->fetch_array(MYSQL_ASSOC); # or $result->fetch_array(1); and get the same result …

Member Avatar for cereal
0
4K
Member Avatar for lewashby

You can run netstat with these options: sudo netstat -tulpn |grep -E ':[0-9]{5}' Or simply search for a specific port number: sudo netstat -tulpn |grep :28017 It should return something like: ... tcp 0 0 0.0.0.0:17500 0.0.0.0:* LISTEN 3374/dropbox ... You can get more information about the process by checking …

Member Avatar for cereal
0
394
Member Avatar for wolfgang1983

Hi, you could set the line separator into `getValue()`, for example at line `28`: editor.getValue('<br>') But this will add the `<br>` also in the code blocks, otherwise you can apply a CSS rule to `#question-preview`: #question-preview { white-space:pre-line; } And change the `#question-preview pre code` white-space rule at your preferences: …

Member Avatar for cereal
0
1K
Member Avatar for FarrisFahad

> Can someone change their IP address repeatedly in a short time, say less than a minute or five? Yes, if IP is dynamic you disconnect & connect to get a new address, not always in the same range and it can change even at each request when using services …

Member Avatar for cereal
0
273
Member Avatar for janicemurby

The problem is generated in the `IN()` statement: what happens if `$topuid` is empty, like in your code? $topuid = array(); $idtopuid = implode(',', $topuid); The result of `$idtopuid` will be an empty string, example: var_dump(implode(',', [])); string(0) "" This will generate the syntax error you got: *syntax to use …

Member Avatar for janicemurby
0
335
Member Avatar for abhi10kumar

> but it is showing red link in the console with no error message or status. If you meant Google Chrome Console then can you check if there is any additional information in the **Network** tab? When a request fails even if the status code is not returned it should …

Member Avatar for cereal
0
1K
Member Avatar for Violet_82

Keep in mind that your server side script is not safe: an attacker could send a request directly to the **formhandler.php** script and this will execute without control. Also the script should check the request method, for example by clicking (i.e. executing a GET request) on: * http://YOURDOMAIN/formTest/formhandler.php it should …

Member Avatar for cereal
0
1K
Member Avatar for Samuel_9

Hi, I'm not sure I've understood your request and I haven't used L4 in a while, but: with('message','Message has been sent',compact('account','pageTitle')) Should not work, as the `with()` method accepts only two parameters: * https://github.com/laravel/framework/blob/4.2/src/Illuminate/Http/RedirectResponse.php#L48 You are feeding three. Instead you could try: with('message', array('Message has been sent', array('account','pageTitle'))) But I'm …

Member Avatar for diafol
0
7K
Member Avatar for Stefce

The specific error raises because the index key does not exists in the array, example: $data['a'] = 'hello'; print $data['a']; # will print 'hello' print $data['b']; # will raise the error By using `array_key_exists('index', $_FILES)` you can avoid such problems. But you have to consider that, usually, the **$_FILES** array …

Member Avatar for Stefce
0
495

The End.