mattster 195 Practically a Master Poster Featured Poster

@UK-1991 that's fine, no hard feelings from me. No need to not post again aha, we're not that tight here. It was really the way you put your point across that might offend the people trying to help, and I'm sure you can appreciate most of us are very busy and checking DaniWeb often falls after many other things in our lives, so responces may well take a couple of days.

Moving on to a lighter note, did that help solve your problem?

diafol commented: Well put +rep +15
mattster 195 Practically a Master Poster Featured Poster

Copy - I've used it for a little while now and can't fault it.

It's an excellent site 15GB of FREE space, plus another 5GB for refferals! Includes sync, no file limits and 30 day history & recovery. As with dropbox, two users can share data between two accounts.

Tcll commented: I saw this thread and was just about to suggest this, Copy is an awesome! +0
mattster 195 Practically a Master Poster Featured Poster

You users table is fine. (Make sure you're using the right datatypes - varchar(X)/int() - and A_I/PRIMARY_KEY for the ID)

Item Desc: ID,NAME,TYPE,ATTACK (again with correct datatypes)

Inventory: ID, USER_ID, ITEM_ID, [.. anything else you might need] (all int() datatypes, with A_I/PRIMARY_KEY for the ID)

Use a new row for each item in a users inventory. Otherwise 20 columns is uneccisarily bulky. This also makes time for a LEVEL column, for instance.

Hopefully that makes sense?

mattster 195 Practically a Master Poster Featured Poster

In the nicest possible way,   characters were never going to display correctly.

Yes tables are bad practice, but the correct alternative involves a CSS grid system. By all means give this a go and see how you get on. The beauty of grids is that, once you get going you can easily sort out your site for mobile/tablet viewing.

On a side note, your code involves extensive use of the style="" attribute, which is bad practice. You should really try to keep ALL CSS in external CSS files - it makes it far easier to organise.

mattster 195 Practically a Master Poster Featured Poster

Any one there to help no one is helping me I am stuck up please some one help me out

Since you're not paying me (and everyone else here), we will respond when we can. Demanding help to just come isn't going to work, I'm afraid.

If only one file is moving, then clearly only one file is getting handled correctly into that array. Try a good ol' print_r($imggall) and print_r($imgtemp) just before the foreach so we can take a closer look.

If $imggall is being used as a key for $imgtemp, theres a risk that they may be different, so won't find each other or the desired file. (Basically dont count on that).

Using a loop and using the key is probably the most efficient way to work:

$i = 0;
foreach($imggall as $imgname) {
    $path = "./img/gallery/".$imgname;
    move_uploaded_file($imgtemp[$i], $path);
    $confirm = mysqli_query($connect, "INSERT INTO gallery (image) VALUES ('$imgname')");
    $i++;
}
mattster 195 Practically a Master Poster Featured Poster

Remove the   in your HTML, and set your margins in css:

@media screen and (max-width: 320px) {
  .menubar1 > a {
    box-sizing: border-box;
    display: block;
    font-family: arial, helvetica, sans-serif;
    padding: 0;
    margin: 10px 0;
  }
}

Notes:

  • There is no need to repeat your code in the @media query. @media takes your existing rules (for big screens) and overwrites them - so no need for excess stuff.
  • Are you only texting this on your desktop? 320px isn't really mobile resolution - few mobiles will have a screen this small. Aim for more 768px (taken from the Bootstrap project).
mattster 195 Practically a Master Poster Featured Poster

I have been using phpStorm for a little while now, and it has grown on me enough to invest in other JetBrains tools for other projects.

The thing I like, is that it seems JetBrains have crafted the IDE to fit a "by developers for developers" concept. Project handling and navigation is lightyears ahead of Dreamweaver and more 'lightweight' things that closer resemble text editors.

Code completion and suchlike are standard nowadays, but writing with phpStorm just seems to flow fast - I really do feel that writing flows very quickly. Maybe this is due to wrapping blocks within XYZ and little things, change all variable names and multiple cusors with the alt key. It's the only program I've ever used where I look forward to the startup tips every time I load it.

I am a massive fan of CSS preprocessors, and it's standard in anything I do. Having an IDE that even recognises that preprocessors exist is a plus, let alone understanding the syntax. I'm sure a sililar thing applies to PHP frameworks as well.

Finally, theres no 'I' in team and phpStorm's collaboration tools, cool widgets (like todos) and plugins (for version control) just make the process soooo much more efficient.

Overall, a very pleasant IDE. Maybe @diafol should go into sales - JetBrains have probably taken a fortune from everyone giving it a go! ;)

