mmcdonald 28 Posting Pro

This is pretty straight-forward and is usually easier than most people think. What I would do is call a function in the onchange attribute. In the following example the onchange attribute will be watching a dropdown, so the function will be called upon when the value of the dropdown changes:

<select onchange="myFunction()">

Then in my script I could have a javascript function with a jQuery AJAX block:

function myFunction(){
    $.ajax({url:"script.php", success:function(result){

        something here to output the result, like a div update.

    }});
}

Then in script.php validate and execute your SQL query. The need to call upon another script arises from Javascripts inability to communicate with the server, unless you're using node.js, which is a totally different kettle of fish. Javascript is a client side language and everything it does is completed in the users browser. By using jQuery's Ajax we can call upon a server side script from the users browser when a change is made.

I hope this makes sense, but I didn't have much from you to work with.

See more: http://api.jquery.com/jquery.ajax/

Regards,
M

mmcdonald 28 Posting Pro

A fluid container with two columns is the way I would proceed.

If you want to play around with BS3 forms before you begin check these out:

A form builder:
http://bootsnipp.com/forms?version=3

Some useful example code (All credit to 'pppeater'):
http://www.bootply.com/pppeater/jrNvaahcOh

Write some code and then post it here and we can all take a look and shuffle bits around :)

Regards,
Michael

mmcdonald 28 Posting Pro

Good news people - problem solved!

After hours of... cursing... the problem was caused by a very close friend who hid a very sneaky <form> tag towards to the top of the page. Turns out it's payback for going on a date with his ex-ex-ex-ex (Four times removed).

Last time I leave my PC unlocked when he visits!

mmcdonald 28 Posting Pro

I agree with Simplypixie and always believed the WordPress programmers should have built 3 models. 1 for bloggers. 1 for webmasters. 1 for webmasters who also like to blog. :)

mmcdonald 28 Posting Pro

Okay for anyone who needs this in the future. It's come down to me creating a wildcard CNAME record and then telling users to point their domains to bob.mywebsite.com. Then I'll use code like this to collect the value of the subdomain in order to pull up the correct site settings for that user:

$url = '$_SERVER["REQUEST_URI"]';
$parsedUrl = parse_url($url);
$host = explode('.', $parsedUrl['host']);
$subdomain = $host[0];

Using bob.example.com, $subdomain would have the value of bob.

Thanks to JorgeM for helping my get my head around this process!

mmcdonald 28 Posting Pro

Disadvantages are lack of control to users who have no or little programming experience. The framework can throw a user right off! Another disadvantage is that it's a very well-known framework meaning that hackers and attackers find it easy to work around basic security - there are great plugins to make a blog almost unbreakable - again it comes down to user experience and research.

Upgrading your wordpress blog is required to use the latest plugins. Failure to do so and then installing a plugin that isn't compatible can ruin your blog (I've even seen many instances of people closing down their blogs because malicious plugins have ruin their data ... their own fault really). People also go plugin crazy which devours resources, keep it under control :)

Another disadvantage is SEO - WordPress, unless you know what you're doing, is an SEO ASSASSIN! Repeat tagging without noindex can lead to crawlers registering duplicate content time and time again - it can kill your SEO.

There aren't many disadvantages and I honestly think the advantages seriously outweigh the disadvantages.

Goodluck!

mmcdonald 28 Posting Pro

You can temporarily use a service provider such as GMail, Yahoo and Hotmail for testing your script, even locally.

I always use the PHPMailer class (It's active on 3 projects of mine) and it hasn't let me down once.

Michael

mmcdonald 28 Posting Pro

Hi and welcome! If anyone asks where you came from tell them mmcdonald sent you... it may not be true (It isn't.. but they don't know that), and I'll send you a cookie. That way you get a cookie and I get a pat on the back :3

DaniWeb is a great place to learn and over the last year I have picked up so much. In fact a year ago I didn't really know anything about programming at all!

If you want the best responses just be clear with your questions and they will usually just roll in. Don't be lazy though and make sure you have a go at something first! No one will mock you here for posting weak or insecure code; so be confident!

Good luck with you learning,
Michael

Dani commented: Great advice +0
mmcdonald 28 Posting Pro

These gys are probably one of the best fre hosting providers out there. Remember, you can't ask for much when you aren't prepared to pay.

http://www.biz.nf/

mmcdonald 28 Posting Pro

That's a kickass question my friend! Requires a lot of time, have you instead revised transitioning and studied a healthy tutorial?

http://css3.bradshawenterprises.com/transitions/

Could recommend it enough for clarity making it dead easy to grasp :) I've got it bookmarked!

