hericles 289 Master Poster Featured Poster

You can do AJAX calls on every key up event if you want it to be that responsive, that'll send a request to the server for partial amounts as well because it won't know when the user has finished typing.
Or you can call when the input uses focus if that is relevant.

hericles 289 Master Poster Featured Poster

Need more information about what is 'not working' to help you.
All I can tell from the URL is that the JSON is valid.

hericles 289 Master Poster Featured Poster

Your code is a little confusing. Each of your javascript functions expects a parameter yet none of the onclick="" supply one. Ignoring the fact you never supply divNum, your jQuery selector won't work
$("Slide Toggle"+divNum)
Because "Slide Toggle" and all the rest of the terms you use aren't jQuery selectors (no # or . in front to specify ID or class) and the there is no element with that name on your page to be manipulated anyway.

I think you need to have one image on the page with a set ID and then each radio button's onclick calls the function that affects that image with the effect.
<img src='someUrl' id='someID' />

jQuery('#someID').show();
jQuery('#someID').toggle();
etc.

If this is actually n assignment I would suggest going over the jQuery section from your course material again. I don't think you have got a good grasp just yet.

hericles 289 Master Poster Featured Poster

in that case you'll need to check that
a) the file you're reading has that attribute in it
b) that attribute is getting read correctly from the file
c) it exists in the mystudents object

That error is happening because the structure 'mystudents' doesn't have .gpa ( you probably guessed that much).

hericles 289 Master Poster Featured Poster

What is students_lab10? As the error states, it isn't defined in your code. The first time it appears is when you are trying to use it.

jodytj commented: Thank you, now I am getting other errors when selecting 1 in the menu +0
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

Mailchimp.

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

Generally that error is not due to your code. Either the firewall is blocking you or the database is listening on a specific port.

hericles 289 Master Poster Featured Poster

I haven't moved onto Swift myself yet, mainly because I've been doing less native coding and doing more cross-platform stuff, but from what I've read Swift is getting being picked up at a high rate due to it's ease of use and coding style. Google are even thinking of using it as the OS for android in the future. (Apple have made Swift open source apparently - who would have thunk it).
It's based on Objective C so the learning curve for you shouldn't be very steep. I say switch.

hericles 289 Master Poster Featured Poster

Your syntax has a lot of mistakes in it which you are hopefully aware of. But even without them it didn't work as you had it.
This works:

var array = [];
    var obj = [1,2,3];
    var obj2 = [4,5,6];
    var obj3 = [7,8,9];
    array.push(obj);
    array.push(obj2);
    array.push(obj3);
    console.log(array);
    console.log(array.indexOf(obj2)); // gives position of 1

So I think the object creation you used is the problem. Although your if statement would have failed regardless because the object you looked for would have been at position zero not position 1. Arrays are zero based in javascript.

hericles 289 Master Poster Featured Poster

I'd remove the spaces from the date string to start with: 2016-04-25 18:18:15.
That would probably fix it.

hericles 289 Master Poster Featured Poster

What exactly are you stuck on? You haven't told us what you're trying to do.

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

And it won't. onclick is used to specify which javascript function is called when an element is clicked.
You would need a matching javascript function to go with that on click:
function someFunction() {}
Given that you want to redirect you would then have the window.location.href command in there.

But, given that that is all it appears you want to do, use a <a href="administrators_form.php"> tag instead and style to look like a button.

hericles 289 Master Poster Featured Poster

A button isn't a link, the href attribute has no effect. If you want to redirect to the admin page either style an <a> tag to look like a button or add an onclick event to the button so some javascript can process the redirect.

hericles 289 Master Poster Featured Poster

Hi,
A mobile web app is available through the browser but is a webpage optimised for a mobile screen. So, it's not really 'responsive' as it won't be designed to work on a desktop sized screen.
This gives a good explanation: Click Here

hericles 289 Master Poster Featured Poster

So are you saying that when you click on one of the buttons, without getting asked to enter any user credentials, the form doesn't appear and you get an error message about an incorrect user anme or password?
So code would help. Can you post that up?

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

mysqldump is the command line function that exports all or part of a database to the specified file.
So you are taking all of the database 'moneycs' and outputting it to whatever file name you suply.

It's perfectly acceptable MySql

hericles 289 Master Poster Featured Poster

