mattster 195 Practically a Master Poster Featured Poster

Ahh right fair enough, nothing to worry about then ;)

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 cant even see what for.

Agreed. I think he may have a point here though. I have down votes, and would like to increase my rep while I'm here, so am very keen to learn from mistakes.

I look at it like this: if we can't view our mistakes/downvoted posts, we can't learn from it and develop our answers for the future (in my opinon anyway).

So is there a particular reason why I can't see my downvoted posts? Or is it generally taken arount these parts not to worry about it?

Just questioning as usual ;)

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

Notice: Undefined variable: image_id in update_image2.php

Means exactly that. There is no $image_id either being defined or assigned. So this might mean that there is no $_GET or $_POST called image_id, or the bit of your code used to provide the form action (which we can't see) is being referenced wrong.

Start by confirming update_images.php is being loaded with image_id data included somewhere (get method in url or post in forms).

mattster 195 Practically a Master Poster Featured Poster

I have replicated this in jsFiddle, and all is working okay.

Your alert script will not kick in until $("#dd-event").change() is called (as its within an IF statement).

So as soon as you click on the dropdown and change the value, your script suddenly works, giving the appearance that jQuery isn't firing. If you want to change this, simply bring your code out of the IF.

Example: (Begins line 17)

else
{
    $(".contact-list").load("showUser.php");
    $(".container-buttons").show();
    $(".guest-names").empty(msg);
}

$(".contact-list .name-row").on("click",function(){
    alert("clicks.");
});
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
echo '<td><a href="studentmgt.php?student_id='.$data['student_id'].'" onClick="return confirm("Are you sure you want to delete this")>Delete</a></td>';

Will never work, because your quotes are mixed up. Try this:

echo '<td><a href="studentmgt.php?student_id='.$data['student_id'].'" onClick="return confirm(\'Are you sure you want to delete this?\')">Delete</a></td>';

And for Javascript, you just shove it at the bottom of the html page, just before the </body> with the jQuery library. If you're unfamiliar with AJAX and such like, try using @Sikander Nasar's idea.

mattster 195 Practically a Master Poster Featured Poster

I'm sorry I've made a mistake and told you wrong! You were right with fopen()!

In the documentation, it states that in fgetcsv(), the length parameter became optional in v5. In v5.1.0+, you can set it to "0", which means unlimited.

If your PHP version is less than v5.1.0, you must set the length parameter must be greater than the longest line (in characters) to be found in the CSV file. This could well be what is causing your problem.

Sorry for misleading you there!

mattster 195 Practically a Master Poster Featured Poster

Why don't you use file_get_contents() instead if you're only reading the file?

This should produce pretty much the same result, but doesn't worry about handling files etc.

I really can't imagine it's anything to do with the platforms - but maybe version. file_get_contents() will work on v4.3+, but realistically you should ALWAYS use v5, because they release a new version for a reason. Normally it's things like security updates and new functions, which both are vital to the protection of your script but can also enhance it (either way pretty worthwhile).

mattster 195 Practically a Master Poster Featured Poster

Platform shouldn't make a difference. These are PHP errors, and will show up no matter what platform you are running on.

Are you CERTAIN the file /uploaded/606.txt exixts?

And it might be worth trying this: $target_path = "uploaded/";

Because it is common practice to use ./ or simply nothing, because all this does is refers to the directory your PHP file is in. When looking for other files, PHP (and any other language) always starts in the same location as what the PHP file is in. So therefore there's no need to tell it where to start looking from if it already knows - if you get what I mean?

mattster 195 Practically a Master Poster Featured Poster
$allowtype = array_merge($imagetype, $file_type);

Because you're using a double quote, your two variables aren't being inserted into the array. Use array_merge(), it will combine both of your arrays accurately.

mattster 195 Practically a Master Poster Featured Poster
echo "<input type='text' name='newstitle1' value='".$row['news_title']."' />";

You got your "'s all mangled up. There's no attribute opening to the value, and no closure of the value attribute and the input tag itself, but also you're not actually sealing the echo statement.

Try to use ' and " respectively, not only does it make it easier to see, but also easier to insert data accurately.

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 need to make $body equal it's new value. That explains why theres no content coming through, because $bodys isn't actually placed into the mail().

$body .= $bodys . "</body></html>";
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

I took your original screenshot and had a play, and here is what I managed: jsFiddle.

It's hardly perfect and there are so many cool things you can do to expand on it (check this out), but it does what you hopefully originally wanted.

mattster 195 Practically a Master Poster Featured Poster

Javascript cannot specify download locations of any file. That would be a serious security problem.

In most cases, I don't see what the problem is letting the user pick themselves where to save downloaded files? What exactly are you trying to do this for? Unless you're doing something malicious I can't see why it would cause a problem.

mattster 195 Practically a Master Poster Featured Poster

Dispite other errors in the code, mail() needs the following parameters:

to, subject, message (, headers etc.) (See here)

No from. So this will cause a problem.

Your HTML is invalid, as you are closing the body tag, and then placing the content, and not closing it and the HTML tag off. Change line 28 to <body>, and add to line 36 $body . $bodys . "</body></html>";.

Line 7 should be: $mailimg = '<a href="http://google.com/"><img src="http://www.mysite.com/custom_images/images/'.$img.'"></a>'; assuming that $img is something like "home.jpg" etc.

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.

mattster 195 Practically a Master Poster Featured Poster

Awesome! That worked!

Nice one, please upvote and mark solved :)

