2,113 Posted Topics
Re: Hi, what are the requirements? Is this for a carrier or for a shop? For example: in the second case you will need few tables in which you can record the tracking id, the carrier details and each step of the shipment process, most of this information can be retrieved … | |
Re: It's fine for me on Google Chrome, Ubuntu: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36 | |
Re: Hi, you probably have to use their API, I'm not sure you can use the JavaScript SDK for this task, maybe you will need the PHP SDK, here are the links to the documentation: * https://developers.facebook.com/docs/javascript * https://developers.facebook.com/docs/reference/php/5.0.0 | |
Re: Hi, you have to set a callback URL to receive the POST requests, from Parse API documentation: > The Parse API will POST the parsed email to a URL that you specify. If a POST is unsuccessful, SendGrid automatically queues and retries any POSTs that respond with a 4XX or … | |
Re: **@broj1** Hi, I've seen that in Magento, for internationalization, it's a refer to gettext `_()`: * http://php.net/manual/en/function.gettext.php | |
Re: Hi, to hide an input field use `type="hidden"`: <input type="hidden" name="from[]"> Now, `$_POST['from']` will be an array, if value is not assigned, then it will be an empty array, for example: Array ( [origin] => Array ( [0] => ) [other] => hey ) So, if you have a problem … | |
Re: Hi, I haven't used Rails for ages, but I think you probably need `execute` to run a raw query, for example: def up execute <<-SQL CREATE VIEW rocket_current_activities AS SELECT rocket_activities.status AS status from rocket_activities.... SQL end Docs: http://edgeguides.rubyonrails.org/active_record_migrations.html#using-the-up-down-methods | |
Re: Obtain from where: database, form? Which formula would you apply? | |
Re: Hi, you mean how to add conditional statements to a loop? For example: var test = 'oranges'; ['apples', 'oranges', 'mango'].forEach(function (elem, index) { // conditional statement if (elem == 'oranges') { console.log('Chosen element: ' + elem); } // default condition else { console.log('Something else.'); } }); Docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach | |
Re: Hi, try to add `ORDER BY unit_cm DESC LIMIT 3` to the subquery and remove `min()` from the main query. ![]() | |
Re: In addition, you could use `document.createTextNode()`: $('form').on('change', function (e) { var text = $('#bla').val(); $('#cnt').append(document.createTextNode(text)); }); Example: http://jsfiddle.net/u6pqhjzy/ Documentation: https://developer.mozilla.org/en-US/docs/Web/API/Document/createTextNode ![]() | |
Re: Hi, it depends on the OS: on Windows the measured time is the real time; on Linux system calls do not affect the execution time. Read the note at this page: * http://php.net/manual/en/function.set-time-limit.php You can test it by yourself: <?php ini_set('max_execution_time', 1); while(true) echo 'hi ' . date('H:i:s') . PHP_EOL; … | |
Re: Hello, move the `</body>` tag to the end of the page, just before the `</html>` tag. An HTML document is composed two main sections, head and body: <html> <head> <title>Test</title> </head> <body> <!-- content area --> <h1>Hello</h1> <p>Bla bla bla</p> <!-- end of content area --> <!-- Area where to … | |
Re: Have you tried by moving the condition to the WHERE statement? For example: SELECT * FROM MY_TABLE WHERE BIT_COUNT(CAST(CONV(value,16,10) as unsigned integer) ^ CAST(CONV('$submit', 16, 10) AS UNSIGNED) ) >= 14; | |
Re: Hi, starting from PHP 5.3, SQLite3 is enabled by default, this would allow you to create an sqlite file and connect to it: * http://php.net/manual/en/book.sqlite3.php * using PDO: http://php.net/manual/en/ref.pdo-sqlite.php In both cases it requires that on compilation the hosting didn't disabled the support. Looking at **phpinfo()** you should be able … | |
Re: Hi, on terminal write `hp-` then hit tab, you should see: hp-align hp-info hp-query hp-check hp-levels hp-scan hp-clean hp-logcapture hp-setup hp-colorcal hp-makeuri hp-testpage hp-config_usb_printer hp-pkservice hp-timedate hp-doctor hp-plugin hp-unload hp-firmware hp-plugin-ubuntu hp-hpdio hp-probe Which are the utils installed by the hplip package, among them there is also the command **hp-scan** … | |
Re: > Interviewer said you need not to use any key in the table either that is a unique key or any natural key. So nothing explicitly defined in the creation table statement, correct? Maybe the question refers to implict keys like ROWID (available on [Oracle](http://docs.oracle.com/cd/B19306_01/server.102/b14200/pseudocolumns008.htm) & [SQLite](https://www.sqlite.org/lang_createtable.html#rowid)), or OIDs (Object … | |
Re: Hi, you can use IMAP to access the ticket@domainname.tld account, then update a database table in which you save the ticket number: http://php.net/manual/en/book.imap.php If you also need to parse the message use Mailparse: http://www.php.net/manual/en/book.mailparse.php **Note:** you have to compile PHP with IMAP support, or if in Debian & co. install … | |
Re: The error is generated by line `15`: [5] //$img = $session_data['profile_picture']; ... [15] $data['profile_picture']=array('profile_picture'=>$img); You're using an undefined variable $img, which is commented at line `5`. | |
Re: Hi, use backups or, if enabled, the binary log: * https://dev.mysql.com/doc/refman/5.7/en/binary-log.html * https://dev.mysql.com/doc/refman/5.7/en/point-in-time-recovery.html * https://dev.mysql.com/doc/refman/5.7/en/backup-and-recovery.html | |
Re: Hi, the error states that the included file is not found in the current path, I see your **index.php** is under `/homessd/` while you're trying to include **startup.php** from `/home/`, so change it to `/homessd/` and it should work fine. | |
Re: Hi, the issue is at line `12`: $next_program_times = $program_times + 1; If $program_times has value of `3:00 PM` which is a string and you add an integer, you get only `4`, so PM does not exists anymore, nor the formatting. To keep the current format, instead, you have to … | |
Re: Hi! > Notice: Undefined index: engraving in /path/httpdocs/store/cart.php on line 13 error This usually happens when you try to access an array index key that does not exists, for example: $a = array( 'apple' => 'fuji', 'orange' => 'vanilla' ); echo $a['apple']; echo $a['coconut']; # will emit a notice because … | |
Re: Hi, Slim Framework supports composer so you can get a pagination library from [packagist.org](https://packagist.org/) or you write it by your self. | |
Re: Hi, since you set $Filter on line 5 the condition on line 7 will never verify, so you could remove it. What you should do is to verify if the GET attribute is set and valid, do: $url = filter_input(INPUT_GET, 'url', FILTER_VALIDATE_URL); Then replace the IF condition at line 7 … | |
Re: Hi, yes you can: * https://developer.paypal.com/docs/classic/api/adaptive-payments/Refund_API_Operation/ the above link refers to the Classic API, for the REST API check the *Sale Transactions* and the *Refunds* sections at: * https://developer.paypal.com/docs/api/ | |
Re: Hi, use DateTime and DateInterval, like this: <?php $time = '05:00 PM'; $dt = (new Datetime($time))->add(new DateInterval('PT5H'))->format('g:i A'); echo $dt; # outputs 10:00 PM For more information check the documentation. Docs about DateTime: * http://php.net/manual/en/class.datetime.php * http://php.net/manual/en/datetime.add.php * *DateTime format:* http://php.net/manual/en/datetime.createfromformat.php Docs about DateInterval: * http://php.net/manual/en/class.dateinterval.php * *DateInterval format:* http://php.net/manual/en/dateinterval.format.php … | |
Re: Hi, data loss means a file corruption because the server misses some packets from the transmission (for example caused by a timeout), in this case the uploaded file will result corrupted and the server will return an error because the received length is not the same of what was declared … | |
Re: Hi, you have to perform a select query inside the methods `isUserExistscustomer()` and `$this->isUserExistsmobile()` and return boolean TRUE or FALSE. For example: public function isUserExistsmobile($mobile_no) { $stmt = $this->conn->prepare("SELECT id FROM np_system_users WHERE customer_mobileno = ?"); $stmt->bind_param('s', $mobile_no); $stmt->execute(); $stmt->store_result(); return $stmt->num_rows > 0 ? TRUE : FALSE; } Do … | |
Re: Use your editor to find the string `product_id`. Looking at your pasted code I don't see it, but probably somewhere you have `$_POST['product_id']` instead of `$_POST['productid']`, or set by another array. To avoid these kind of problems use `array_key_exists('key_to_verify', $array)`: * http://php.net/array-key-exists | |
Re: Hi! It happens because you are not appending the file to the body of the request, if you open netcat on `localhost:8005`: nc -l localhost 8005 And change the $url to: $url = 'http://localhost:8005/'; You can see what is sent by curl. In your case this is what is sent: … | |
Re: Hi, instead of: while($_SESSION['application']['food']) which acts as an endless loop, because it's equal to `while(TRUE)`, write: foreach($_SESSION['application']['food'] as $food) { mysql_query("INSERT INTO tbl_user_detail (food, user_id) VALUES ('".$food."', '".$user_id."')") or die(mysql_error()); } Or better: $sql = 'INSERT INTO tbl_user_detail (food, user_id) VALUES'; foreach($_SESSION['application']['food'] as $food) { $values[] = "($food, $user_id)"; } … | |
Re: Add a javascript event listener, when the form changes submit the query through an AJAX request. To make it work correctly separate the query script so that it returns only the data you want to display in the page. | |
Re: You're looping the $_POST array, instead you have to loop the $_FILES array. Follow the documentation and the comments at this page: * http://php.net/manual/en/features.file-upload.multiple.php If still in doubt create a dummy upload script and place this: <?php echo "<p>$_POST array:</p>"; echo "<pre>" . print_r($_POST) . "</pre>"; echo "<p>$_FILES array:</p>"; echo … | |
Re: Hi, you have to use the comparison operator `==`, at the moment you are using the assignment operator `=`. ![]() | |
![]() | Re: Hi, which version are you using? With version 3 you can use `set_checkbox()` instead of `set_value()`. In this case write something like: <label for="sex_1"> <?php echo form_radio('sex', 1, set_checkbox('sex', 1), "id='sex_1'"); ?> male </label> <label for="sex_2"> <?php echo form_radio('sex', 2, set_checkbox('sex', 2), "id='sex_2'"); ?> female </label> Docs: http://www.codeigniter.com/user_guide/helpers/form_helper.html#set_checkbox |
Re: Just an add: maybe this is something you don't need at this stage, but regarding the database consider also PostgreSQL which has a really great support for geocoding & co.: http://postgis.net/ ![]() | |
Re: In addition: maybe you could use cipher.exe, read here: * https://technet.microsoft.com/en-us/library/bb490878.aspx | |
Re: You have to add the appropriate permission in order to post to the timeline, this is done by appending the `scope` parameter to the login link, in your case the value to use should be `publish_actions`, but check the documentation to apply the correct permissions: * https://developers.facebook.com/docs/facebook-login/permissions/v2.4 Read it carefully, … | |
Re: The model is returning an object, which is passed to `$this->user_data` array with the index key **result** so, in the view file write: foreach($result as $row) { echo $row->id . ' ' . $row->names; } | |
![]() | Re: Hi all, I still haven't tried PHPStorm as I usually prefer simple editors, among these I'm really happy with Sublime, right now. |
Re: Hi, it does not work because of the exception at line 17 of your log: OW Debug - Exception Message: There is no active plugin with key `meet` File: /home/jktempla/public_html/fabcouples/ow_core/plugin_manager.php Line: 86 If you go to [this specific file](https://github.com/oxwall/oxwall/blob/master/ow_core/plugin_manager.php#L86), you find: public function getPlugin( $key ) { if ( !array_key_exists(mb_strtolower(trim($key)), … | |
Re: Hi, the first argument of `set_message()` must match the rule name, i.e. the callback, not the field name, so change it to: $this->form_validation->set_message('check_captcha', 'Your code did not match!'); You can read more about this in the guide, after the note about sprintf: * http://www.codeigniter.com/user_guide/libraries/form_validation.html#setting-error-messages | |
Re: Use the Form helper, read the documentation for more information: * http://www.codeigniter.com/user_guide/helpers/form_helper.html#form_dropdown If still in doubt, show the view code. | |
Re: Hi! If you can, place it outside the public_html directory, so it cannot be executed by requesting the file through the web. Otherwise write this in top of the script: <?php if(php_sapi_name() != 'cli') { header("HTTP/1.1 403 Forbidden"); die('Error: 403 Forbidden.'); } | |
Re: Hi, maybe one of the hard drive sectors in which the file was registered got corrupted, you could try to fix the issues through scandisk. | |
Re: Try to add backticks to the `###` column. MySQL for unquoted column names expects: 1. basic Latin letters, digits 0-9, dollar, underscore 2. Unicode Extended: U+0080 .. U+FFFF The character `#` is U+0023 which falls in the quoted range: * https://dev.mysql.com/doc/refman/5.6/en/identifiers.html So, write: $sql = "INSERT INTO result_sec (exe, `###`, … | |
Re: If you use AJAX yes, you can, because it would be managed by a remote PHP script and sessions. But to get more help explain better your goal. | |
Re: Are you sure you're not missing some closing parentheses in the first block? I don't see how both rules could apply when the second range is not reached by your resolution. By the way, is this portrait oriented? |
The End.