mmcdonald 28 Posting Pro

So when the new monthly depreciation is 20 the new accumulated depreciation becomes 120 because the previous accumulated value was 100? Am I correct?

Correcticus!

If an asset has the value of £1000 and depreciates over 24 months then it has an annual depreciation value of £500 and a monthly depreciation rate of £41.67. The Accumulated depreciation of the asset between months 1 and 10 is £416.70. The value of the asset at month end 12 is £500.

My assets all have fixed depriciation, thankfully! :)

cereal commented: thanks for the explanation +11
mmcdonald 28 Posting Pro

Would it not be more effective with the majority of the grey at the bottom such as in this edit: http://masterthepc.com/test.jpg in comparison to http://turningheadssalons.com/Images/Background_New.jpg

All I've done is twist the grey and drop it to the bottom.

mmcdonald 28 Posting Pro

Has the service stopped running?

On Windows:
Start Menu > Run > Type: 'services.msc' > Hit enter > Find 'mysql' > Right Click > Click 'Start' if not already running.

mmcdonald 28 Posting Pro

Define bugger? :)

If your BG isn't always fitting 100% then you can use the new CCS3 properties:

html { 
    background: url(images/bg.jpg) no-repeat center center fixed; 
        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
}

That works 100% in:
* Safari 3+
* Chrome Whatever+
* IE 9+
* Opera 10+ (Opera 9.5 supported background-size but not the keywords)
* Firefox 3.6+ (Firefox 4 supports non-vendor prefixed version)

This is another great option, very reliable:

img.bg {
    /* Set rules to fill background */
    min-height: 100%;
    min-width: 1024px;

    /* Set up proportionate scaling */
    width: 100%;
    height: auto;

    /* Set up positioning */
    position: fixed;
    top: 0;
    left: 0;
}

@media screen and (max-width: 1024px) { /* Specific to this particular image */
    img.bg {
        left: 50%;
        margin-left: -512px;   /* 50% */
    }
}

Works in:
* Any version of good browsers: Safari / Chrome / Opera / Firefox
* IE 6: Borked - but probably fixable if you use some kind of fixed positioning shim
* IE 7/8: Mostly works, doesn't center at small sizes but fills screen fine
* IE 9: Works

Don't be fooled - I didn't write the above, but I use it so regularly that I'd saved it in a text file in my development folder :) The original article can be found here.

mmcdonald 28 Posting Pro

I have no comments regarding navigation (sorry) but I would add some line height to your scrunched up paragraphs, see here: http://turningheadssalons.com/aboutus.html

The text looks really scrunched, add a line-height style. I usually set my line height value to 1.3 x font size. So if I'm using size 18 font I set my line-height to 23.

Looks like a nice design though - well done!

mmcdonald 28 Posting Pro

As the other two said... don't do it, not when there are really cheap packages out there (and some free ones!). If you do this a lot and know a lot of people in a similar situation perhaps you can split the hosting host and setup come security. You should of course only do this if the other people you're sharing with are family or best friends. Even then it's VERY risky and just not ideal.

I have an old PC setup on my second line that has 1GB RAM and an 80GB HDD - it's got Ubuntu 10.04 installed (Well.. the complete LAMP stack), and I use it for when any friends, clients or family want to test/review an unfinished project. It also acts as a lovely server for all of my families photos and such :3 It's always nice to login and find that your mum has uploaded baby photos for the whole clan to see -.- using a laptop/desktop to host something isn't difficult, not at all, securing it without knowledge and keeping it up 24/7 is of course another kettle of fish.