mattster 195 Practically a Master Poster Featured Poster

Well if you have a two week deadline and a pressing client you should not have taken on the work without telling your employer you have no idea what you're doing. Simple as.

It all depends on the clients specifications and wireframes, to the point where generic plugins may not solve this. Personally, especially for a client like this, 3rd party tools are nothing but a liability that you cannot control. If your employer has given you over two weeks, I'm sure they'll be expecting you to do a lot more than download and install something free of the internet. Maybe look into wordpress plugin development, and you can solve this with custom post types, which essentially work like any default page (including content and a featured image) and maybe custom taxonomies if you need additional settings/search parameters.

mattster 195 Practically a Master Poster Featured Poster

Firstly, mysql_* is dead now - mysqli_* should really be used. Also, there's no housekeeping here!! Your query is a lovely advert for SQL injection! session_start() should be the very first thing on your page: before output of any kind. You also have several messy <option> tags: only one can be selected and you should really output them as a loop.

The Selfrating1 can be save .. but the textbox color .. doesn't save

Well what exactly is being saved and what isn't? All of the columns except that one?

From what I can see, there is nothing calling the javascript function to process the data, which would explain why there isn't any colour changes. For speed, add onbeforesubmit="ocalculateText()" to make sure the JS is called, and then see what happens.

Clearly that function needs cleaning up, as I can't really see why you've done some things - but thats another matter aha.

Hope this is helpful :)

mattster 195 Practically a Master Poster Featured Poster

Please tell me that you have a <head> and that you've just randomly decided to show the end of the page and not the start.

Also, please, PLEASE, indent your code properly and only put a neccessary amount of gap lines in to keep it readable. Frankly, your code is making my eyes bleed.

In regards to your problem: "results wont come" isn't best helpful and doesn't really match your title. Provide an accuracte description of what you have got, including error messages, and what you're not getting that you need. Screenshots always useful as well.

mattster 195 Practically a Master Poster Featured Poster

I would highly recommend the object orientated.

It's a far more efficient way to work, but granted it's slightly more to learn. I think it also neatens your code if you are using objects rather than tons of functions and variables: procedural is famously a 'cheap and cheerful' quick fix.

If ever given the choice, go the OOP way!

mattster 195 Practically a Master Poster Featured Poster

Start by building some simple queries, most of which can be done by replacing functions (like L21 mysql_query() with $insert_row = $mysqli->query();). You should slowly see the transformation as not too difficult as soon as you're used to the mysqli_* functions.

Take a look at these to get going:

http://www.sanwebe.com/2013/03/basic-php-mysqli-usage
http://codular.com/php-mysqli

Also note, you should use validation and must use $mysqli->real_escape_string() to clean data, otherwise you're vunerable to SQL injection.

mattster 195 Practically a Master Poster Featured Poster

Have you even Googled it? Where did you get? Because I googled it and the top result (here) is an amazing tutorial.

I assume you already understand OOP in PHP, as that would be very helpful. There are loads of tutorials availible should you need.

mattster 195 Practically a Master Poster Featured Poster

I was looking for something similar myself a few days ago, and found the odd example of a CSS based monopoly-type game board. To be honest, they were all shabby examples made with code that left my eyes bleeding.

I decided to make my own board and get it right (hopefully). So here is my attempt at a monopoly board using minimal CSS and HTML.

