hericles 289 Master Poster Featured Poster

Follow through each step and make sure everything is as expected. So check $_POST['password'] holds a value, check that password_hash() doesn't return FALSE and check the error message from your db call.
Everything looks fine from a cod epoint of value.

hericles 289 Master Poster Featured Poster

Trying running
npm rebuild node-sass

It should help rebuild the correct binding for your setup.

hericles 289 Master Poster Featured Poster

I've never been too fond of Android Studio. I use Visual Studio Code for anything Angular now and love it. But it really comes down to a couple of things: does the editor have the features I need to get the job done and do I like using it? If you say yes to both, use it.

For any Angular/Ionic project you can go into the root folder and run the command to send it to the browser, using either 'ionic cordova ...' or 'npm ....' for whichever way you initially set it up.

hericles 289 Master Poster Featured Poster

Hello,
First up, no Java needed at all. Angular is based in TypeScript now which has a very similar structure to JavaScript. If you don't know Javascript that well, it's easy to pick up.
Using Ionic will mainly come down to running some commands on the CLI to build, deploy, that kind of thing plus, possibly using some of the Ionic controls in your HTML.
They are very compatible with iOS but you should probably understand the difference between how Ionic compiles an app (essentially into a webview inside an app container) vs other options that result in native code (Xamarin for example).
Also, some other frameworks (ReactJS, Vue, etc) seem to have a performance advantage over Angular. I've built several apps using Angular 1 through4 now and have found the perfomance to be perfectly acceptable but not lightning fast.

hope that helps.

hericles 289 Master Poster Featured Poster

You're missing your second option in the second ternary operator:

($camp['CampaignStatus'] < 2 ? 'Drafted' : <SHOULD BE SOMETHING HERE> )

hericles 289 Master Poster Featured Poster

This a complete function so we can't see what should be being returned or when.
I can't see an error in what you are doing here but what happens to the HTML after that?

hericles 289 Master Poster Featured Poster

I'd consider using Unity. It's cross platform and you'd be programming in C# which is much better than trying to get to grips with C++ if you haven't used it before.
C++ has advantages over speed of performance but C# will be faster to write in and makes a perfectly good final product.
Either way, I always suggest it-ebooks.info and find what you need there - it has a huge range of free books.

hericles 289 Master Poster Featured Poster

Click Here
This one has one panel sliding all the way off screen but once you're familiar with the idea changing it to have two panels moving half the distance shouldn't be hard.

hericles 289 Master Poster Featured Poster

Loop through your array and for each item and call
ListBox.Items.Add()

You can call that in your Load event as you want the list populated when the form appears.

hericles 289 Master Poster Featured Poster
SELECT blabla
FROM a INNER JOIN b ON a.a = b.b
ORDER BY a.id DESC LIMIT 10;

If you're creating the SQL statement in code just replace the 10 with whatever the result of (variable x 10) is.

hericles 289 Master Poster Featured Poster

I would guess it is because you're not actually stopping the button submission by return false; or event.stopPropagation() so your form is still submitting sometimes. All the cancel button does is close the window but you've still clicked the submit button before that.
Why it only happens sometimes, I don't know, probably a matter of timing before the window closes.

hericles 289 Master Poster Featured Poster

One method is to use a LIteral control on the page and build up your html as string in the code behind and then pass it to the literal.
<asp:Literal id="literal1" runat="server" />
In code:
string html = "<div class=''>....";
literal1.text = html;

hericles 289 Master Poster Featured Poster

The issue must be in the values string you set up. If you're getting 'invalid' back you can be sure you're hitting the right URL and your cURL is working but you're failing the verification.
So you're need to match your query string against the API docs and any examples to see what you're doing wrong.

As an aside you're opening database connection too early. Don't open it until the curl response comes back to minimise the time you're holding a database connection open. Probably not a big deal but a good habit to get into.

hericles 289 Master Poster Featured Poster

Firstly, this line only showing one row:
$result = mysqli_fetch_row($result);
var_dump($result);

You've only asked it to fetch one row so the dump only has one row. mysqli_fetch_row does just what it says i.e. it returns ONE row.
For the second problem, the var_dump of your row above shows what's wrong there. 'name' isn't a key in the array, everything is index based.
echo $row[1]; // will outut the name column

hericles 289 Master Poster Featured Poster

What if you register the #Resolved click inside the success return of your AJAX call?