mmcdonald 28 Posting Pro

I agree with perlexed, it looks as though you're asking for a game_id when... well when you already have one?

SELECT `game_id` FROM `games` WHERE `game_id`=

I personally would use the SQL like function, because if the users search term doesn't match your predefined name EXACTLY, you'll get no results.

The MySQL LIKE operator will return results with a similar value to the submitted search term.

mmcdonald 28 Posting Pro

Create another file called 'populate.php' or something similar, in this file you're going to write standard PHP that includes a DB connection, the collection of data, based on the users input, and then the population of fields.

This in your original file (where the dropdown and the table exists) add something like: <div id="populatedTable"></div>.

What you then want to do is call in the populate.php script using AJAX, but with a variable URL containing the value of RMA; something like this:

<div id="populatedTable"></div>

<script type="text/javascript">
    // reloads populated table every 10 seconds

    var auto_refresh = setInterval(
        function (){
            $('#populatedTable').load('populate.php?rma=<?php echo $rma; ?>');
        }, 10000
    );
</script>

Then in populate.php you need to use $_GET['rma'] and construct your MySQL query based on that value.

Instead of the 10 second refresh timer you can choose to make it refresh once after the users imput is detected from the dropdown using JQuery.

To be honest, you're bascially asking someone to teach you AJAX, and we can't do that, it's simply too much. Teach yourself JQuery and AJAX from YouTube or another tutorial and then come back when you need some help with your new code, only then will our help be genuinely beneficial to you.

Michael

mmcdonald 28 Posting Pro

I can't recall exactly where it is, but apache blocks http and https access to the folder named cgi-bin, if you rename it you'll have access instantly.

In your hosts file, apache config or somewhere similar, perhaps your cgi library folder! (I can't quite remember...) actually... Just run a scan for any part of this to find it:

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">

And then change the settings:

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

Then restart the apache service. You should be able to browse into that folder. I had to do this for a project once and found that setting up a simple symbolic link solved the issue.

Also, as a side note, this question was best aimed at the LAMP category ;) Either way I hope it sheds some light onto your situation!

Michael

Ancient Dragon commented: Thanks +14
mmcdonald 28 Posting Pro

You'll have to forgive me as I might have missed the topic, I'm not to sure, but why not use any development environment and then have a web browser to view the code? Seeing as HTML, JS and CSS are all web based languages?

I'm a lazy bugger so I develop locally, I have chrome on one monitor that uses an extension to refresh every 5 seconds and my development environment on my main monitor.

As a personal opinion it works fine for me, but I can understand why it's not everyones cup of tea.

I use PHPDesigner8 for web application development (ignore the name, it does way more than just PHP), and it does have a run/view screen & tool for previewing HTML from the environment.

daino commented: good idea with chrome +3
mmcdonald 28 Posting Pro

A third party one or the windows one? How did you manage to uninstall it?

I'm goin to gather the Windows one, and in which case I think it's disabled if anything not uninstalled. To get it back you should do this!

Good luck,
Michael

mmcdonald 28 Posting Pro

Highly confusing as JorgeM has politely pointed out. Are you trying to collect the username from the record that has the user_id of 3? What do you mean recipient? Are you constructing a script in a programming language at the same time too? Get back to us when you have enough time to... type?

mmcdonald 28 Posting Pro

