• Member Avatar for hielo
    hielo

    Replied To a Post in Wrong data inserted into the database

    What is your PHP INSERT query? Are you by any chance casting the value of `type` to an integer? Also, where is the javscript code that is actually sending the …
  • Member Avatar for hielo
    hielo

    Replied To a Post in How to pass values using load in jquery

    Try appending the data as a querystring -ex: jq("#myid").load(location.href + " #myid?firstName=John&lastName=Smith");
  • Member Avatar for hielo
    hielo

    Replied To a Post in Multiple textboxes fill the dropdown selection having same class in jquery

    From what I see, the `input` and the corresponding `select` can be "tied/related" to each other by inspecting their `id` attributes. By removing the non-numeric portion of the `id`, whatever …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Javascript

    Are you referring to the `document.write` predefined method? If so, just assign a reference to if for your own `write` property -ex. var subject = new Object(); subject.write = document.write; …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Image upload

    You need to fix your `<form>` tag to include `enctype="multipart/form-data"` otherwise the `$_FILES` array will remain empty. Also, you forgot to use `echo` for the `action` attribute. Try: <form name="form1" …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Finder menu option missing

    > And in terms of Finder menu options ... Not sure why they're missing for you FYI - They are not missing for me. However the list of items under …
  • Member Avatar for hielo
    hielo

    Edited a Post in Multiple image upload with multiple inputs and multiple directory

    Your code above begins with: <?php require 'database.php'; $code_id = $_SESSION['SESS_CODE_NAME']; Are you calling `session_start();` at the beginning of `database.php`? If not, then `$code_id` will not have the value you …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Multiple image upload with multiple inputs and multiple directory

    Your code above begins with: <?php require 'database.php'; $code_id = $_SESSION['SESS_CODE_NAME']; Are you calling `session_start();` at the beginning of `database.php`? If not, then `$code_id` will not have the value you …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Multiple image upload with multiple inputs and multiple directory

    Line 78 is wrong -- it should be lowercase "s". To clarify, your initial form has <input style="font-size:18px; height:45px; font-weight:bold; color:#0033FF" type="submit" style="height:50px" name="submit1" value="Save / Submit Form" > Notice …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Multiple image upload with multiple inputs and multiple directory

    On `submit` button on your first form has `name="submit1"`, so you need to update line 78 to test for `'submit1'` instead of `'Submit'`. Also, on lines 83-87 you need to …
  • Member Avatar for hielo
    hielo

    Replied To a Post in SQL select between 10 to 20 last results by ID

    You need `... LIMIT offset, rowCount` -- ex: SELECT blabla FROM a INNER JOIN b ON a.a = b.b ORDER BY a.id DESC LIMIT 50, 10 will give you at …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Multiple image upload with multiple inputs and multiple directory

    It worked fine for me. Did you copy and paste the code above or did you integrate it onto some existing codebase? I updated the code with the one below …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Multiple image upload with multiple inputs and multiple directory

    > ...but the files are not moving to its destination folders... Check your server's error log to see if it gives you a clue as to why it may not …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Attendance form and healthcheck form help

    It's hielo, not helio. As for the healthcheck form look at how I implemented the attendance form and then make an effort to implement the healthcheck form. If you have …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Attendance form and healthcheck form help

    Upon closer inspection I see that you are mixing `mysqli_` (with an "i") with `mysql_` ( without an "i") functions. To clarify, you are connecting to the database using `mysqli_connect`, …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Multiple image upload with multiple inputs and multiple directory

    > but i got error on line 44 On my post above, there is a missing semicolon at the end of line 46: ... $prop['destination'] = array_key_exists('destination', $prop) ? $prop['destination'] …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Login failed with already existing member PHP

    Did you check your spam folder? If in fact it is not sending emails, then it's most likely a server configuration problem. If you are on a linux machine, try …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Login failed with already existing member PHP

    You can put your email address.
  • Member Avatar for hielo
    hielo

    Replied To a Post in Login failed with already existing member PHP

    Ah, yes. The procedural style needs the connection handle. Try: $result = mysqli_query($conn, "select * from table where `username`='" . mysqli_real_escape_string($conn,$username) . "' and `passwd` = sha1('" . mysqli_real_escape_string($conn,$password) . …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Login failed with already existing member PHP

    Try: <?php function login($username, $password) { // check username and password with db // if yes, return true // else throw exception // connect to db $conn = db_connect(); // …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Login failed with already existing member PHP

    That is your login form (not your `login()` function), which is sending/submitting the `username` and `password` to `member.php`. So, in `member.php` you should have `function login(...){...}`. Based on one of …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Login failed with already existing member PHP

    OK, so clearly the `login()` function is throwing an `exception`. Print out the exception message within the `catch` clause so you know why the login is failing, and then inspect …
  • Member Avatar for hielo
    hielo

    Began Watching Login failed with already existing member PHP

    I've created a new member for a website (that I'm making for myself) to see if it works and when I register, I can get in, but when I go …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Login failed with already existing member PHP

    > I can get in, but when I go to log in after, it won't let me log in What you posted doesn't help. You need to post what you …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Attendance form and healthcheck form help

    Update: On my last post, move line 78 to the end of the file (after line 155): ... </html> <?php mysqli_close($link);
  • Member Avatar for hielo
    hielo

    Replied To a Post in Attendance form and healthcheck form help

    I suggest that you use only one db connection file: <?php // connect-db.php if(!isset($mysql_db)) { die('You forgot to define $mysql_db first.'); } $conn_error = 'Could not connect.'; $mysql_host = 'localhost'; …
  • Member Avatar for hielo
    hielo

    Began Watching pass public holidays list array then return working days count

    Below is my code function getWorkingDays($startDate, $endDate){ $begin=strtotime($startDate); $end=strtotime($endDate); if($begin>$end){ echo "startdate is in the future! <br />"; return 0; }else{ $no_days=0; $weekends=0; while($begin<=$end){ $no_days++; $what_day=date("N",$begin); if($what_day>5) { $weekends++; }; …
  • Member Avatar for hielo
    hielo

    Replied To a Post in pass public holidays list array then return working days count

    Try: function getWorkingDays($startDate, $endDate, $holidayList) { $working_days = 0; $begin = strtotime($startDate); $end = strtotime($endDate); if($begin > $end) { echo "startdate is in the future! <br />"; } else { …
  • Member Avatar for hielo
    hielo

    Began Watching Pass JavaScript variable to another function

    I am trying to pass a javascript variable into another function and keep getting undefined errors etc. In the first function I have chatName that I want to use as …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Pass JavaScript variable to another function

    The second parameter of `function createChatBox(chatboxtitle,minimizeChatBox)` should be `chatName` (not `minimizeChatBox`) since you are using `chatName` on line 19.
  • Member Avatar for hielo
    hielo

    Began Watching Multiple image upload with multiple inputs and multiple directory

    Good day ,wish to know how to upload multiple image files with multiple inputs and multiple directories. My code is <table border="1px" width="100%"> <tr><td colspan="3" style="background-color:#E8E8E8"><b>Supporting documents upload</b></td></tr> <tr><td> </td><td colspan="3"><input …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Multiple image upload with multiple inputs and multiple directory

    Try saving the following as test.php and give it a try: <?php if( array_key_exists('Submit',$_POST) ) { if(!empty($_FILES)) { // these are your "settings" $myFiles=Array( 'pri' => Array('required'=>true, 'destination'=>'/path/to/save/directory/', 'allowed'=>'pdf;doc;docx', 'label'=>'Pri') …
  • Member Avatar for hielo
    hielo

    Began Watching where are the forums ???

    How can i simply review Q/A on forum databases??? Of course, a couple of years ago, I simply called up daniweb.com, selected a forum, e.g. internet, databases, mysql and then …
  • Member Avatar for hielo
    hielo

    Replied To a Post in where are the forums ???

    > How can i simply review Q/A on forum databases See if you find it under `Finder > My Favorite Forums > Databases`. I too was gone for a long …
  • Member Avatar for hielo
    hielo

    Began Watching Return array from prepared statement

    $stmt = $dbconn->prepare("SELECT * FROM `members` WHERE username=? AND password=?"); $stmt->bind_param("ss", $username, $password); Is what I have. Database is connected etc. How can I set variable called `$dbresult` with array …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Return array from prepared statement

    Try the `fetch()` function given at http://php.net/manual/en/mysqli-stmt.bind-result.php#102179. By now you probably realized that to use `bind_result()` you need to provide variable names to it, one for every field you are …
  • Member Avatar for hielo
    hielo

    Began Watching Attendance form and healthcheck form help

    Hi, I need help with the attendance form (index.php). When I tried to update the first row, nothing happened. For the last row, the message says, "**We couldn't update the …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Attendance form and healthcheck form help

    Read through the comments of the script below. Notice that the underlying html markup has changed. <!DOCTYPE html> <?php require 'connect2.inc.php'; $errors=Array(); // Now there is student_id hidden field in …
  • Member Avatar for hielo
    hielo

    Began Watching (C++)I can't figure out why this code has access violation error

    Help me please! below is a part of the code which causes the error. int B[996]; for (j = 0, k = 0; j < (N / 6); j++){ if …
  • Member Avatar for hielo
    hielo

    Replied To a Post in (C++)I can't figure out why this code has access violation error

    It is not clear how you are initializing `A[]` but on line 6, if the value of `A[j]` is more than 166, then on line 15, the numeric index for …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Return array from prepared statement

    Refer to get_result(): http://php.net/manual/en/mysqli-stmt.get-result.php // this is where the data will be stored/buffered $data = Array(); $stmt = $dbconn->prepare("SELECT * FROM `members` WHERE username=? AND password=?"); $stmt->bind_param("ss", $username, $password); $stmt->execute(); …
  • Member Avatar for hielo
    hielo

    Replied To a Post in PHP undefined error

    > I have declared the variables in the register_new.php script as $username=$_POST['username']; > $passwd=$_POST['passwd']; The problem is not `$username`. The problem is `$_POST['username']`. If your page is hosted at `yoursite.com/member.php`, …
  • Member Avatar for hielo
    hielo

    Replied To a Post in child class destructor is not being called despite of having virtual dest.

    When `obj.Set_draw ("Rectangle");` is executed, line 90 allocates memory for a Rectangle and `obj` points to it: obj ---> +---+ Rectangle | | +---+ You then execute: `obj.Set_draw ("Circle");`, resulting …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Select two results at the same time

    > How could I request id, name only from users for example In general, you would just need `SELECT tableName.columnName, otherTableName.columnName FROM ...`. The order in which you list the …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Select two results at the same time

    try: `SELECT * FROM forums AS F INNER JOIN users AS U ON F.lastAuthorID = U.id` To help you understand `... forums AS F` simply makes `F` an alias for …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Database Design Question

    On my proposed design I basically got rid of the red table (since it appears to be only a lookup table with three records), and instead took the red `TicketID` …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Database Design Question

    Based on what you posted, theTicket# column on the light-blue table (to the right of the red table) has unique values. If this is true, then merge Ticket# with the …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Login form

    If you are going to use `header('Location: ...')`, you cannot use `echo`. So your else clause should be: ... else { $_SESSION['id'] = $row['id']; $_SESSION['user'] = $myusername; $_SESSION["startTime"] = date("r"); …
  • Member Avatar for hielo
    hielo

    Replied To a Post in PHP and JS Forms

    >Therefore, to allow for both, i would need a way for the PHP code to detect whether a request was an AJAX request or not. I don't know how you …
  • Member Avatar for hielo
    hielo

    Replied To a Post in Session variables ($_SESSION['username']) inside a function

    > However, i would also like to get the roleid returned That implies that you don't know the initial roleid. So your function should not be accepting `$roleid` and shouldn't …

The End.