Jump to content

Mudsaf

Members
  • Posts

    462
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Mudsaf

  1. Have you tried this?

    <table border="1" width="100%"> <!-- Example 100% width, border is for visibility reasons you can remove. -->    <tr>         <td width="50%" style="text-align:left;"> <!-- Aligns text left (Prob not needed by default) -->               <div style="background-color:#CCC; display:inline-blcok;">Div 1</div> <!-- Background set for display reasons, remove if want. -->         </td>         <td  width="50%" style="text-align:center;"> <!-- Centers the div element inside -->               <div style="background-color:#CCC; width:200px; text-align:left; display:inline-block;">Div 2</div> <!-- Background for display reasons, text-aligned for left, display inline-block so text-align will apply. -->         </td>    </tr></table>

    Either set width to whole table or td's.

  2. Hello, i'm wondering how to make same method at MySQLi prepared what was in MySQL (code below).

    $query = "SELECT * FROM data";$result = mysql_query($query);while ($row = mysql_fetch_array($result)) {echo $row['MyData'];}

    I've tried this so far.

    $query_gls = "<select query>"; //You wont need to know thisif ($stmt = $con->prepare($query_gls)) {$stmt->bind_param("s", <My post variable>); //You wont need to know the post variable either.$stmt->execute();if($stmt->fetch()) {/* Im lost at this part */} else {die("MySQLi Failure");}}
  3. Well ill try to keep it at minimum, thanks for info. With 2x process i can track if user login logout. I have actually 10x10x10 (1000) options i could make with combinations on one page. :)

     

    Example Process 2

    0 = Visit1 = Login2 = Logout3 = Form post success4 = Form post failure5 = MySQL error //Other than connection//.. and so on, ofc i have page data + user ip + other stuff up also.
  4. So basically i should do my logging with example TinyINT maxlength 3?

    ColumnsID (INT, AI, PRIMARY) | PROCESS (TINYINT 3, NOT NULL) | PROCESS2 (TINYINT3, NOT NULL) | IP (VARCHAR 15)1 | 1 | 1 | 127.0.0.1//Example ID, <page>, <what happened there>, <ip-address>
  5. Hello, i'm wondering do you guys log user data what they do.

     

    • New user registerations
    • Logins & Logouts
    • Page visits

    and other kind of form post information that the user does. Example I tried to make logging system & having over 70000 logs there (98% prob page refreshes). Also what mehod? .txt file or SQL-table?

  6. Well i'm wondering what is method in MySQLi to check if user exists in database like in MySQL it was below.

    $result = mysql_query("SELECT * FROM accounts WHERE username = '$username' AND password = '$password'");$rows = mysql_num_rows($result);if ($rows == 1) {echo "User data found.";}

    The SQL query worked with data.

    SELECT * FROM ms_accounts WHERE userName = ? AND userPass = ?
    //This fixed my problemif($stmt->fetch()) {echo "SUCCESS";} else {echo "WRONG UNAME OR PW";}
  7. Year I'm sure those are correct data.

    $rows = $stmt->num_rows(); //Returned 0 aswell while data was correct @ Database.//Taste my code :/if ($stmt = $con->prepare("SELECT userName FROM ms_accounts WHERE userName = ? AND userPass = ?")) {$username = $_POST['username'];$password = md5($_POST['password']);$stmt->bind_param('ss', $username, $password);$stmt->execute();$stmt->fetch();$rows = $stmt->num_rows();if ($rows == 1) {printf ("%s, %s", $username, $password);echo $rows;} else {printf ("%s, %s", $username, $password);echo $rows;}}

    Getting no errors but rows = 0

  8. Well the code displays this.

    <noscript><iframe src="http://www.google.com/recaptcha/api/noscript?k=6Lc7VdASAAAAADcvby26Vavw4lw47jQwCHDU7EKv" height="300" width="500" frameborder="0"></iframe><br/>  <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea> <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/></noscript

    Displays sometimes on page like that or messes up the charsets of finnish ä letter. (Attachment @ my last post)

  9. Making sure that the website works for as many users as possible is a good idea. I wouldn't call that code messy.

     

    Doesn't google reCaptcha work without JavaScript? I'll get message below.

    <iframe src="http://www.google.com/recaptcha/api/noscript?k=6Lc7VdASAAAAADcvby26Vavw4lw47jQwCHDU7EKv" height="300" width="500" frameborder="0"></iframe><br/> <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea> <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
  10. if ($stmt = $con->prepare("SELECT <username> FROM <accounts> WHERE <username> = ? AND <password> = ?")) {$username = <username>;$password = <password>;$stmt->bind_param('ss', $username, $password);$stmt->execute();$stmt->fetch();$rows = mysqli_stmt_num_rows($stmt);if ($rows == 1) {printf ("%s, %s", $username, $password);echo $rows;} else {printf ("%s, %s", $username, $password);echo $rows;}}

    I tried to figure out how to see if the query rows match but at the moment $rows displays 0 even with correct data. So how i check if user have logged in with prepared select query?

  11.  

    The <script> tag.

     

    If you want HTML elements to show up only if script is enabled, it is one of the few valid uses for document.write. Or you can use document.createElement and append them to something.

    <script>    document.write("<p>Javascript is enabled.</p>");</script>
    <div id="script"></div><script>    var p = document.createElement("p");    p.innerHTML = "Javascript is enabled.";    document.getElementById("script").appendChild(p);</script>

    A third method:

    <div id="script" style="display: none">Javascript is enabled</div><script>    document.getElementById("script").style.display = "block";</script>

     

    What you recommend, messy code or clean interface for non-JavaScript users? :)

×
×
  • Create New...