kosmro's Profile User Rating: -----

Reputation: 3 Apprentice
Group:
Active Members
Active Posts:
63 (0.07 per day)
Joined:
07-March 12
Profile Views:
1,036
Last Active:
User is offline Aug 14 2014 05:56 PM
Currently:
Offline

Previous Fields

Country:
AU
OS Preference:
Mac
Favorite Browser:
Who Cares
Favorite Processor:
PowerPC
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
0
Icon   kosmro has not set their status

Posts I've Made

  1. In Topic: Image Uploading Process Forbidden

    Posted 14 Aug 2014

    I have stated that it is receiving a 403 error from the server, so it's not a missing permission in the manifest - that would just crash.

    I have narrowed it down to my webhost now. I have sent them an email and will have to see what they have done to my server :/
  2. In Topic: Why does mcrypt return badly in HTML forms

    Posted 27 Jun 2014

    It worked!

    How irritating that I missed that minor (yet important) detail.

    I suppose therefore the encryption I'm using has a character limit? (I couldn't find this bit of info).


    Thanks so much for your help!
    Really appreciate it :D
  3. In Topic: PHP mysqli statement now not running?

    Posted 30 Mar 2014

    I have solved it!
    After way to many hours of blind stumbling, I figured out where the issue was.

    What I did, is I removed the
    header("Location:thankyou.php");
    
    , then I added print lines after each section - one when if statement true and starts, one when parameters binded, one when stmt executed, etc.
    Then I also added the following at line 27
    else{print("IF STATEMENT FAILED");}
    

    When I ran the code, would you believe it! I got the message "IF STATEMENT FAILED"...so the prepared statement was failing, which explains why I wasn't getting any errors like ArtificialSoldier suggested.

    To solve the issue, I removed some of the values from the prepared statement, and hallelujah! It worked :)


    For those coming across this topic, the tweaks made to the code I have put below.

    <?php
    $mysqli = new mysqli('localhost', 'xxx', 'xxx', 'xxx');
    
       if(mysqli_connect_errno()) {
          printf("Connect failed: %s\n", mysqli_connect_error());
        exit();
       }
       
    	//variables
    	$fnm = $_POST["fnameemail"];
    	$lnm = $_POST["lnameemail"];
    	$eml = $_POST["addemail"];
    	$msgsbj = $_POST["msgsubject"];
    	$msgcont = nl2br($_POST["messageemail"]);
       
       if ($stmt = $mysqli->prepare("INSERT INTO tablename(id, fname, lname, qrymail, subject, message, timesub, reponded) VALUES(null, ?, ?, ?, ?, ?, NOW(), 'N')")) {
       
       /* Bind parameters
             s - string, b - blob, i - int, etc */
          $stmt->bind_param("sssss", $fnm, $lnm, $eml, $msgsbj, $msgcont);
    	
    	/* Execute it */
        $stmt->execute();
    
    	/* Close statement */
        $stmt->close();
       }
    
       /* Close connection */
       $mysqli->close();
    	
    	header("Location:thankyou.php");
    ?>
    


    In short, I removed the variables which weren't being used in this statement, so they will default to null.

    Thanks for all your replies!
    Regards,
    -kosmro-
  4. In Topic: PHP mysqli statement now not running?

    Posted 13 Mar 2014

    Absolutely nothing happens. There is no entry added, and the script then goes straight to the header location.

    The PHP Version is 5.3.27
    The Apache Version is 2.2.26

    And yes, I have made sure that the permissions are correct.
  5. In Topic: Android 4 causes crashing, but not Android 2.3?

    Posted 13 Feb 2014

    I discovered the problem. As it turns out, yes the issue occurred when the code I posted fires, but the issue was actually in the referenced bit of code. For some bizarre reason, I put all the code for UI updates, HTTP requests, JSON parseing, etc, under an AsyncTask, but I had then proceeded to run that code on the UI Thread. I found that while performance can be a little choppy at times, it worked fine under Android 2.3.2, but the Newer Android versions imposed a restriction, preventing apps from doing too much work on the UI Thread, which results in any UI tasks having to halt, or wait...which is not good anyway, so fair enough.

    I have now altered my code so that the runOnUiThread() section is now under the Post execution section, and it runs UI updates.

    It was strange, because I only did this in a particular section of the code, but no where else in the app...oh well! Fixed now. And the above explanation serves for those who stumble upon here with the same issues (maybe).

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
December 4
Gender:
Years Programming:
2
Programming Languages:
JAVA, PHP, MySQL, HTML, CSS

Contact Information

E-mail:
Click here to e-mail me
Skype:
Skype  robert.kosmac

Friends

kosmro hasn't added any friends yet.

Comments

kosmro has no profile comments yet. Why not say hello?