$(document).on('click', '.viewTD', function(){
       window.tid = $(this).closest('tr').find('.tidTD input').val();
       $.ajax({
           type: 'post',
            url: 'modalInfo.php',
           data: 'tid=' +tid,
           success: function(d){
               $('.modal-body').html(d);
               $('.modal-title').html("Ticket ID: " + tid);
               $('#myModal').modal('show');
               var time = $('#time').val();
               var desc = $('#description').val();

               $('#Resolved').click(resolvedAjax(window.tid));
           }
       });
    });
    $( document ).on( "click", "#addComment", function() {
        $.ajax({type: 'post', data: { myData: $('#commentAdd').serialize() }, url: "addComment.php", success: function(info){
        }});
    });
hericles 289 Master Poster Featured Poster

Something like this?

<div id="generalbox">
  <div id="box3">
    <div id="item1" class="item" >This is example forum</div>
    <div id="item2" class="item" >This is example forum's description</div>
  </div>
  <div id="righthand">
    <div class="rightHandBlock"></div>
    <div class="rightHandBlock"></div>
   <div class="rightHandBlock"></div>
  </div>
</div>

CSS:

#generalbox {
    display: block;
    padding: 1.5%;
    margin-bottom: .15%;
    background-color: #222;
}

#box3 {
    display: inline-block;
    width: 54%;
    background-color: #a1a1a1;
}
.item {
  text-align: center;
  border: 3px solid #000;
}
#item1 {
    font-size: 1.8em;
    color: #000;
    text-decoration: none;
}

#item2 {
    font-size: 1.8em;
    color: #555;
}    
#righthand {
    display: inline-block;
    background-color: red;
    float: right;
    width: 90px;
}
.rightHandBlock {
  display: inline-block;
  border: 1px solid #fff;
  height: 40px;
  width: 40px;
}
hericles 289 Master Poster Featured Poster

You need to put quotes around the value for the Location column.

SELECT * FROM kladilnica WHERE Location = 'Macedonia' AND Uplata = 50 AND Liked = 50

So you need this:
if($selectCountryBox != "") $searchArr[] = "Location = '{$selectCountryBox}'";

hericles 289 Master Poster Featured Poster