And yes that css-tricks.com example is great, but not so helpful for what you needed.

mattster 195 Practically a Master Poster Featured Poster

When you send an email using your code, but instead of PHP dynamically putting content into the email, you manually type it in yourself. It's to check to make sure the PHP function is actually capable of sending an email.

mattster 195 Practically a Master Poster Featured Poster

<img src="sills/cat_image_sill.png"><span><span></a>

What the hell is going on here aha? <img> tags can't have child elements and god knows where the </a> came from.

I've solved your problem using some more efficient and better-practicing CSS: jsFiddle

mattster 195 Practically a Master Poster Featured Poster

Here is an example of a 3 layer menu with some styles added to it, so maybe try adapting it?

It's only your HTML and CSS arn't quite there. Hope this helps :)

mattster 195 Practically a Master Poster Featured Poster

Yes you can use javascript to do it, and your syntax is correct.

Or you can apply CSS direct to an image, like this:

img.clip {
    position: absolute;
    clip: rect(0px,60px,200px,0px);
}

Either one would work, depending exactly how you'd like to apply it. Personally I'd use CSS, unless you have to change the clip sizes for each image.

But as you're trying to set propotions from a user-uploaded image, maybe not a good idea to use clip, as they might think the image has uploaded wrong and throw a fit. Try looking at alternate methods, such as height/width, positioning, scaling etc etc.

Note: Avoid inline styles, use a CSS stylesheet instead. Make your code consistant, either close the <img> or don't (depending if you're HTML5 or not). Just for future note, you cannot self close a <div>, it needs to be: <div><img></div>. This may be what's causing you a problem.

mattster 195 Practically a Master Poster Featured Poster

Hi there, try this:

HTML PAGE: jsFiddle

PHP:

<?php
// Connect to DB

$result = mysqli_query($con,"show tables");

while( $row = mysqli_fetch_array($result) )
{   
    echo "<option value='". $row[0]. "'>" . $row[0] . "</option>";
}
?>

Note: Your <option> tag was being closed in the opener, and there are a few minor errors in your code, but for the purpose of helping I've stuck with yours.

mattster 195 Practically a Master Poster Featured Poster

That's really good to know :)

No worries anytime :D

mattster 195 Practically a Master Poster Featured Poster

Sure no worries, its pretty simple aha.
A quick TinyMCE (with CDN) tutorial:

1) Shove this into your page, just before the </body> tag if possible

