Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CSN-UK

Privileged
  • Joined

  • Last visited

Reputation Activity

  1. Like
    CSN-UK got a reaction from mantis in PHP explode/split string by HTML tags   
    If you want to reliabally grab anything in a html document or block of html, its best to treat it as html as such:
     
    $html = 'html contents or file <img src="smiley.gif" alt="Smiley face" height="42" width="42">'; $doc = new DOMDocument(); $doc->loadHTML($html); $tags = $doc->getElementsByTagName('img'); foreach ($tags as $tag) { echo $tag->getAttribute('src'); } This would loop and print out the src attribute of each image, hopefully helpfull, and easily modifiable for a first item, or other uses in future.
  2. Like
    CSN-UK got a reaction from Nillervision in PHP explode/split string by HTML tags   
    If you want to reliabally grab anything in a html document or block of html, its best to treat it as html as such:
     
    $html = 'html contents or file <img src="smiley.gif" alt="Smiley face" height="42" width="42">'; $doc = new DOMDocument(); $doc->loadHTML($html); $tags = $doc->getElementsByTagName('img'); foreach ($tags as $tag) { echo $tag->getAttribute('src'); } This would loop and print out the src attribute of each image, hopefully helpfull, and easily modifiable for a first item, or other uses in future.
  3. Like
    CSN-UK got a reaction from mantis in Duplicate of site on different domain with minor changes   
    Given the context, if it is purely a CSS/style based change then I would use a switch on the CSS served in the header, however I suspect over time there could be more deviation on the content/style at which point wp multi site or switch themes on the fly (rough example http://wordpress.stackexchange.com/questions/3761/switch-theme-on-fly).
     
    If you switch themes you could make use of child themes of the master, thus making change easier. There are also ways to allow a single WP install serve multiple domains (sites) by loading the DB and thus resources based on URL (using a switch statement).
  4. Like
    CSN-UK got a reaction from mantis in importing users into wordpress   
    Although I’ve never really tried it with WordPress it would make sense that if you where to locate the section in the old WordPress installation (if this is the case) in the wp-config.php that defines the Salt values/auth keys and copy and paste to the new install I couldn’t see why it wouldn’t work.

    The section looks like this:
     
    /**#@+ * Authentication Unique Keys and Salts. * * Change these to different unique phrases! * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again. * * @since 2.6.0 */ define('AUTH_KEY', ' '); define('SECURE_AUTH_KEY', ' '); define('LOGGED_IN_KEY', ' '); define('NONCE_KEY', ' '); define('AUTH_SALT', ' '); define('SECURE_AUTH_SALT', ' '); define('LOGGED_IN_SALT', ' '); define('NONCE_SALT', ' ');
  5. Like
    CSN-UK got a reaction from teodora in importing users into wordpress   
    Although I’ve never really tried it with WordPress it would make sense that if you where to locate the section in the old WordPress installation (if this is the case) in the wp-config.php that defines the Salt values/auth keys and copy and paste to the new install I couldn’t see why it wouldn’t work.

    The section looks like this:
     
    /**#@+ * Authentication Unique Keys and Salts. * * Change these to different unique phrases! * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again. * * @since 2.6.0 */ define('AUTH_KEY', ' '); define('SECURE_AUTH_KEY', ' '); define('LOGGED_IN_KEY', ' '); define('NONCE_KEY', ' '); define('AUTH_SALT', ' '); define('SECURE_AUTH_SALT', ' '); define('LOGGED_IN_SALT', ' '); define('NONCE_SALT', ' ');
  6. Like
    CSN-UK got a reaction from mantis in Wordpress Vs. Static HTML   
    It’s certainly interesting to see that the perception of a basic/flat HTML site has moved forward to the extent that they are now considered to be powered at least to some extent as a basic CMS. Which through good code practice/reuse to save time and increase maintenance certainly makes a great deal of sense, even at the basic end of the scale with PHP includes for common page elements (header/footer etc).

    I do however have an opposing thought as to the use of light CMS’s or in particular custom CMS’s as opposed to the likes of WordPress. Such that the power of WordPress or any other similar major CMS, is in its users… as we as humans will find something we like, that works and always invent new or additional features or additions.

    This is evident and greatly supported in WordPress among others with its community in particular providing a plethora of options premade with little to no cost or overhead. Some of the smaller light CMS’s certainly do have similar features and some support certain add-ons but not to the same extent.

    I quite like this idea of marshalling change as a counter to the use of such CMS’s as I’ve certainly seen what happens when a user gets a hold of a perfectly optimised and setup WordPress installation, however could this in most such CMS’s not be facilitated by providing the user an account with lesser administrative power (author) ?

    Alternatively perhaps having two versions of WordPress, light and standard… with slim line or primitive features In respect of the code/core through the use of the standard database structure which could/wold allow a full featured install to simply place over the top if/when needed?

    A Hybrid if you will? is it not light enough allready?

  7. Like
    CSN-UK got a reaction from jimmymustang in I need Help! I need a simple calculator for my website!   
    Hi Jimmy,
     
    Could you post your .html file code as you have it in Dreamweaver onto here for us to take a look at?, it will certainly help in getting you an answer both now and for future posts. Ensure you use the code option when posting (<> icon) though.

    Also I've made some slight modifications to the code Lyndsey provided to ensure the code runs when your page loads, as it appears JSfiddle was providing this for Lyndsey, you also need to include the other line below as jQuery is required.

    I've included a complete up-to-date example below that will work.
     
    Tip - You will notice the JavaScript is at the bottom of the page as opposed to the top, this is the best place for your JavaScript as it will allow your page to load more rapidly before loading the JavaScript and is often advised.
     
     
    Required to include jQuery in your file.
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> Up-To-Date Version:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <select class="sel" id="sel1"> <option value=""> Select a Value... </option> <option value="10"> 10 </option> <option value="20"> 20 </option> </select> <select class="sel" id="sel2"> <option value=""> Select a Value... </option> <option value="70"> 70 </option> <option value="80"> 80 </option> </select> <input type="checkbox" value="50" name="myChk" id="myChk" /> Add Service (50) <br /> Total: <span id="total"> </span> </body> </html> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="application/javascript"> $(document).ready(function() { var totalElement = $('#total'); $('.sel').on('change', function() { totalElement.html( parseInt($('#sel1').val()) + parseInt($('#sel2').val()) ); }); $('#myChk').click(function() { if($(this).is(':checked')) { totalElement.html(parseInt(totalElement.html()) + parseInt($(this).val())); } else { totalElement.html(parseInt(totalElement.html()) - parseInt($(this).val())); }; }); }); </script> Hopefully that helps
  8. Like
    CSN-UK reacted to Alluziion in How Low Can You Go?   
  9. Like
    CSN-UK got a reaction from mantis in PHP with Dreamweaver CS6   
    The Best PHP IDE I’ve ever come across to date has to be NuSphere’s PhpED, it’s capabilities, features support for tools and particularly debugging is very impressive and on par with what I expect from IDE’s such as Microsoft ultimate visual studio for executable applications.

    It is also very intuitive and will aid you no end with debugging errors, there are free alternatives such as netbeans or eclipse with PHP support although I would not rate them as highly.

    It looks as though NuSphere also have an aptly timed sale on also http://www.nusphere.com/products/phped.htm
  10. Like
    CSN-UK got a reaction from Alluziion in PC or MAC?   
    This is based on the discussions with numerous professional in both photography and graphics as well as embedded systems developers and other non web based computer or software engineers.
     
    In terms of the technology being adopted as "retina" I'm yet to see, or hear of anyone outside of apple use or even make inroads to its use in standard LCD panels for monitors or TV production as it is only beneficial at a certain close distances.
     
    That said the idea of greater pixel density however is and has been around long before apple coined it Retina and is and always has been prevalent, however that is not the problem it is the rendering of the images on retina displays that make the colours and image super imposed and inaccurate to other monitors that is the problem, not their pixel density.
     
     
    To debate on the theory of multi tasking or threading is something that would have any number of computer scientists or like myself a software engineer laughing, as despite what you may perceive as mutli tasking or threading it is in fact not, as we're yet to solve that problem.. the scheduler still only allows 1 process to have its time on the processor at a time.
     
    Both work similarly with Mac using a derivative of roundrobin, with preloading or queuing of other threads/processes where as windows is priority based with pre-emptive scheduling. Both have their problems and advantages with nether being perfect, which I'll leave you to discover those.
     
    The point however is that their ability to multi task is comparative with a potentially sway towards the windows I would hazard from most professionals/academics, as for the virtual desktops, that is a feature of the GUI and is suited for the scheduler type.
     
    Windows doesn't have virtual separate desktops in the same respect but does not need them, with programs and tasks being stacked with live previews on the task bar, it's more a feature with each OS implementing the same thing slightly differently than a comparative point (matter of opinion). Though you could add this to windows if necessary.
     
    As for things windows can do and mac cannot, the vast majority of peripherals (specifically speciality fields) are windows only, think manufacture or office based, gaming still (though lessening), still a vast majority of software and drivers that are unavailable , lack of customisation, specifically UI and for developers, uninviting platform for developers .. the list goes on...
     

  11. Like
    CSN-UK reacted to andy9l in PC or MAC?   
    "Retina" is just a marketing term, agreed, but there's no commercially available 13-15" screens out there with the same quality as those offered by Apple at the moment. I'd be immensely surprised if manufacturers didn't adopt the technology as it becomes cheaper and availability becomes more widespread. Android device manufacturers are bumping up pixel density. The idea of pixel density may have been around before Apple adopted it, but that doesn't change the fact that they've been the first to commercially adopt it in three unique device genres.
     
    Fair enough, I was looking at multi-tasking from a high-level, not the nitty-gritty of multithreading we're recently getting into on my Computer Science course. Live previews on the task bar are horribly inefficient from a UX perspective - carefully highlighting a tiny (less than 48x48??) tile and not falling off it whilst you go diagonally to another window that sometimes refreshes? Or...stroke four fingers down wherever you are and click the live app window on OS X, or four finger swipe to spin desktops. As far as I'm concerned, Windows falls short with multi-tasking (again, with regards to GUI, or UX), but as I said - apart from that the two are very much equal.
     
    It's all subjective, though. You might not like having a multi-touch interface, for example.
     
    Thanks for the in-depth response, interesting stuff - going to do some Googling! Especially around the problems with super-imposed imaging...couldn't find anything about that just now. Time to dig deeper
  12. Like
    CSN-UK reacted to Alluziion in PC or MAC?   
    Fairplay mate (Andy), I'm an Apple fan (iOS and Business) myself and often get commended on my ability to consider other peoples opinions which is a rare trait of Apple fans these days but you also possess that trait. It's good to see that you know your stuff and not endless ranting about it being better because it's shinier, more expensive and because Steve said that it is; it's good to see fans out there that aren't passively controlled by Apple
  13. Like
    CSN-UK got a reaction from andy9l in PC or MAC?   
    This is based on the discussions with numerous professional in both photography and graphics as well as embedded systems developers and other non web based computer or software engineers.
     
    In terms of the technology being adopted as "retina" I'm yet to see, or hear of anyone outside of apple use or even make inroads to its use in standard LCD panels for monitors or TV production as it is only beneficial at a certain close distances.
     
    That said the idea of greater pixel density however is and has been around long before apple coined it Retina and is and always has been prevalent, however that is not the problem it is the rendering of the images on retina displays that make the colours and image super imposed and inaccurate to other monitors that is the problem, not their pixel density.
     
     
    To debate on the theory of multi tasking or threading is something that would have any number of computer scientists or like myself a software engineer laughing, as despite what you may perceive as mutli tasking or threading it is in fact not, as we're yet to solve that problem.. the scheduler still only allows 1 process to have its time on the processor at a time.
     
    Both work similarly with Mac using a derivative of roundrobin, with preloading or queuing of other threads/processes where as windows is priority based with pre-emptive scheduling. Both have their problems and advantages with nether being perfect, which I'll leave you to discover those.
     
    The point however is that their ability to multi task is comparative with a potentially sway towards the windows I would hazard from most professionals/academics, as for the virtual desktops, that is a feature of the GUI and is suited for the scheduler type.
     
    Windows doesn't have virtual separate desktops in the same respect but does not need them, with programs and tasks being stacked with live previews on the task bar, it's more a feature with each OS implementing the same thing slightly differently than a comparative point (matter of opinion). Though you could add this to windows if necessary.
     
    As for things windows can do and mac cannot, the vast majority of peripherals (specifically speciality fields) are windows only, think manufacture or office based, gaming still (though lessening), still a vast majority of software and drivers that are unavailable , lack of customisation, specifically UI and for developers, uninviting platform for developers .. the list goes on...
     

  14. Like
    CSN-UK got a reaction from Jo 90 in PC or MAC?   
    Having spoken to a number of photographers/media producers and designers over the years it seems most are making the shift away from apple to windows or linux, mainly as apple is making the move towards the "pretty pretty" end of the marketing scale and swaying away from its core user base.

    Examples include the retina display, though it super imposes and enhances the display to make it appear of a greater quality, it does not provide a true representation of colour or otherwise of an image, making it next to useless for graphic/web designers.

    Another is the age old myth of the adobe suit running faster or perceivable quicker on apple computers, when for some time now it has, specifically with Nvidia acceleration it has run considerably faster on windows.

    So the obvious final comparison is use and price, with the price point of an apple computer that many of us would consider, you will get a PC at a third of the cost with equal or in all most all cases a better spec, thus allowing you the freedom to use the PC as you wish with no end of available software, add-ons or customisations, with Mac iOS this is unfortunately not the case.

    Thus why pay more for a machine that can do less ? that seems to be the question most give me and I tend to draw the same conclusion myself despite owning a number of apple products and having a macbook pro in the office (to test, provide support to mac users).

    On a side note an old lecturer of mine and Embedded System Developer commented on the linux/mac/windows debate with this:
     
    Windows: The dependable giant, always there.. works with anyone and anything and asks you twice to make sure your sure before doing anything. Linux: Developed by IT students for IT student, if you have a problem or need a driver, ether write your own or brave the 'Troll' Infested diehard Linux forums, if it fails start again. Mac iOS: Linux/Unix with a pretty GUI and warrantee, doesn't like to talk to the other two but will if you force it, press the wrong combination of buttons and it as Linux, it will tear your face off.. hope your warrantee is still valid.

  15. Like
    CSN-UK reacted to Jo 90 in PC or MAC?   
  16. Like
    CSN-UK reacted to RyanSMcFadyen in Hobbies?   
    ^^^ My hobby. Got the funny belled hat and everything.
  17. Like
    CSN-UK got a reaction from Tinker in Domains and hosting with same company   
    My personal view being both part of a provider and a developer is that domains should always remain separate from your hosting provider and should always be purchased from a reputable domain registrar (123-reg, enom etc), many hosting companies may attempt to convince you otherwise and the reasons for this vary(usually domains free with x package), none of which are ultimately valid however many fall for the trap.
     
    An example of a recent client's previous host:
     
    After a further phone discussion:
     
    The use of domains to leverage payments and large TOS fines or reactivation fees does occur more often than not and can be easily avoided, an additional word of wisdom is to ensure you take often and complete backups to ensure you are always "safe".
  18. Like
    CSN-UK got a reaction from Codiacz.com in PHP Search   
    It looks at though you are looking for full text search, as such give this http://tips4php.net/2010/03/create-your-own-fulltext-searchengine-with-php-and-mysql/ a quick read and try, it has a few extra features that might interest you.
     
    Feel free to report back if its not quite right or you have any issues
  19. Like
    CSN-UK got a reaction from Codiacz.com in PHP Search   
    Hi Codiacz,
     
    Your issue isn't so much your code, but instead your logic, and as such is an easy fix, I'll explain:
     
    Your while loop for all intensive purposes is an If statement that repeats, as such if no results are found the following statement will evaluate false:
     

    while($row_search=mysql_fetch_array($result_search)){}
     
    and as a result the below block of code will not execute:
     
     

    $check_search=mysql_num_rows($result_search); $name = $row_search['name']; $id=$row_search['id']; if($check_search < 1){ echo "No results for ".$s; } echo "<ul>\n"; echo "<li>" . "<a href=\"page.php?id=$id\">".$name."</a></li>\n"; echo "</ul>";
     
    This means your if statement to show no results will never be executed as there will always be results if that block of code is executed, as such you need to move your if statement.
     
     
    With these changes made see below:
     

    <?php $s = $_GET['search']; $sql_search="SELECT id, name, FROM table WHERE name LIKE '%".$s."%'"; $result_search=mysql_query($sql_search); if (mysql_num_rows($result_search) >= 1) { // If we have 1 or more results execute this code while($row_search=mysql_fetch_array($result_search)){ $check_search=mysql_num_rows($result_search); $name = $row_search['name']; $id=$row_search['id']; echo "<ul>\n"; echo "<li>" . "<a href=\"page.php?id=$id\">".$name."</a></li>\n"; echo "</ul>"; } }else{ // We have no results echo "No results for ".$s; } ?>
     
    Note: It is always good practice to check if a result is returned before attempting to work with it (the count if statement) to save yourself errors (log file) and also I would advise using full variable names vs $s ... as therse can be hard to remember if you have to pick up the script in 6 months time.
  20. Like
    YOU'D NEED TO USE A VPN (VIRTUAL PRIVATE NETWORK)!
     
    IT'S QUITE COMPLICATED TO SETUP. I'D ADVISE YOU GET SOMEONE WHO KNOWS ABOUT IT, SERVERS AND NETWORKS TO DO IT FOR YOU.
  21. Like
    As per Chris/Renaissance recommendation, the code should be something along the lines of:
     

    foreach ($_POST as $productid => $value){ //Check Form Input Before Processing $value= check_input($value); $productid= check_input($productid); //Check if product exists $item = search($product, "product_id", $productid); /* function will return the product details from the database and not use those (such as price) submitted by the form, if not found it will return NULL */ if($item) { // Save to database/processing } }
     
    However this will depend on the strucutre of your post array, for that example our array includes only value="ppp" and name="26" based on the form code:
     

    <input class="plannerfield checkbox" type="checkbox" value="ppp" name="26">
    These in this example where being used as name (productid) and value (pay per person, or an int for other fields etc).
     
    I would say while doing this as you are unaware of what is being submitted (unlike traditional forms) ensure you check all input (fairly standard) but an extra added check would be to compare any submitted product against the database and reject anything that does not exist or is not a valid product etc... as it is possible to submit a modified form and thus code that could cause you issues, hence a reference to it in the code example .
  22. Like
    CSN-UK got a reaction from funsella in What should my job title be   
    I've got this on my business card:
     
    "I would love to change the world, but they won't give me the source code."
     
    Could possible use it as inspiration? condense it somehow? .. Shame we're typically conformist in titles so CEO on my part
  23. Like
    CSN-UK got a reaction from JoshD in Car :(   
    Bit of a tip, your insurance company will try to push you to one of their "approved garages" as they have pre-arranged discounts to allow them to save on the payout. However you have the right to choose whichever garage you so choose... normally you need three quotes from separate garages of your choice and you pick one/agree with the insurance company.
     
    Had problems in the past with our landrover defender with landrovers warrantee for similar work, where they insisted their warrantee is only valid if you use one of their garages... which again isn't the case as long as original/approved parts are used.
     
    Usually have to fight them tooth and nail to get them to admit it however, but it is part of your consumer rights in the UK .... fortunately found this out from an uncle who does body work on cars... as Landrovers garage (TH Whites) gave us what can only be described as a courtesy car that must have been in for work, looked, smelt and drove like It had come from a pig farm.
     
    Additionally they never could manage to fix anything... and supposidly they where ment to be approved?
  24. Like
    CSN-UK got a reaction from kensha in I don't get it, textarea php output   
    This code functions correctly, your !isset will not function correctly after the form has been submitted in any browser as it always evaluates as the else or false option as the $_POST array is created whether the form is blank or otherwise, the only time this is not the case is when the page is loaded and the form has not been submitted.
     
    Isset checks for the existence of a variable or if it has been set as "NULL" not if the variable contains any value... you would use isset on a form mainly to check if a submit button has been pressed, use empty and !empty for other fields to check their values.
     

    <form method="post" action="post.php"> First Name:<br> <input type="text" size="30" name="FName"><br> Age:<br> <input type="text" size="30" name="Age"><br> Question:<br> <textarea name="question" rows="4" cols="27"></textarea><br> <input type="submit" value="submit" > </form> 1 stupid normal form and 1 stupid normal output: <?php print_r($_POST); // remove after testing... to demonstrate my point. if (empty($_POST["question"])) { echo "Question has not been set"; } else { echo $_POST["FName"]; echo $_POST["Age"]; echo $_POST["question"]; } ?>
  25. Like
    CSN-UK got a reaction from Renaissance-Design in Is WordPress better than a custom CMS?   
    Indeed, second that... this is very late in the game but... I couldent resist .. adding something having spent far to long reading it all
     
    I think I will throw my hat in the ring with a different point of view simply in that security is irrelevant in the question of "is Wordpress better than a custom CMS", to which there could be many criteria however for the most part wordpress would be better... due to its wide user base and vast array of pre-made extensions and support channels.. although as said this is for the most part but not always the case...
     
    As for the security (having been mentioned) when comparing any two systems, it is relative... nothing is 100% secure and even anything plus 80% is at a stretch as security is only as good as the programmers creating the system and how vigilant they choose to be, there will always be a programmer of equal or greater skill that can/could point out a loop hole in their defence... and thus "hack" the system in the loosest of terms.
     
    As such following on with the user base benefiting wordpresses greater support for different roles, the same applies for security... with more programmers of varying levels of expertise and testing platforms (think server enviroments) as well as numbers of installations, comes greater security through contribution be this programming support or just gathered statistics.
     
    I will evidence this via using Norton by Symantec as an example, the latest versions since around 2009 (if memory serves me) have incorporated greater features to collaboratively build a security profile of the web by gathering data ranging from the source of downloads, their age and much more.
     
    Although this information doesn't greatly benefit security providers in small numbers, in large numbers (Norton installs) it has substantial power, imagine the questions Symantec could and do run... such as "was a downloaded file, from a website, on a computer, that was compromised, more than # number of times, of this version, from this source" imagine this then integrated into both the typical file scanning features of a "security program" and you have a very uptodate data that can instantly be distributed to secure your entire client base.
     
    Statistics, community (size) and community support as such greatly increase security and by these merits your system cannot be as secure, wordpress do push updates to installations, the community do comment on insecure plugins... and people do communicate issues... those who choose to not install updates and ignore the community are no different to those who remain ignorant to firewalls/security and OS updates.
     
    ... bit of a rant maybe? or just straddling the fence

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.