2,113 Posted Topics
Re: Try this: <?php $url = 'https://twitter.com/darknille/status/355651101657280512'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_VERBOSE, FALSE); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_NOBODY, true); curl_exec($ch); if(!curl_errno($ch)) { $info = curl_getinfo($ch); echo $intReturnCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); switch($intReturnCode) { case 200: case 302: case 304: echo "true"; break; default: echo "false"; … | |
Re: If you add an equal sign it will work, but at 18.06 will change to default again. Is this the expected behaviour? else if (strtotime($current_time) >= (strtotime($serving_time) - 3900 )) | |
Re: Replace `<?` with `<?php` from line 44 to 47. Note also that short tags are enabled by your **php.ini** config - http://php.net/manual/en/language.basic-syntax.phptags.php | |
Re: Change last line to: echo ${$mystring}[0]; And it will work, otherwise it will refer to the name of the string `myarray`. | |
Re: You should disable `system()` and similar functions. At the moment I can list root of the server. Also consider to run this into a [jail root](https://help.ubuntu.com/community/DebootstrapChroot). | |
Re: Hello, please provide the queries you're trying to perform, table structures and an example of data, at the moment (at least for me) it's difficult to understand the issue. | |
Re: Check this: http://www.php.net/manual/en/features.file-upload.post-method.php | |
![]() | Re: It's a nice restyle, but I would really like a bit more contrast on text. ![]() |
Re: Check the Debian documentation: http://www.debian.org/doc/ It's quite good. | |
Re: When you write `"path": "/D/projektai/glab"` the segment `/D/` stands for `D:\`? I see also a call to `/tmp/` but this is a *nix path, not windows; if you have a tmp folder, for example in `C:`, you will have to set: `C:/tmp/xdebug.log` but check with documentation, in Windows I'm not … | |
Re: Set an absolute path, absolute to the system not to the web root, so change this: $pdfFilePath = "../uploads/$filename"; to: $pdfFilePath = "c:/mysite/uploads/$filename"; | |
Re: Inside `$data2` change: 'name' >= 'pw', to: 'name' => 'pw', The same goes for `value` in the same array and `type` in `$data3`. By the way, this is Daniweb not SO. | |
Re: I think he is referring to an in-site notification system, as google-plus or fb: when a watched article is updated the subscribed users get an event notification, so they can click on the icon, select the thread and jump to the discussion. | |
Re: I think Common.php cannot be extended as the other core files because it is statically loaded by `/system/core/CodeIgniter.php`: /* * ------------------------------------------------------ * Load the global functions * ------------------------------------------------------ */ require(BASEPATH.'core/Common.php'); Before checking `system/core/CodeIgniter.php`, I've also tried to overwrite that function through hooks, but obviously it doesn't work, even setting `pre_system` … ![]() | |
Re: Can you show the .htaccess code? Apache offers three different modules: * mod_auth * mod_auth_digest * mod_aut_dbm are these enabled? Have you used **htpasswd** or **htdigest** to generate the password file? You wrote about **htaccess** command but this does not exists. For more information check this: http://httpd.apache.org/docs/2.0/howto/auth.html To "move" the … | |
Re: First argument of `where()` method is a string, at the moment it seems to be a constant, so change them to: $this->db->where('Interior_house_id', $Interior_house_id); $this->db->where('Interior_room_id', $Interior_room_id); | |
Re: If you have a static IP you can add it as `allow` rule: <Limit GET POST PUT> Options -Indexes Order allow,deny Deny from all Allow from xxx.xxx.xxx.xxx </Limit> Otherwise you can use the Authenticantion modules: http://httpd.apache.org/docs/2.0/howto/auth.html | |
Re: `$txt2` is considered a string, so you have to use quotes: "SELECT * FROM table FIND_IN_SET('$txt2', field)" And it should work. | |
Re: To me it seems to work fine: $v0 = 3; $v1 = 5; $v2 = 7; echo min( max(($v0 - $v1), 0), $v2); `$v0 - $v1 = -2` so max() between `-2` and `0` is `0`, min() result will be `0`, inverting **$v0** and **$v1** will output `2` as expected. … | |
Re: Try: $this->db->where('active',1)->order_by('date_added','desc')->limit($num, $start)->get('posts'); When selecting all the fields, the `select()` method is not needed. | |
Re: Replace the quotes that surrounds the field name `'town'` with back ticks, so this: $rs=mysql_query("select CommercialEnterprise_Email from commercialenterprise WHERE 'town' = 'Killkee'"); Becomes: $rs=mysql_query("select CommercialEnterprise_Email from commercialenterprise WHERE `town` = 'Killkee'"); If you still get errors add `mysql_error()`: http://php.net/manual/en/function.mysql-error.php | |
Re: Change the wrapping quotes to double quotes: $old = array(' ', '/', 'amp;', "'"); Or escape the quote: $old = array(' ', '/', 'amp;', '''); and it should work. | |
Re: The format for PWS files is one word per line, as you done. In Ubuntu the dictionaries used by **pspell** are in `/usr/lib/aspell/`, but you can use this command from a terminal to read the configuration and retrieve the correct path: aspell config |grep -i data-dir Regarding the replacement files: … | |
Re: Unfortunately this is a [restriction:](http://dev.mysql.com/doc/refman/5.0/en/view-restrictions.html) > Subqueries cannot be used in the FROM clause of a view. But you could try with procedures, first you install the tables `range_numbers` and `range_dates`: delimiter // drop procedure if exists range_tables// create procedure `range_tables`() language sql deterministic sql security definer BEGIN DROP TABLE … | |
Re: As side note: Tor changes the IP every 10 minutes or so by default. But the users can force the change at each request. In this particular case there could be a problem with the matching IPs. ![]() | |
Re: Provide the code, or at least an example of what is not working for you, it could be a problem of headers. Also have you checked sendmail error log? Does the sender email exists? Do you receive any responses from mail daemons? | |
Re: In addition to previous notes, the direction of the text depends on the HTML [`dir` attribute](http://www.w3.org/TR/html401/struct/dirlang.html#h-8.2), an example of multilanguage page: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>sample arabic language</title> </head> <body> <p lang="ar" dir="rtl">Ù…Ø±ØØ¨Ø§</p> <p>hello</p> </body> </html> If your page is not mixed and you have only Arabic, … | |
Re: Keep in mind that **$_POST** works as an array, so if you want to use one of the keys, you have to write: $_POST['password'] not `$_POST[password]` which lacks of quotes. The same applies to `$_POST[sbg]`. For this reason you are probably getting `d41d8cd98f00b204e9800998ecf8427e` from: $pass=md5($_POST[password]); Because it appears as a … | |
Re: If you have access to the mail directory you can use Plancake library: https://github.com/plancake/official-library-php-email-parser It will parse the files into an object, from there you can store it into the database. If you don't have direct access, you may want to add IMAP library to get the messages: http://www.php.net/manual/en/ref.imap.php | |
Re: Check the API of tumblr: http://www.tumblr.com/docs/en/api/v2#blog-info In the section Blog Info there are many methods to retrieve the information you're looking for. | |
Re: Regarding the date try: date('d-m-Y', mktime(0, 0, 0, date("m"), date("d") + $_POST['exdays'], date("Y"))); Concerning the second question, you can use [`json_encode()`](http://php.net/manual/en/function.json-encode.php) to convert the array to a string and so, you can save it as `varchar` or `text` type, otherwise you need a `blob` type. __Edit__ Sorry Webville, I just … | |
Re: Move these: $image_value = array(); $description_value = array(); outside the while statement, otherwise the array resets after each loop. Also you can avoid the use of `array_push()` by writing: while($row = mysql_fetch_array($result)) { $image_value[] = $row['image_id']; $description_value[] = $row['description']; } | |
Re: If you can execute a shell, search the library: find / -name *pdo*so 2>/dev/null the `2>/dev/null` segment will suppress the errors (usually due to permessions), you can remove it if you want to get all the output. After you save the config file remember to reload the server. | |
Re: Check this thread: http://www.daniweb.com/web-development/php/threads/455388/display-ip-address-of-the-systems-on-a-lan-using-php | |
Re: Basically: mysql_query('INSERT QUERY HERE'); $codCliente = mysql_insert_id(); Here's the link to the manual: http://php.net/manual/en/function.mysql-insert-id.php | |
Re: If you're trying to insert data then change the above query to: "INSERT INTO `tablename` (`image_name`) values('$img_file')" This will create a new entry in the table. While if you want to update an existing row, for example the row with id 1, use an update statement: "UPDATE `tablename` SET `image_name` … | |
Re: If you still have Ubuntu try to follow this method: http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-ubuntu Otherwise try the suggested method on BackTrack website: * http://www.backtrack-linux.org/tutorials/usb-live-install/ * http://www.backtrack-linux.org/wiki/index.php/UNetbootin_USB_Installer | |
Re: Use reload: sudo service apache reload in practice Apache will perform a graceful restart, it is the same of running: apachectl -k graceful it means that will finish to serve the current requests before restarting. For more information and options check: http://httpd.apache.org/docs/2.2/en/stopping.html | |
Re: Check also `parse_url()` it will return an array of the url components, included the hashmark `#` fragment: * http://php.net/manual/en/function.parse-url.php Bye. | |
Re: Consider **SwiftMailer** library, it works fine and [once installed](http://swiftmailer.org/docs/installing.html) it's easy to use: * http://swiftmailer.org/docs/sending.html In particular check the send method and the batch mode at the end of the page. The **[mail()](http://php.net/manual/en/function.mail.php)** function is not the best choice for large sets because it is resource expensive and it doesn't … | |
Re: You could use `file_put_contents()` to save the array to the text files: file_put_contents('questions.txt', json_encode($questions)); Then use `file_get_contents()` to get the arrays from the files and use `array_combine()` to match them. As suggestion use `json_encode()` to save data to txt files, and then just run this to retrieve: $questions = json_decode(file_get_contents('questions.txt'),TRUE); … | |
Re: The difference is that if **bar** is null `isset()` will return FALSE, while `array_key_exists()` will still return TRUE: $foo['bar'] = NULL; echo isset($foo['bar']) ? 'true':'false'; echo array_key_exists('bar',$foo) ? 'true':'false'; So it depends on your intentions. | |
Re: Line 32: <option value="<?php echo $ho('interior_house_id');?>"><?php echo $ho['interior_house_desc'];?></option> Change `$ho('interior_house_id')` to `$ho['interior_house_id']` and it should work. Also I suggest you to use $this->input->post() instead of $_POST since it sanitized by the framework (if `$config['global_xss_filtering'] = TRUE;`). Bye! | |
Re: Hi, take a look at Google Custom Search API: https://developers.google.com/custom-search/v1/overview Once you get results you can scan the links in search of [microformats](http://microformats.org/wiki/hcard) or metadata. To do that you will need a **microformat parser** or something like [`get_meta_tags()`](http://php.net/manual/en/function.get-meta-tags.php) for metadata. Then, if you want more results or compare data, you … | |
Re: Hi, in order to help we need details. Post some error codes or at least the code block which seems to create the problem. Also check server, database and PHP errors logs. | |
#This is for Laravel 3.*# ## Hello, ## With this snippet I'm providing a simple way to automatically filter `Input::get()` and `Input::old()`. To achieve this result we need to make few changes: * extend Input and Redirect classes by creating new files in `application/libraries/`, the files are: **input.php** and **redirect.php**; … | |
Re: You can use a recursive function which checks if the value of the pair `$key => $value` is an array, in this case it loops again, an example: <?php $food = array( 'Healthy' => array('Salad','Rice','Vegtables' => array('Tomatto','Onion')), 'UnHealthy' => array('pasta', 'Vegetables' =>array('potatto', 'Corn'))); function recursive_loop($array) { foreach($array as $key => … ![]() | |
Re: It seems `send_mail()` function is receiving a malformed email address, check the submitted array **$info** to see what is wrong. By the way, Swiftmailer requires at least four parameters in order to work: setTo(), setFrom(), setSubject() and setBody(). Check documentation for more information: http://swiftmailer.org/docs/sending.html | |
Re: Hi, If the directory `down/` is not directly accessible by web use `$this->input->server('DOCUMENT_ROOT')` instead of `base_url()`. Also, use `file_exists()` to be sure about the requested file and `pathinfo()` to grab the filename from `$this->input->post('filedown')`, otherwise a user can execute `../../../random_file`: $filedown = pathinfo($this->input->post('filedown'),PATHINFO_BASENAME); $datas = $this->input->server('DOCUMENT_ROOT').'/down/'.$filedown; if(file_exists($datas)) { force_download($filedown, $datas); … |
The End.