Why on earth are you using document.getElementById and jQuery at the same time???
To locate an element in jQuery just use:
$('#item1').click(function() {//code}); // for an ID
$('.item1').click(function() {//code}); // for an class

To apply a click to multiple elements you can do this
$('#item1, #item2').click(function() {//code}); or$('#item1').add('#item2').click(function() {//code});

hericles 289 Master Poster Featured Poster

I think you need to use a prepare() statement, instead of query(), with your database object seeing as you are binding variables into the statement.
You should be checking your PDO object for errors at any rate because I'm pretty sure that is where the problem lies.

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

To defend against SQL injections make sure you're using prepare() for all of your database queries.

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

Maybe some code would make it more obvious. It sounds like CSS height and width would be all you need if you have to re-size a surrounding element to match the SVG.

hericles 289 Master Poster Featured Poster

What you can do is add a button to add more text fields. Then, using jQuery, whenever the button is pressed add a new div into the page below the existing one. In that way you can have an infinitely growing list of text boxes but you're never showing more than the user needs.
You have to handle all of those new dynamic inputs when posting the form but that's hard.

hericles 289 Master Poster Featured Poster

What exactly do you mean by "The text fields needs to accept and allow multiple entries"?

hericles 289 Master Poster Featured Poster

Maybe you could be more specific as to the actual problem? asking how to code an admin section is quite vague.

hericles 289 Master Poster Featured Poster

An execution plan is a description of how the database is going to carry out your query. It can show you what happens and in what order, plus detailing how much 'effort' went into each step. This allows you to see bottle necks and locate where slow performing queries are going wrong. You don't create an execution plan yourself, just to be clear, it's handled completely by the database engine.
Indexes allow for more efficient searching of tables, basically by giving the database a way of sorting the data. Adding indexes to sow queries can be a good way to get some performance gains out of them.
Indexes, what they are, how they work and how to create them, is a big topic. I would suggest spending some time on Google to get a good basic knowledge of them.

hericles 289 Master Poster Featured Poster

No, they are not the same.
Formats like CSV or .txt are just data. They have no ability to store meta-information at all.
.xls and .doc, etc have the ability to store and display style rules. You can export to a speadsheet file for sure, in higher level languages like .Net and java. I doubt you'll be able to do that in javascript, I would expect it to require a post to the server, but I may be wrong.

Even if you could save the data to .xls, adding in the HTMl colours would be a bit of work due to how .xls files are written.

hericles 289 Master Poster Featured Poster

CSV is just plain data, formatted in a certain way. There is no way to add style rules to it.
It's like asking if you can add fonts to a .txt file.

hericles 289 Master Poster Featured Poster

We use sourcetree at my work and it's a pretty good tool. It's just a repo interface of course when you get right down to it but works well and has some nice features.
I now use it with bitbucket for my personal projects as well.
I can't comment on how safe it is compared to other alternatives.

hericles 289 Master Poster Featured Poster

You just need to loop through your $group, getting each email address and sending one email per address. So alter line 27 to run through all individual items in $groups.

hericles 289 Master Poster Featured Poster

But you're adding in the group as a bcc list, meaning a lot of people (everyone mentioned in the bcc) gets the same email body.
You can't personalise that to include the email of each bcc person.
You would need to send one email to each person, no bcc, and include $youremail in place of the $??? to fix your problem.

hericles 289 Master Poster Featured Poster

Limiting the results to just links containing "media.tumblr.com" is easy:
if(strpos($element->href, 'media.tumblr.com') !== false) {
echo $element->href . '<br>';'}'
will remove any that don't include that string

For the next pages, put a for loop around your scrapping code and add the loop iteration onto the URL each time

hericles 289 Master Poster Featured Poster

Are there three columns in total, a name and then two numbers e.g. bruce, 1, 5?
You haven't stated where the error is actually occuring but is it at line 14: int( row[2] )?

If there aren't 3 columns then that should be the problem, column 2 (the third) doesn't exist.

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

You haven't explained exactly what this bill number is but, assuming you've got your table starting at 1 for the first entry, if the returned rows is zero (no records in the table) you know your first bill number is 1. Other increment by 1 as you are doing.

Dim BillNo As New DataTable
BillNo = New DAL().selectdatatable(" Select * FROM client ")
If (BillNo.Rows.Count < 1) 
    txtBillNo.Text = "1" // or whatever is relevant
Else
    For i As Integer = 0 To BillNo.Rows.Count
        txtBillNo.Text = BillNo.Rows(i)(0).ToString + 1
    Next
End IF

My VB syntax is rusty so my If loop maybe incorrect.

Santanu.Das commented: Loop should be [ For i As Integer = 0 To (BillNo.Rows.Count-1) ] +7
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

Of course it won't work. An empty table will return an empty result set and so your line
txtBillNo.Text = BillNo.Rows(i)(0).ToString + 1
can't supply a value because BillNo.Rows(i)(0) doesn't exist.
If no results are returned just set the txtBillNo to whatever the first number should be. e.g. 1.

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

You're not quoting the first value, Me.Product_NameTextBox. And you are quoting both price inputs. Is that correct? I would have expected them to be decimals/currency inputs.
Also, use parameters to insert variables into command text.

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