Usage:

Use <div class='board'>...</div> to contain your board. Then for each tile, use <section class='{direction} {features}'>...</section>

You can use left, right and up as directions (assuming your players work up the board...) and the following feature classes: start; end; danger; active.

I've set it up to use the Font Awesome library, but this can be adapted into something else.

Here is a demo on Codepen. Hope you like it.

cereal commented: great! +13
mattster 195 Practically a Master Poster Featured Poster

Important to note:

You've got $result containing the query results for an entire row that matches the username, not the password.

Also, avoid md5() at all costs, you need to be using another encryption method (since md5 is old, outdated and insecure). Loot at the PHP hash() function.

mattster 195 Practically a Master Poster Featured Poster

In addition to Laravel, since it seems to be having a few "teething problems" with version 5, consider other frameworks.

IMHO, CakePHP is the leading PHP framework for novices. It has amazing docs, and is a very constrictive framework. While this may be a tad awkward for some experienced developers, it forces good habits. As long as you follow the docs, you cannot possibly produce anything other than efficient, secure code. They provide a few tutorials and tons of code examples to help you out.

Another member, @iamthwee, tried a similar project a few weeks back - see it here. You just have to remember it's a massive task and you've got some serious competition out there.

I would suggest approaching it simply, build a blog (from the CakePHP docs even ;p). Then add to it, so you can edit pages etc. Don't try and bite wayy more than you can chew and get bored of it - cos hey - thats no fun.

Hope this helps, and good luck!

mattster 195 Practically a Master Poster Featured Poster

Dont forget to take a look at the font awesome library!

To use it, shove this in your <head> section:

<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

Then do this wherever you want to use an icon:

<!-- Instead of this -->
<span class="icon-home"></span>

<!-- Use this -->
<i class='fa fa-home'></i>

Then you can chage the colour of the icon so its the same as your text etc., loads of tutorials online and great to play around with. See here.

Elvi commented: THANK U SO MUCH! +0
mattster 195 Practically a Master Poster Featured Poster

I haven't actually built anything with v5 yet to showcase yet, but judging by the release notes, there shouldn't be too much of a problem with rolling with 4.2. Naturally this will change as bugs and security glitches are found...

To me (as a relative newbie to laravel), the docs for v5 look quite impressive. Okay they are a bit wordy with not a great deal of examples, which I can really see as a problem. No idea how it compares to v4.2 in terms of general usage. This dude seems to explain the differences quite well. I particularly like the idea of queues built in, and the templating system looks pretty cool.

Out of interest, what is it that you personally find so different?

mattster 195 Practically a Master Poster Featured Poster

If the child theme has been changed or had any work done on it by a person (which it probably has), therefore the changes/work/theme is copyrighted to them.

It will be very clear from the author if you are allowed to use their theme (and if you need to pay for it etc.). If it doesn't clearly say you can use (or pay) for it - copyright DOES apply, so DON'T use it without permission.

If you're not sure, I'm certain the author would prefer you email them and ask.

cereal commented: +1 +13
diafol commented: I hate thieves - good points +15
mattster 195 Practically a Master Poster Featured Poster

Well it might be helpful to see your directory structure and upload script..? Common sense.

mattster 195 Practically a Master Poster Featured Poster

Very good advice on storing the data.

How can i switch between questions?

Well that depends on what questions you would like to ask.

You need to come up with a diagram of all the questions you could ask, depending on what answers you get. For instance:

Name? --> Age? --> Country? -(USA)-> State? -->
                            -(UK)->  UKquestions ->

Once we know that much, we can then decide how we're going to write the program. This is completely dependant on what sort of questions and possible answers you have.

Possible method as follows:

Lets say you have a load of pre-defined questions and a selection of answers.

DB.questions:

id - Primary Key
title - Question
previous_id - Parent question
previous_answer - Answer given to parent question

If we used the above diagram + DB structure, and the country question is id = 3. We then have a record in the db like this: 4, "What state are you in?", 3, "USA".