<script src="http://tinymce.cachefly.net/4.1/tinymce.min.js"></script>
<script>tinymce.init({selector:'textarea'});</script>

And here you are, done! You'll have the default one going, so if you want to snazz it up a bit or change the settings, just alter the bit inside tinymce.init({}) bit.

All it does is changes the look of your textarea, and submits HTML code instead of plain text. So all it is doing is helping your user add HTML to their textarea, if that makes any sence.

mattster 195 Practically a Master Poster Featured Poster

Oh yes sorry my bad, didn't see it.

Maybe try indenting your code.

mattster 195 Practically a Master Poster Featured Poster

ok I got the website to show finally.

Good good, please upvote if any of us helped you with that.

Make sure that Drupal's base URL is set up properly in the admin panel, and if so then use the admin panel to update your content and see if that works.
Avoid doing anything manually or in the database unless you have to, its a deadly game when theres a great admin panel to do it for you.

mattster 195 Practically a Master Poster Featured Poster

But my point remains, you need to actually know exactly what you're going to make first before you worry about HOW you're going to make it.

mattster 195 Practically a Master Poster Featured Poster

Hi there!

mattster 195 Practically a Master Poster Featured Poster

Well exactly, I was just agreeing with you it would be a good idea to have. The mere fact it's common makes it easier for users to use.

mattster 195 Practically a Master Poster Featured Poster

line-height: 26px; will solve your problem, but you need to look at the overall structure of the menu as it's not best practice.

mattster 195 Practically a Master Poster Featured Poster

I do not understand what you are trying to do.

I don't either.

Anyway, if you want to achieve the responsive technique on mobile devices, as I say you have to look at media queries (here and here).

mattster 195 Practically a Master Poster Featured Poster

Maybe not a good idea to use wordwrap() after you've sorted the entire HTML of the message out. Maybe add it right at the beginning if your that desperate to use it, but I would consider some validation instead of just chopping half of the message off.

Apart from that, It could be because you're using <input>, which is submitted as one continual block of text. What you may be interested in is a HTML Editor, like TinyMCE. This will allow you to format your email using HTML, so therefore it can have user-defined line breaks and other formatting bits and bobs.

I can't see anything other thn that in your code, but there could be some issue when calling the send function, so that's the place to look afterwards.

However, be mindful that this type of email can have security issues, so be very careful and just make sure you properly sanitize everything.

mattster 195 Practically a Master Poster Featured Poster

If we could sort out Ctrl + Return for all devices, I'd personally prefer that a lot more.

mattster 195 Practically a Master Poster Featured Poster

It seems people forgot to mention that you need to make it secure — this is my #1 point for everything!

You need something to make before you can make it secure

mattster 195 Practically a Master Poster Featured Poster

I recommend you google your question and see the pros/cons.

I don't think anyone or anything can settle this battle, people have to take the plunge and pick one, and if they like it stick with it. Every single person who knows either (or both) languages will have an opinion that suits them, but will undoubtedly be completely different for everyone else.

Go for it, toss a coin, and start playing. It's the only way you'll ever be able to answer which one you prefer. But please read @diafol's post, as that is perfect advide if you wan't to make any sort of career out of it.

mattster 195 Practically a Master Poster Featured Poster

You haven't closed your while loop here.

mattster 195 Practically a Master Poster Featured Poster

Hi there!

mattster 195 Practically a Master Poster Featured Poster

coal

mattster 195 Practically a Master Poster Featured Poster

Hi there!

mattster 195 Practically a Master Poster Featured Poster

Hi there!

mattster 195 Practically a Master Poster Featured Poster

Hi there Alex!

One of two doing a computing AS level, nice one, at least you'll get lots of help!

Nice to know a proper lurker has been terned to proper member, and seriously its amazing how much you learn just be being here!

C# is slowly becoming my life.

Looks like you're already one of us aha

I'm also looking forward to sharing some projects that I've got in the works in my spare time. Two websites and some desktop applications are slowly gettingthere.

Cant wait to see the results!