• Member Avatar for cereal
    cereal

    Replied To a Post in How to retrieve a single row

    The function `mysql_result()` returns one of the rows of the result set, so if you get a total of 10 rows, you can decide to get one of those: $query …
  • Member Avatar for cereal
    cereal

    Gave Reputation to broj1 in how to create an application with different users

    First: do not use GET for the form method, use POST. When using GET, passwords will be visible in the URL bar of the browser and will get written in …
  • Member Avatar for cereal
    cereal

    Replied To a Post in diff in arrays

    Hi, the function `array_diff()` will return empty: 1. if the first array is smaller then the second; 2. and if the elements in the first array range are the same …
  • Member Avatar for cereal
    cereal

    Replied To a Post in How to encrypt/decrypt in php?

    Hi, just a note: the `mcrypt_ecb()` function is deprecated since PHP 5.5, it means this is going to be removed. You should use `mcrypt_generic()`and `mdecrypt_generic()` as explained in the documentation: …
  • Member Avatar for cereal
    cereal

    Gave Reputation to deceptikon in wojciech discussion

    Ooh, forum drama. *grabs popcorn*
  • Member Avatar for cereal
    cereal

    Replied To a Post in sorting array into variable

    Hi all, @slowlearner2010 just for the log, it seems you don't need the `array_push()` neither the loop, use `trim()` to remove extra spaces and then use `implode()`, then you should …
  • Member Avatar for cereal
    cereal

    Replied To a Post in null2unknown

    Hi, the function `null2unknown()` is not a PHP function, it's a **user defined function** so there must be a file, included by payment_gateway.php or by a main file, which defines …
  • Member Avatar for cereal
    cereal

    Replied To a Post in help with error in script

    Hi! The problem is caused by the quotes, you need to escape them correctly, try: $pm_ui = '<button id="pmBtn" onclick="postPm(\''.$u.'\',\''.$log_username.'\',\'pmsubject\',\'pmtext\')">Send</button>'; In your case you're including PHP variables and your using …
  • Member Avatar for cereal
    cereal

    Replied To a Post in problem with inserting data into the database

    It happens because you're missing the quote for the previous values, this: ('60', 'Ng\'wagindu), should be: ('60', 'Ng\'wagindu'),
  • Member Avatar for cereal
    cereal

    Replied To a Post in File upload

    Don't rely on the value returned by the $_FILES array because is set by the client, which can be altered or simply different from what expected. For example some executives …
  • Member Avatar for cereal
    cereal

    Replied To a Post in File upload setting

    Hi! Change also the value of `post_max_size`, this should be equal or larger than `upload_max_filesize`. Docs: http://php.net/manual/en/ini.core.php#ini.post-max-size
  • Member Avatar for cereal
    cereal

    Replied To a Post in How to get visitor IP if using ip of the server

    Hi, the code seems fine to me. But you can try this function which extends a bit the check: function get_ip_address() { $array = array( 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Cannot cash out reward points

    Hi there, @Dave consider that points generated in March and April 2015 (in the range of 45 days if I'm not mistaken) are only estimated points and need to be …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Php simple error

    **@phoenix** There are some errors here: echo work $sql ="UPDATE tea SET name = ' 8req' WHERE id = '3 ' "or die ("cant update" . mysql_error()); The echo statement …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Getimagesize vs File_get_contents

    The script is fine enough, I would not use the original name to save the file, because this can overwrite existing images, I would assign to each image an UUID. …
  • Member Avatar for cereal
    cereal

    Began Watching Getimagesize vs File_get_contents

    I am trying to creating a website, i want to know which of these function is more secure to upload the image on database ? 1.) getimagesize 2.)get_file_contents 3.)cURL Thanks …
  • Member Avatar for cereal
    cereal

    Began Watching adding a filter option to table

    How can I add a filter option to be displayed only when the table displays more than 25 results. So when the table displays less than 25 results, the filter …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Getimagesize vs File_get_contents

    Hi, `getimagesize()` is a function to evaluate the pixels of an image, the type and the attibutes (a stringed version of height and width), it returns an array. For example: …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Zip Code Field not being Saved to DB Correctly

    Hi, if you're using a prepared statement to insert the data, then submit the zipcode as a string, not as integer, this should solve the issue for you. The table …
  • Member Avatar for cereal
    cereal

    Replied To a Post in PHP echo class in img

    Hi! In addition to Dave's suggestion, having a div between rows is not really correct: <table> <tr> <td> <div class="img"> <tr> <td><img src="..." /> </div> <tr> <td> </table> Do: <table> …
  • Member Avatar for cereal
    cereal

    Replied To a Post in When I trying but not getting totalapps. I got NAN error

    Hi, it seems fine to me, but you can use directly the object created by the `diff()` method, without formatting the output, as [in my previous example](https://www.daniweb.com/web-development/php/threads/493999/how-to-get-differenc-in-hours-and-minutes-#post2160993): $minutes = 0; …
  • Member Avatar for cereal
    cereal

    Gave Reputation to JorgeM in Using a JavaScript Spinner During an Ajax Request

    When users interact with your web page and processes, it is important to provide them with continuous feedback. Without the feedback, a user is left wondering if you page is …
  • Member Avatar for cereal
    cereal

    Replied To a Post in How to get Differenc in hours and minutes.

    Hi, use the DateTime library, in particular look at the `diff()` method. For example: <?php $one = '09:30AM'; $two = '06:30PM'; $dtime_1 = new Datetime($one); $dtime_2 = new Datetime($two); $diff …
  • Member Avatar for cereal
    cereal

    Began Watching MailChimp API Integration

    Good Morning All, I've worn myself out looking for the solution to integrating MailChimp APIs into my PHP scripts. Is there anyone in here that is familiar with doing that? …
  • Member Avatar for cereal
    cereal

    Began Watching check whether one date range is between another date range

    Hello, I want to check whether one given date range is falling under another range or not. Is there function for this? Because when I am calculating this using To …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Tab error

    **@Wojciech_1** with *here* I mean here in Daniweb ;D
  • Member Avatar for cereal
    cereal

    Replied To a Post in Tab error

    > Maybe Shift Tab? It seems free, at least in Ubuntu. Well, I didn't thought it was already in use here, to move the code blocks: TAB forward, Shift TAB …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Code Embedding in a Post?

    To paste code I usually place the cursor in a new line and then I press TAB once, for example: /** * Sign Out * @return void */ public function …
  • Member Avatar for cereal
    cereal

    Began Watching MySQLi & Escape Strings

    Hello. I am beginning the process of coverting all of my MySQL to MySQLi. I have been doing much research on this but find it a bit confusing. I have …
  • Member Avatar for cereal
    cereal

    Began Watching Aattributes

    Why lowsrc attribute used in Img tag???
  • Member Avatar for cereal
    cereal

    Replied To a Post in PHP Mail script

    Hi all, James you can send an email to Gmail SMTP, you don't need sendmail to do this because you're going to connect directly to the SMTP server. Check this …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Tab error

    @Wojciech_1 `Ctrl Tab` focuses the next tab, `Ctrl Shift Tab` the previous.
  • Member Avatar for cereal
    cereal

    Replied To a Post in Tab error

    > I just tried Ctrl+tab and it jumped to the next browser tab. Same here on Chrome. In Ubuntu `Alt Tab` is used to switch the windows in the same …
  • Member Avatar for cereal
    cereal

    Gave Reputation to mattster in Monopoly Board Game (CSS3+LESS)

    I was looking for something similar myself a few days ago, and found the odd example of a CSS based monopoly-type game board. To be honest, they were all shabby …
  • Member Avatar for cereal
    cereal

    Began Watching Text on Opacity background

    Sir I have these codes <html> <head> <title>untitled</title> <style type="text/css"> #box5{ margin:10px; width:250px; height:250px; border:1px solid green; overflow:auto; float:left; background-size:50%; background: url(https://developer.mozilla.org/media/img/mdn-logo.png); background-repeat:no-repeat; background-position:center; padding:20px; opacity: 0.2; } #box5 p{ …
  • Member Avatar for cereal
    cereal

    Stopped Watching check if email address is correct without sending email?

    hi all, i m working on the email validation i ve to check email id either it is correct or not but i cannt send mail on them. ie when …
  • Member Avatar for cereal
    cereal

    Began Watching check if email address is correct without sending email?

    hi all, i m working on the email validation i ve to check email id either it is correct or not but i cannt send mail on them. ie when …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Text on Opacity background

    Sorry for the update, the live example link for method #2 was wrong: * http://jsfiddle.net/1py8oh5c/
  • Member Avatar for cereal
    cereal

    Replied To a Post in Text on Opacity background

    Hi, create a container for #box5, then you can use two methods. #Method 1# Move the text outside the opaque element and move it over, something like this: <div id="box"> …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Error comparing IF statements

    Also **@Nilesh_4** Hi! In PHP you can use both. But there's to say that `&&` has an higher precedence than `AND`, which defines how the conditions are grouped. So for …
  • Member Avatar for cereal
    cereal

    Gave Reputation to Reverend Jim in What Music Do People Like?

    >I'm always in search for new music: Try "Nothing Above My Shoulders But the Evening" by Ray Lynch and "Waterstation" by Tim Clement.
  • Member Avatar for cereal
    cereal

    Replied To a Post in Error comparing IF statements

    Works fine for me, try to trim the input, if you get a space at the beginning or at the end of the string then the comparison will fail, so …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Error comparing IF statements

    In addition, there is a small typo with quotes: $_POST['accommodation"] Use single quotes or double quotes, not both together: $_POST['accommodation'] # or $_POST["accommodation"] Bye!
  • Member Avatar for cereal
    cereal

    Gave Reputation to happygeek in Six Nations

    Yesterday was epic. I was glued to rubgy on the TV for seven hours and it felt like just a couple. Exciting doesn't really do it justice. You know what, …
  • Member Avatar for cereal
    cereal

    Replied To a Post in What Music Do People Like?

    Hi all, music for me is something special, I'm always in search for new music: new to my ears. I listen primarly Bach: search for Goldberg Variations or the Toccatas …
  • Member Avatar for cereal
    cereal

    Gave Reputation to diafol in Simple encode / decode integer to small string

    `is_int` is a problem with strings. I use the validate functions for data from forms. if($var = filter_var($intString, FILTER_VALIDATE_INT))...
  • Member Avatar for cereal
    cereal

    Began Watching Google Go OOP

    So it seems google's go is changing the programming landscape, well there probably were other languages out there before but the google-sphere seems to deliver more clout, people take notice. …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Cutenews 202 search installation

    Ok, by writing `include('cutenews/search.php');` you define the position of the search script in relation with the calling script, so if you have: /calling.php /cutenews/search.php it will work, but if this …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Cutenews 202 search installation

    Hi, are you accessing the website through the IP? I ask this because the function that checks the path is this: // Since 2.0: security reason function check_direct_including($incln) { global …
  • Member Avatar for cereal
    cereal

    Replied To a Post in LOAD XML LOCAL INFILE

    Hi, you need at least MySQL 5.1.5 to import XML, otherwise you have to check if a UDF (user defined function) was developed to support old versions. In the documentation …

The End.