Next, someone enters USA as their country, so you search the DB for a question with a parent_id = 3 (since we've answered the country question), and an previous_answer = "USA". We then use the id & title of the question we find, to provide the question and the parent id for the next question.

Hope that makes sense.

mattster 195 Practically a Master Poster Featured Poster

Here is a link to the OSWASP Top Ten. They provide a few simple steps to securing your application.

Personally (if you haven't already done so), write a function to sanitize something like XSS. Then go through your code (unfortunately line by line) and call the function every time code is outputted.

XSS and code injection are absolute essentials, as these are the most common attack methods. The top ten also highlights other major things you need to check for.

When it comes to protecting against specific things, like writing an anti-XSS function, you'll be able to find a trusted blog from Google to sort you out - protecting against these things isn't too difficult.

Edit:

What @iamthwee is saying is ideally correct, since frameworks are a hell of alot easier to secure. Since you've (presumeably) already written your application.

mattster 195 Practically a Master Poster Featured Poster

Just as a warning that many people forget:

Port forwarding and suchlike is extremely dangerous in terms of security, and should only be done if you know what you are doing.

Generally speaking, hosting companies have specialist ISPs, so there is no need for a standard ISP to deal with such requests. Therefore, firewalls on both the ISP and your side of things are not built for this, and as a result you're prone to attacks.

I can think of very few cases where localised hosting is neccisary, as it is merely asking for problems. Ideally, use a free (or even a paid) web hosting service. For the features they come with, it is far less hastle to use someone else.

mattster 195 Practically a Master Poster Featured Poster

Feel better soon happygeek! (I'll be nice, as diafol was trying so hard to make you feel better ;P)

last night, I bought a laptop!!!!!!!!!

Here we go, Dani's bought another $8,000 monster with 64GB of Ram just to show off ;p

RobertHDD commented: Girl thats one monster lappy +0
mattster 195 Practically a Master Poster Featured Poster

Recently I've stumbled on a nice tool that I really quite like, so I thought I'd share it:

Personally, I love the power behind PHP. I find it a very simple to use yet possesses the techniques seen in the more complex desktop applications such as Perl/Python/C/C++/C# etc. PHP has always been restricted to server-side web applications, and unlike the others, cannot run as a desktop application – until now. I would like to share an awesome tool I’ve been using recently…

PHP Nightrain is a cool bit of kit: it fully supports popular frameworks such as Laravel and CakePHP, and will run PHP/HTML/CSS/JS freely on Windows, Mac & Linux.

I would write a pretty little tutorial to show you how to install it (which is btw is incredibly easy), but the Nightrain guys are so good they’ve made platform-specific videos to show you (WindowsMac). Nightrain comes with PHP 5.5+ built in, and can easily run things like AngularJS and Drupal too (there's a preview on their website). The runtime error reporting is excellent, and shows a really nice breakdown for debugging.

I’ve looked into PHP GTK and things like that, but all have either been abandoned, not cross-platform or aren’t as easy to change between distributions.

The best bit, it’s released under the MIT licence & totally FREE/OPEN SOURCE!

With any luck a few people might have a go and it will be interesting to see what you guys think.

broj1 commented: Interesting. Thnx for sharing. +11
diafol commented: Good link +15
almostbob commented: trying to crash it, won't crash, cool +13
Traevel commented: Definitely worth a look, nice! +6
lps commented: nice tools +4
mattster 195 Practically a Master Poster Featured Poster

CMS'/frameworks have vast ability differences. We can talk about generalized pros/cons all day, but the biggest influence should be your ability. If you've written a fairly decent PHP application before, with maybe some experience in OOP, frameworks are an option. If you want to keep it simple and problem-free CMS' might be a better choice.

Content management systems can be extremely restrictive, because all you're
essentially exending a much bigger program. You have to work as part of that program, whereas a framework your application is completely indipendant. However, as mentioned already, a framework is a powerful tool - often too powerful if you're after a generic set of features. Personally I love wordpress, which is great because it provides an excellent platform to extend what they have done - and offers a massive range of plugins and themes. If you use a framework, however generic, you've got to do most of it yourself. Sometimes it's simply not worth it - most people would ask "can I do it fairly easily in a CMS?" if no, use a framework.

The thing I like about frameworks over writing everything is the security and efficiency. Often I look at bits of code and see dozens of costly mistakes (even in CMS based applications), and always worry: what if I did that in one of my projects? Imagine the damage if someone hacked one of my programs. For most levels, frameworks offer a degree of safety - if you follow the simple …

diafol commented: good point wrt security +15
mattster 195 Practically a Master Poster Featured Poster

No worries, you might find you only need the second line - I can't quite remember and haven't had a chance to test it yet.

BTW, if you're ever stuck with regex, look at this: https://www.regex101.com/

It's a great testing tool for a whole load of languages, but allows you to experiment and walks you through everything that happens during validation. I'm sure you will have seen there is no end of help with Regex' out there if you want something fairly specific.

Rep is greatly appreciated if I helped at all :)

mattster 195 Practically a Master Poster Featured Poster

Try this:

RewriteCond %{QUERY_STRING} (id=(.+?)&)(category=(.+?)&) [NC]
RewriteRule ^page.asp(.*)$ page.asp?%1category=%2 [R=301,last]
mattster 195 Practically a Master Poster Featured Poster

I've had a little go, based on what's been said already:

http://jsfiddle.net/2nphygu1/

It's a really basic CSS(3) example, and hasn't got any links or anything attached. Hopefully it's easy to see how this can be expanded on and developed how you wish. Play with it to get it looking how you'd like.

It works by relative positioning, shoving the badge in the top right (float:right), and then positioning it exactly where you'd like it to be (position:relative; top:-8px;...). Then a few margins, colours and a bit of padding to make it look pretty.

Looking at your example, I have used the Font Awesome SVG libary to replace the icon, and used plain text/html for the rest. I think this is faster and more efficient than loading an image, but the same CSS theory applies if you wanted to use an image instead.

Hope this helps!

diafol commented: Good +15
mattster 195 Practically a Master Poster Featured Poster

This is possible, but you will also have to look into something called Port Forwarding. Normally outsiders can't go anywhere near your stuff, so your broadband prevents this, so you have to turn that off.

What you are essentially doing is giving the world free access to your computers filesystem - EXTREMELY DANGEROUS. Free hosting or very cheap hosting is FAR safer, because even these companies invest a fortune in expensive firewalls (which you simply cannot have). A little bit a year is well worth the world of problems you'll get by doing this.

Take my advice: NEVER do ANYTHING like this UNLESS youre Einstein.

mattster 195 Practically a Master Poster Featured Poster

As @deceptikon says, your ability isn't defined by not knowing Linux (in fact not a great deal different with PHP). And it certainly is not the end of the world if you've never used it before.

As a programmer, our job basically is translating. We are the ones who can communicate to computers, telling them what other people want them to do. Computing is such a vast and expansive industry, and every minute a new tool is released that will make your life ten times easier. For that reason (and the fact it always helps a CV), I think it's always useful to experiment with new technologies. It helps you become all rounded, and with different technologies come different techniques you might come across, which will help everything you already know.You might also find something you like loads more than what you're already using, something far simpler and far more powerful.

In a nutshell, there will NEVER be any harm in playing with something new. Linux specifically, I find it easier to develop with in certain languages, a nightmare with others - personal opinion. The only way you'll make an opionion is to go find out!

mattster 195 Practically a Master Poster Featured Poster

You can look at this article for some ideas: http://exisweb.net/responsive-table-plugins-and-patterns

You can use CSS3 'breakpoints' to do display:none; on mobiles for certain screen sizes. Additionally, you can have a wrapper div and set overflow:scroll, like this:

// HTML
<div class="table-wrapper">
    <table>
    ...
    </table>
</div>

// CSS
.table-wrapper {
    min-height: .01%;
    overflow-x: auto;
}
@media screen and (max-width: 767px) {
    .table-responsive {
        width: 100%;
        margin-bottom: 15px;
        overflow-y: hidden;
        -ms-overflow-style: -ms-autohiding-scrollbar;
        border: 1px solid #ddd;
    }
}

Here's a jsFiddle. (Code taken from the Bootstrap Project)

There's lots of things you can do, but personally I find this the most multipurpose and easy to use.

mattster 195 Practically a Master Poster Featured Poster

I'm a big fan of the mobile view, as I nearly always get article updates by email, go to look at them on my phone and it doesn't work. Especially as things like IPS4 are developing their efforts in responsive design, it's an ever-increasing feature that is only going to become more popular.

Show me something better and I'll consider it.

Maybe we should just open it out properly to anyone who can provide an image concept by the end of January and any good ones get taken on? Maybe even make it into a competition-style event.

diafol commented: that sounds dandy +0
mattster 195 Practically a Master Poster Featured Poster

Without sarcasm th world would be a very very boring place aha ;)

we should try to avoid feeding them if possible.

Will do, but hopefully still useful to Googlers if they find this one day I guess

mattster 195 Practically a Master Poster Featured Poster

Sorry @diafol, didn't read your comment before posting that.

mattster 195 Practically a Master Poster Featured Poster

Most of the time you would use CSS breakpoints.
For instance:

/* Smartphones (landscape) ----------- */
@media only screen and (min-width : 321px) {
    /* Styles */
}

/* Smartphones (portrait) ----------- */
@media only screen and (max-width : 320px) {
    /* Styles */
}

To organise things responsively, you need to look at a grid system. Lets say you have two images next to each other, and when you resize to below 320px (portrait mobile) you want the images to be next to each other.

Heres a jsFiddle demo. It's stupidly basic, and if you want to build an entire site on it, look at Bootstrap or PureCSS grids. These projects are fully developed and will handle anything you ever wanted... perfectly.

mattster 195 Practically a Master Poster Featured Poster

i don't know how i can allow my client to create news pages in that panel if i do it.

I agree with @gabrielcastillo, a framework is the SAFEST and MOST EFFICIENT way to accomplish this, and to be honest they're fairly easy to learn.

IF you really wanted to do this yourself, start by creating a form. On this form use TinyMCE, take the value of this textbox, and through PHP enter the value of this textbox into the database (use the MySQL TEXT datatype for your column). There is no need to insert an entire page, just the content you need.
All you have to do is draw this record out of the database using PHP and spit it onto the page.

So there, a quick roundup of how to store larger elements of content in a database. It's the same way that WordPress does it.

Hope this helps!

chrisschristou commented: thank you it is usefull :) +2
mattster 195 Practically a Master Poster Featured Poster

I see one way to do this (and someone else might have another idea):

I would create a table that logs the user, the score and the date. Then you can do lots of queries to locate what users scored on certain days, providing a very accurate reading to what they've achieved and when.

To locate what user "1" scored on the 10th October, you'd so an SQL query like:

SELECT `score` FROM `ScoresTBL` WHERE `user_id` = 1 AND `date` LIKE '2014-10-09%'

NB: Assumes date is the MySQL date format (YYYY-MM-DD HH:MM:SS)

This to me is simple enough and should be a step on the right lines, but could be fairly intensive on the database and maybe could be refined.

mattster 195 Practically a Master Poster Featured Poster

I use pure PHP.

Mangled in with HTML. I completely agree with @iamthwee, your future projects would seriously benefit from some sort of framework.

IF you are doing this for someone else, it's in the worlds interests that your script will be safe (for clients and visitors alike), and by having such massive security holes is just asking for it.

CodeIgniter (or any other framework) will take so little time to learn, but the lives it saves through protecting code and maximising efficiency. If I were you, it's not just for ease of coding we're suggesting this, but for serious practical reasons as well.

iamthwee commented: agree +14
mattster 195 Practically a Master Poster Featured Poster

Use the following code, I missed a ; on line 23 above.

$output = '<div class="panel-group" id="accordion">';
$stmt = $db->query('SELECT postID, postTitle, postURL, postDesc, postDate FROM posts ORDER BY postDate DESC');

while($row = $stmt->fetch()){
    $output .= '<div class="panel panel-default">
        <div class="panel-heading">
        <h4 class="panel-title">
        <a data-toggle="collapse" data-parent="#accordion" href="#';
    $output .= $row['postID'];
    $output .= '">';
    $output .= $row['postTitle'] ;
    $output .= '
        </a>
        </h4>
        </div>
        <div id="';
    $output .= $row['postID'];
    $output .= '" class="panel-collapse collapse in">
        <div class="panel-body">
        <p>Posted on ';
    $output .= date('jS M Y H:i:s', strtotime($row['postDate']));
    $output .= ' in ';
    $output .= $row['postDesc'];
    $output .= '</div></div>';
}
$output .= '</div>';
mattster 195 Practically a Master Poster Featured Poster

I think this clip sums it up perfectly aha.

Just because Microsoft would like to point out that they are soo different from everyone else, they must reinvent counting to ten. But agreed, they never learnt from Vista and decided to release another catastrophe two versions later, namely windows 8.

The preview looks pretty, well, good.... Hopefully it will perform as well as it looks.

mattster 195 Practically a Master Poster Featured Poster

Well it's nice to see someone using OOP for a change in the paginator class. Try to keep to this good habit aha.

Simply put the while loop inside your code where you want the loop.

while($row = $stmt->fetch()){
    echo '<div>';
    ...
}

If you're on about inproving the PHP while you're here, take a look at this.

# Keep this at the top of the page with all of your code
$output = '';
while($row = $stmt->fetch()){
    $output .= '<div>';
    ...
}

# Shove this where you need the output
echo $output;

The above is a much neater way of managing your code, and is far more easier to understand.

I'm not quite sure how you plan to use this in your code. If you want to use the collapse in Bootstrap, use the following code in the output loop above (have assumed the column postID, just change this to your Primary Key:

$output = '<div class="panel-group" id="accordion">';

while(..){
    $output .= '<div class="panel panel-default">
        <div class="panel-heading">
          <h4 class="panel-title">
            <a data-toggle="collapse" data-parent="#accordion" href="#';
    $output .= $row['postID'];
    $output .= '">';
    $output .= $row['postTitle'] ;
    $output .= '
            </a>
          </h4>
        </div>
        <div id="';
    $output .= $row['postID'];
    $output .= '" class="panel-collapse collapse in">
          <div class="panel-body">
              <p>Posted on ';
    $output .= date('jS M Y H:i:s', strtotime($row['postDate']));
    $output .= ' in ';
    $output .= $row['postDesc']
    $output .= '</div>

      </div>';
}

$output .= '</div>';

It's huge and clumsy, but will give you a starting point. Also maybe develop the PHP into …

mattster 195 Practically a Master Poster Featured Poster

You can easily do this with the temporary file using the getimagesize() function

$image_info = getimagesize($_FILES["file"]["name"]);
$image_width = $image_info[0];
$image_height = $image_info[1];

The easiest way is to take the above, and use an IF statement to check it with whatever limit you want. For example:

if($image_width > 30)
{
    echo "Image too big";
    exit();
}

The other, cleverer, option, is to resize the image yourself upon upload. Take a look at this tutorial if you are interested. As I say, this is a bit more complicated though.

mattster 195 Practically a Master Poster Featured Poster

If everything is contained within the same file, a static should be able to handle it. Without seeing your code it's difficult to tell. Just use some basic markup like:

class globals 
{
    static $var = "Hello world.";
}

echo globals::$var;

There's no reason why a global shouldn't, because if you're using classes you can call it in, and if you're not, a standard variable will be kept in memory throughout your script. Personally I find this a rather unorganised way to sort out your code though.

Finally, a superglobal is possilbe using the $GLOBALS variable to retrieve values. Again, it works but it's not very tidy.

So you're probably best in most cases to use a static, but thats only a generalised thing and in some cases I imagine one of the others might be better.

raicabogdan commented: agreed with this +0
mattster 195 Practically a Master Poster Featured Poster

I need to select '#foo #three' using 'this' to get this result

Smells like homework to me?

Well learn what the .text() function is and how to use it, because that's very helpful. Only requires one simple google.

Your code essentially does this: #foo -> #three -> div:first, which of course would only match the following HTML:

<div id="foo">
     <div id="three">
        <div>mouse</div>
     </div>
</div>

I think you need to be clear about what you're trying to achive, why you need to achieve it, and why you need to use this.

Notice how this entire answer could've been found on google if you'd have bothered to look, and then asked an actual question when you can't get it working. Lazy.

mattster 195 Practically a Master Poster Featured Poster

Well assuming everything else is in order, try this in your code:

$startYear = 1997; # Define variable here, I've used '1997' as an example, note that there's no commas to make it a text value.
if ($startYear == "") {
    $startYear = NULL;
}
mysqli_query($con, "INSERT INTO Application (startYear) VALUES (".$startYear.")");

I think it might be giving 0, because the value entered is not an integer, so hopefully the above code will help solve that. When inserting integers, there is no need to use quotes, as all this does is makes it a string, which of course will not be accepted.

mattster 195 Practically a Master Poster Featured Poster

SQL cannot in any way be executed by Javascript. Bad idea.

Instead, you can use AJAX:

$.ajax({
  type: "POST",
  url: "delete.php",
  data: { comment_id: 12345 }
})
  .done(function() {
    alert( "Comment successfully deleted" );
  });

The above code will send off the comment id using the post method via AJAX. All you need to do is shove this into your code above, change the comment_id to the actual id of the comment you're deleting, and write delete.php to take the $_POST variable and delete the comment using SQl.

mattster 195 Practically a Master Poster Featured Poster

You can achieve this with a really simple jQuery script. I've used one from here, so it's just a case of changing the background attribute with a bit of jQuery magic.

Here is a jsFiddle of how the script can be used, so all you have to do is adapt it for purpose.

mattster 195 Practically a Master Poster Featured Poster

For a start, remember mysql_* functions are outdated in PHP now, so a much better idea to use mysqli_ or PDO. There is also no need to open and close PHP tags (e.g. line 38 + 40), and no need to have an empty else{} statement.

Next, your script is hopelessly insecure. You need to have a qucik read up on SQL injection, as none of the variables are being sanitized.

At the top of your script you have isset($_POST['add']), yet there is no "add" field in your form, so none of the rest of the code will execute.

mattster 195 Practically a Master Poster Featured Poster

Personally, I've never had a problem with Google Fonts. It is a vast library containing soo many free fonts to suit every purpose.

A general font, like Open Sans or Ubuntu, should be able to cover just about any need when it comes to size and formatting. However, some fonts are more decorative and can only really be used in big headers. Achieving the size and display of a Google web font is easy peasy, and looks great. Just a case of selecting a decent font.

In terms of ease of use, there is no comparison. Any noob could get web fonts up and running, simlpy of case of follow the two steps. Both of which copying and pasting code.

Browsers love this stuff, EVEN IE 6 can handle it: case closed. If IE6 can cope, think no further. It also works on mobile decvices etc, so you have complete freedom and flexibility. If in the rare instance webfonts are not supported, the next item in your CSS will be selected (so no big panic).

The sheer beauty of using CDNs/Hosted libraries is that they're bloody powerful. Google spend millions on super-fast servers to deliver them soo quickly (and it also reduces your bandwidth etc.)

So overall, Google web fonts are pro, and well worth looking at. Look here for the official FAQ.