If you're just trying to redirect why aren't you using the header(); function and placing the form processor code (Your isset code) above any HTML on the page to avoid headers already sent errors?

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "valide")) {
  $insertSQL = sprintf("INSERT INTO commande (client, `date`, subtotal, total) VALUES (%s, %s, %s, %s)",
                       GetSQLValueString($_POST['client'], "text"),
                       GetSQLValueString($_POST['date'], "date"),
                       GetSQLValueString($_POST['subtotal2'], "double"),
                       GetSQLValueString($_POST['total'], "int"));
  mysql_select_db($database_marketbase, $marketbase);
  $Result1 = mysql_query($insertSQL, $marketbase) or die(mysql_error());

  $insertGoTo = "myspace/order-line.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }

  //This will take user to your defined location
  header('Location: http://url.com/'.$insertGoTo);
mmcdonald 28 Posting Pro

Nice words Mitch and yes Dani and the team have done a wonderful job - but they're still being penalised by Google as the crawler is indexing DW as a blog and not a forum - that can be quite damaging when Google users enter search terms that are questions rather than statements.

Dani is on a hunt for the best Whitehat SEO tactic that will force the Google crawler into indexing DW as a Forum.

mmcdonald 28 Posting Pro

Are you trying to acheive something like this:

<?php echo number_format($row_total['sub_total'], 2, '.', ''); ?>

?

From the looks of it you're trying to use the number_format function on an array reference? You should instead call the function on the array variable itself. Does that make sense?

mmcdonald 28 Posting Pro
RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)$ /index.php?a=$1&u=$2 [L]

The original URL:
http://website.com/index.php?a=profile&u=username
The rewritten URL:
http://website.com/profile/username

Hope I've got it right,
Michael

mmcdonald 28 Posting Pro

G'day daniwebers!

I just ran into this: http://www.daniweb.com/web-development/web-design-html-and-css/threads/463119/responsive-web-designing- and it made me think about a community driven and maintained resource database? Is this something that's been thought of before and swept under the carpet? If so - could we bring it back in to the light?

I'm always crawling the web looking for the next useful tool and if we could construct our own database on DW of recommended resources... it could help a few? It's something I'd use frequently.

Thoughts?

Thanks,
Michael

mmcdonald 28 Posting Pro

Okayyyyyyyy first of all I'm not downloading some random .rar file :)

Second of all yes you are on track. Keep yourself up-to-date with the latest graphics engines jsuch as havok and ensure you're well aware of engine application. It's great that you developed a game on your own - building a portfolio really is the best way to secure yourself an interview with a major games development agency.

Don't rely on your computer science degree however, remember: "Anyone can get a deree". What employers in this industry are really looking for is evidence of your skills, passion, creativity, general knowledge (common sense) and the ability to innovate existing technologies.

You're about to target one of the most highly saturated employment markets making it one of the hardest jobs to secure. To increase your chances of securing a position within the ranks (as a junior) then complete your degree with an Hons 1:1, get yourself a masters degree (or your countries equivilent) and then pack out your portfolio.

Good luck,
Michael

mmcdonald 28 Posting Pro

DONT DO A SYSTEM RESTORE. I hope this gets to you quick enough. One of the worst things to do to an infected machine is execute a system restore.

Boot yourself into Safe Mode and start checking your event logs, look for unusual activity. Whilst in safe mode you should also use your AV to run a scan. If you have avast then you should boot into safe mode and execute a full boot scan.

It's not always a virus - have you been playing with any OS critical files or drivers?

A serious question though... why are you relying on Windows Defender? That's one of Microsofts biggest fails alongside Vista and the Microsoft Surface.

mmcdonald 28 Posting Pro

Hi Vivosmith and sorry for the slow reply.

Choosing a career shouldn't depend on your skillset but instread on your end goal - where do you want to be in 20 years time?

Get a pencil and some paper, in the middle draw a line - you're about to utilise the 'rubber band' model. On the left hand side write all of the things pulling you towards MIS and on the right hand side list all of the things pulling you towards finance. When you're done the side with the greatest weight (personally to you) will cause the band to break - this is the option you should choose.

Alternatively, if you feel you can handle the work load, do both. Degrees in finance are often overlooked as the market is saturated (Everyone has a bloody degree!) so what you could do is sit a degree in MIS whilst studying vendor certifications such as AAT and CIMA for finance and finance management in your spare time or visa-versa. You should however note that according to sociologists and some other no-life-boffins, training in multiple skills makes you, in their terms, a 'slasher'. Slashers are supposedly less effective in all of their skills due to their lack of focus on a single trade.

I hope something above helps you to make your decision but you must remember that this is a HUGE decision and will play a key role in the next few decades of your life. The choice must be yours …