2,113 Posted Topics
Re: 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. | |
Re: > 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 … | |
![]() | Re: 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, … |
Re: 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. | |
Re: 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 … | |
Re: 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/ | |
Re: 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 | |
Re: Look also at a PHP Accellerator like APC: https://en.wikipedia.org/wiki/List_of_PHP_accelerators | |
Re: 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! | |
Re: 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? | |
Re: 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: * … | |
Re: 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 … | |
Re: 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? | |
Re: > 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. | |
Re: 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 … | |
Re: 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. | |
Re: 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. | |
Re: 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. | |
Re: 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. | |
Re: 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. | |
Re: 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 … | |
Re: 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']}"; … ![]() | |
Re: 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 … | |
Re: 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 | |
Re: 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 … | |
Re: Hi, which error? Can you be more specific? | |
Re: > 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 … | |
Re: 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. … | |
Re: 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**? | |
Re: 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 … | |
Re: 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 … | |
Re: **@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! | |
Re: Hi, if you haven't found a solution, could you show the Product model and the table definition? | |
Re: 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 … | |
Re: 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"; … ![]() | |
Re: 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 ![]() | |
Re: 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 … | |
Re: 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. ![]() | |
Re: So, you get the email but not the query contents, correct? Is the `$conn` resource set in the included **config.php** file? | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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: … | |
Re: > 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 … | |
Re: 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 … | |
Re: > 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 … | |
Re: 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 … | |
Re: 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 … ![]() | |
Re: 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 … |
The End.