Chrome won't work bcause you're using an ActiveXObject, that only works in IE (unless you've added a plug in).
Windows is failing because your syntax is incorrect. Your window.onload should look like this:

window.onload = function() {
        loadfile(filename);
}

In your loadfile function you ned to check for the end of the file while reading and define the r object:

function loadfile() {
   if (!fso.FileExists(filename)) {
      fso.CreateTextFile(filename,true);
   }
        var f=fso.OpenTextFile(filename,1);
        var r = null;
        while(!f.AtEndOfStream) {
            r=f.ReadAll();
        }
        f.Close();
        myarea.innerHTML=r;
    }

That still outputs 'null' onto the screen but that's all I have time for right now.

hericles 289 Master Poster Featured Poster

In that case I would say is almost certainly because waypoint scans the DOM at page load only. Items added after that don't get found. Finding out how you can force waypoint to go over the DOM again after those new items are added would solve your problem.

hericles 289 Master Poster Featured Poster

I haven't heard of waypoint til now but my first thought would be that elements added after waypoint is initialised don't get included because they weren't part of the DOM at that time.
Is the new content getting added after the page has finished loaded i.e. by user action, or is everthing loaded by the time the document is ready?
It could just be that your waypoint initialisation needs to be the very last thing to occur.

hericles 289 Master Poster Featured Poster

Simply dispose of the connection when you're done with it.

conn.Close()
conn.Dispose()

That's just good practise anyway for db connections.

hericles 289 Master Poster Featured Poster

Your SQL looks right so there must be so external factor happening, some form of permissions being the ikely problem (yes, I now you said the directory was 777). Are you checking the MySql error after you've ran the query?

hericles 289 Master Poster Featured Poster

It is possible. What you will want to do is use jQuery and monitor the onchange event of the drop down so your code knows when an option has been selected.
Then you do an http.post to the server with the selected option as the data. Your PHP endpoint will read the data (the user ID) and select the relevant data from the database and return it to the jQuery post which will then display the results on screen.

You can do the same thing purely in PHP but you would need to have a page postback (form submit) for server to know which option was selected.

hericles 289 Master Poster Featured Poster

The file check.php selects the xml data from the database, but the display does not show any xml tags.

I'm not sure why you expect to see XML tags on the page. You don't see <h1> or <div> in an HTML either. They're meant to be hidden as they indicate page structure and aren't considered page content.
Do you need to see the XML tags?

Maybe could you be more exact about what you expect to see and what actually happens.

hericles 289 Master Poster Featured Poster

A web service is a piece of software, running on the server (computer B) and listening on a particular port (optional).
Computer A would post data to the URL and port the web service is listening on and it will be processed on computer B.

You can post information to a URL with particularly ever programming language (.Net, cURL, PHP, javascript, the list goes on) and all server side languages should be able to create a web service to listen on a port. So you can definitely do what you want with WCF or a variety of RESTful architectures.

The error you are getting is almost certainly because you haven't set up an endpoint or the endpoint is wrong and isn't aimed at the connector's location.

hericles 289 Master Poster Featured Poster

Presumably you've been taught everything you need to know in class to handle this assignment so you already have the tools you need.
Step 1 is to make sure you understand the problem. Do this by working your way through the steps your program would need to do in english.
I.e. read a file, know when it's finished reading the file, need to store the values so how do I do that, etc.

Once you've got your flow sorted you can start with the actual code, building it up a step at a time. And once you've got something to show us and are still having trouble then people might be more interested in helping. Make an effort and then ask for help.

Personally, this isn't a hard problem and either you are too lazy to try or didn't understand the course material so far. Both problems are fixable with a little work on your part.

hericles 289 Master Poster Featured Poster

I think it's valuable information.
As far as I can tell there is no cost to initialising/defining/loading a function that is never used. That is, PHP doesn't do anything to it until it is called. But I could be wrong.
However, a larger file does have a higher cost involved when it is loaded than a smaller one. Say you include your file and there are a lot of dead code functions in there. They still have to get loaded as they're part of the file and that comes at a cost.

hericles 289 Master Poster Featured Poster

Second problem is that you refer to a table called 'users' which should be 'student' going by the MySql schema.
Third problem, change your first value in the sql statement from '' to null so the id column updates correctly.

hericles 289 Master Poster Featured Poster

The first problem you have is an incorrect parameter. In the HTML you have the radio buttons called 'gender' but in the PHP $_POST you use 'Sgender'.

hericles 289 Master Poster Featured Poster

It works fine for me with the id added. The validate will never fire as you have it though as you are submitting the form in the onchange event of the select. Meaning you don't get to select 2 or 3 and then click next.
You'll want to call it from inside the onchange if you want to post the form when the user selects an option. Or move the submit to the validate function.

slowlearner2010 commented: yeah it work fine by the way. there a mistake on my code that make this func not working properly..thanks a lots +0
hericles 289 Master Poster Featured Poster

Most obvious problem is you are using getElementById but your form doesn't have an id attribute.
The code for setting the action looks right except it isn't affecting anything because the form can't be found.

slowlearner2010 commented: thanks for your answer. its solved now.. +2
hericles 289 Master Poster Featured Poster

My python isn't very good but if I remember correctly you can put a comma ( , ) at the end of the first print statement and it will not output a new line, making the second print appear beside the first.
if not, just concatenate your full line (inlucding the 'F' if it is required) into a string and print once.

hericles 289 Master Poster Featured Poster

You could have spent a few minutes reading up on the fetchAll() method. Hint: it returns an array.

$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
now loop through each row in the $result array, getting the Consumption value

foreach($result as $row) {
    $c = $row['Consumption'];
}
hericles 289 Master Poster Featured Poster

Head over to https://it-ebooks.info/tag/programming/ and browse around, also go to https://www.packtpub.com/ and sign up. They give away a free ebook every day (the quality varies).
In terms of what to learn, if you don't have a particular language but want to become a better programmer, I'd look at the books that discuss data structures and algorithms. SQL knowledge and databases is always good, concurrency, things like that.
There were some books called code complete (I think), came in 2 volumes, that broke down good coding style with plenty of examples. They were pretty useful but I doubt you'll find them on the link above .

hericles 289 Master Poster Featured Poster

Look into jquery http.post method. It lets you make an AJAX call to a URL you specify and pass in data.
The PHP script reads in the $_POST variables and you're all set to do your database query

hericles 289 Master Poster Featured Poster

If you are only pulling through the name and subject initially (and ID presumably) then when the preview is clicked on you do another database query to get the rest of the message information using the ID as the identifier. And then display that in the seond area in pretty much the same way you displayed the preview.

hericles 289 Master Poster Featured Poster

Var_dump $_GET['id'] and you'll see it isn't a value.
What is the URL you are calling? Can you at least out the parameters here?

hericles 289 Master Poster Featured Poster

In your first attempt the error would have gone away because the code in the loop wasn't getting called.
isset($_GET['id']) failed and so nothing else happened.
Double check the URL parameters you are passing in, id isn't one of them.

hericles 289 Master Poster Featured Poster

Your function gets called every time there is a scroll event, so at the bottom of the page, with no more pictures to display, it has no choice to respond with "There are no pictures."
Add a variable and set it to true when you reach the "no pictures point". Then check if that variable is false at the start of the scroll event before proceeding.
Can't help with the IE thing...

hericles 289 Master Poster Featured Poster

As noted in the other thread:
jQuery('#details-modal').modal('hide');

hericles 289 Master Poster Featured Poster

You need to quote the id in the jquery call
jQuery('#details-modal').modal('hide');
They are strings not variables.

sahilmohile15 commented: Thanks the code is solved and working fine. +0
hericles 289 Master Poster Featured Poster

What is the query trying to do?
If it is returning a large record set, written bad or uses a large number of joins it could be hogging the resources.
Find a tool for analysing the query (MySQL Workbench or MS SQL Server Management Studio for example, depending on your database type) and check how the query performs.
Then either re-write if possible or make it return a smaller subset of rows (by using pagination)

hericles 289 Master Poster Featured Poster

It is an error.
var data {"id": id};
isn't valid javascript.
var data = {"id": id};

sahilmohile15 commented: Thanks +0
hericles 289 Master Poster Featured Poster

First thing to check is whether your javascript function is appearing on the page.
Once the page is loaded in the browser, view the source and confirm the footer is loading correctly and that the detailsmodal function is part of the page source.

Are you getting any other errors from the page in the console?

hericles 289 Master Poster Featured Poster

This is hard to understand exactly what you want.
You have, for example, the name and id listed in list boxes 1 and 2, like so:

LB1            LB2
1                 Adam
2                Tony
3                Dave
4                Lisa

And then you want a third list box that gets the amount variable. Where does this value come from?
The only problem you have is how to create this value, after that you're just storing it in a database table.
Can you better explain that part?

hericles 289 Master Poster Featured Poster

I think your problem is here:

If (newpage) Then
                        e.Graphics.DrawString(dgvreciept.Columns(cell.ColumnIndex).HeaderText, .Font, Brushes.Black, rc, fmt)
                    Else
                        e.Graphics.DrawString(dgvreciept.Rows(cell.RowIndex).Cells(cell.ColumnIndex).FormattedValue.ToString(), .Font, Brushes.Black, rc, fmt)

On the first row to be processed (whether set to 0 or 1) newPage is true but inside that if you only draw the header if new page is true. You also need to draw the string with the row data. This is better:

If (newpage) Then
     e.Graphics.DrawString(dgvreciept.Columns(cell.ColumnIndex).HeaderText, .Font, Brushes.Black, rc, fmt)
      // you'll need to recalculate rc of course if newPage is true
End If
// now draw string for cell regardless of newPage state
e.Graphics.DrawString(dgvreciept.Rows(cell.RowIndex).Cells(cell.ColumnIndex).FormattedValue.ToString(), .Font, Brushes.Black, rc, fmt)

It's a bit concerning that you even attempted a value of -1 when trouble shooting. Any index check would immediately fail with such a value:
.Rows(mRow) // with mRow = -1, out of bounds error
but you live and you learn :)

hericles 289 Master Poster Featured Poster

You've given us nothing to go on really but is the message too long for the area provided for it? It's possible that it is being stretched due to the overlong content and other elements need to move around it.

hericles 289 Master Poster Featured Poster

Key is a reserved word in MySQL. You need to use back ticks to escape it rather than quotes.
Backticks are the key to the left of the 1 on most keyboards, with the tilde character: ~ as the shift option.

hericles 289 Master Poster Featured Poster

And what problem are you having?
Is it the typo in 'select producs.' in your SQL statement? Or something else?
Seeing as your only using a few of the selected columns you can change your query from selecting all to just the ones you need. ut that won't fix the undescribed problem you're having, it's just a tip - Selecting all every time is just lazy ;)

hericles 289 Master Poster Featured Poster

These don't match:
<input type="text" id="Username" placeholder="Username">
user = document.getElementById("User").value;

The <Us> element has an ID of User so you're selecting the wrong element.