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.

MWP

Members
  • Joined

  • Last visited

Reputation Activity

  1. Like
    MWP reacted to user-removed in 1&1 Hosting, Are they really that bad?   
    Well if you know their support is completely useless, doesn't that tell you something?
     
    Yes, it works OK for you now. But what happens when something goes wrong? You get no help, even if it's not your fault.
     
    It happened to me. They crippled one of my websites and they refused to do anything about it, even though it was their fault.
     
    http://michaelgunner.co.uk/11-try-to-blame-me-for-slow-website/
  2. Like
    MWP reacted to Renaissance-Design in Blog or Manual News Feed   
    The style of your website looks very simple, so it would be very little problem to style WordPress to match.
     
    Much better (less work, better functionality, more secure) to use an existing CMS for this sort of thing rather than reinvent the wheel.
  3. Like
    MWP reacted to Jay Gilford in Check boxes on contact form   
    You're definitely going to need JS to get the effect you want for the checkboxes and also to make the single text box editable for certain values. It's worth noting that you are going to need to validate it regardless once the form is submitted, as JScan be bypassed/disabled pretty easily and while a majority of people do use JS, not all do. As for where to learn - I see you're using jQuery which is a great library and the one I use for everything. I'd recommend using this site
    http://www.learningjquery.com/
    or getting the sitepoint jQuery novice to ninja eBook
  4. Like
    MWP reacted to Samus in Database to update multiple pages   
    When i'm normally mixing bits of php code with html, I tend to keep my html 'outside' of the php tags. It makes things much cleaner to read imo.
     
    So your code could look something like this:
     

    <?php $username="xxxxx"; $password="xxxxx"; $database="xxxxx"; $hostname="xxxxx"; $link = mysql_connect($hostname, $username, $password); $db_selected = mysql_select_db($database, $link); $SQL = "SELECT * FROM security_companies WHERE london='TRUE' AND listing='SILVER' OR ukwide='TRUE' AND listing='SILVER'"; $result = mysql_query($SQL); while ($db_field = mysql_fetch_assoc($result)) { ?> <div class="silver"><h5><a href="<?=$db_field['website']; ?>"><?= $db_field['company']; ?></a></h5> <p><?= $db_field['description']; ?></p></div><BR> <?php } mysql_close($link); ?>
     
    and work the same.
     
    So I don't confuse you '<?=' is a shorthand method of writing '<?php echo' or '<?php print'
  5. Like
    MWP reacted to T-G in Database to update multiple pages   
    What I had in my head was a field called "region" (eg London, Midlands, Northern England etc) and "location" (High Street, Somesuch Village).
     
    Basically, there's lots of different ways to organise the database and PHP and you need to pick the easiest/fastest/most convenient way.
     
    To take your example of the services offered, there's two obvious ways as you suggest:
     
    1: make a separate field for each service, if there's a 1 in the field the company offers it, if there's a 0 they don't (or TRUE/FALSE if you prefer). This is a useful approach if you only have a certain number of services to list. Don't worry about having 20-something fields, that's hardly unusual.
     
    2: Have a single "services" field which contains a comma-separated list, eg "nightman,keyholding,dogs,alarms", then when your PHP retrieves the field contents you can simply do '$services = explode("," , $row->services);' to get a nice array of the services offered. This is a little trickier to search however, you need to do a fulltext search which means you have to use a certain type of database (MyISAM off the top of my head, but I'm not sure)
     
    There's other ways to do it of course, like having an entirely separate table of services and insert the id of the companies which offer it, eg:
     
    table companies
    id - name
    1 - Autosecure
    2 - Betatek
    3 - G4S
     
    table services
    name - companies
    dogs - 1,3
    alarms - 2
    nightman - 1,2,3
     
    If I were you I'd get a test database set up, import your spreadsheet (mySQL can import excel spreadsheets) and have a play around. Don't underestimate the value of a blackboard and some chalk in planning these things!
  6. Like
    MWP reacted to Aaron Clifford in Database to update multiple pages   
    I'd look at moving your whole excel database into a sql database, and then moving away from static HTML pages to something more dynamic using PHP and the MYSQL database created from you spreadsheet. In the long run it's going to make your site more expandable and should reduce the time you have to edit the pages.
  7. Like
    MWP reacted to GalaxyTramp in PHP Form Checkbox Mail   
    $Regions = Trim(stripslashes($_POST['Regions'])); You cannot do this as you need to loop through the results.
  8. Like
    MWP reacted to GalaxyTramp in PHP Form Checkbox Mail   
    OK lets see what is actually in the BODY
     
    Try this and see what the result is:
     

    <?php $EmailFrom = "info@uksecurity-directory.co.uk"; $EmailTo = "info@uksecurity-directory.co.uk"; $Subject = "Contact Form"; $CompanyName = Trim(stripslashes($_POST['CompanyName'])); $Email = Trim(stripslashes($_POST['Email'])); $Website = Trim(stripslashes($_POST['Website'])); $Description = Trim(stripslashes($_POST['Description'])); // validation $validationOK=true; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; exit; } $Body = ""; $Body .= "CompanyName: "; $Body .= $CompanyName; $Body .= "\n"; $Body .= "Website: "; $Body .= $Website; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; $Body .= "Description: "; $Body .= $Description; $Body .= "\n"; $Body .= "Regions: "; foreach ($_POST['Regions'] as $Regions){ $Body .= $Regions . "\n"; } echo $Body; ?>
  9. Like
    MWP reacted to GalaxyTramp in PHP Form Checkbox Mail   
    Just realised what you are doing. You need to put the name into the array not the id:
     

    <ol> <li><label class="checkbox">UK Wide</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="UKWide" /></li> <li><label class="checkbox">Scotland</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="Scotland" /></li> <li><label class="checkbox">North East</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="NorthEast" /></li> <li><label class="checkbox">North West</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="NorthWest" /></li> </ol> <ol> <li><label class="checkbox">Yorkshire</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="Yorkshire" /></li> <li><label class="checkbox">West Midlands</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="WestMidlands" /></li> <li><label class="checkbox">Wales</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="Wales" /></li> <li><label class="checkbox">East Midlands</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="EastMidlands" /></li> </ol> <ol>
  10. Like
    MWP reacted to GalaxyTramp in PHP Form Checkbox Mail   
    And the same with services
     

    <label class="checkbox">UK Wide</label> <ol> <li><label class="checkbox">UK Wide</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="UKWide" /></li> <li><label class="checkbox">Scotland</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="Scotland" /></li> <li><label class="checkbox">North East</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="NorthEast" /></li> <li><label class="checkbox">North West</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="NorthWest" /></li> </ol> <ol> <li><label class="checkbox">Yorkshire</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="Yorkshire" /></li> <li><label class="checkbox">West Midlands</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="WestMidlands" /></li> <li><label class="checkbox">Wales</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="Wales" /></li> <li><label class="checkbox">East Midlands</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="EastMidlands" /></li> </ol> <ol> <li><label class="checkbox">East Anglia</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="EastAnglia" /></li> <li><label class="checkbox">London</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="London" /></li> <li><label class="checkbox">South West</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="SouthWest" /></li> <li><label class="checkbox">South East</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="SouthEast" /></li> </ol> <ol> <li><label class="checkbox">Northern Ireland</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="NorthernIreland" /></li><br /> </ol> <p class="Region">Please select the security services you provide</p><br /> <ol> <li><label class="checkbox">Keyholding</label> <input name="Services[]" type="checkbox" class="checkbox" id="Services" value="Keyholding" /></li> <li><label class="checkbox">CCTV</label> <input name="Services[]" type="checkbox" class="checkbox" id="Services" value="CCTV" /></li> <li><label class="checkbox">Close Protection</label> <input name="Services[]" type="checkbox" class="checkbox" id="Services" value="CloseProtection" /></li> <li><label class="checkbox">Door Supervisors</label> <input name="Services[]" type="checkbox" class="checkbox" id="Services" value="DoorSupervision" /></li> <li><label class="checkbox">Residential Security</label> <input name="Services[]" type="checkbox" class="checkbox" id="Services" value="ResidentialSecurity" /></li> </ol> <ol> <li><label class="checkbox">Security Dogs</label> <input name="Services[]" type="checkbox" class="checkbox" id="Services" value="SecurityDogs" /></li> <li><label class="checkbox">Security Guards</label> <input name="Services[]" type="checkbox" class="checkbox" id="Services" value="SecurityGuards" /></li> <li><label class="checkbox">Security Kit & Equipment</label> <input name="Services[]" type="checkbox" class="checkbox" id="Services" value="SecurityKit" /></li> <li><label class="checkbox">Surveillance & Investigations</label> <input name="Services[]" type="checkbox" class="checkbox" id="Services" value="Surveillance" /></li> <li><label class="checkbox">Training Companies</label> <input name="Services[]" class="checkbox" type="checkbox" id="Services" value="Training" /></li> </ol>
     
    Add this to PHP code
     

    $Body = ""; $Body .= "CompanyName: "; $Body .= $CompanyName; $Body .= "\n"; $Body .= "Website: "; $Body .= $Website; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; $Body .= "Description: "; $Body .= $Description; $Body .= "\n"; $Body .= "Regions: "; foreach ($_POST['Regions'] as $Regions){ $Body .= $Regions . "\n"; } $Body .= "Services: "; foreach ($_POST['Services'] as $Services){ $Body .= $Services . "\n"; }
     
    Now you should be good to go
  11. Like
    MWP reacted to TheSimpleHost-Nathan in PHP Form Checkbox Mail   
    No, the code I posted should go in the process.php file.
  12. Like
    MWP reacted to GalaxyTramp in PHP Form Checkbox Mail   
    Sorry got a bit confused over who was the OP.
     
    MWP you need this:
     

    <label class="checkbox">UK Wide</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="UKWide" /> <label class="checkbox">Scotland</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="Scotland" /> <input type='submit' name='submit' value='Get Value'>
     
    AND IN YOUR PHP
     

    $Body = ""; $Body .= "CompanyName: "; $Body .= $CompanyName; $Body .= "\n"; $Body .= "Website: "; $Body .= $Website; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; $Body .= "Description: "; $Body .= $Description; $Body .= "\n"; $Body .= "Regions: "; foreach($_POST['Regions'] as $region){ $Regions = $region . "\n"; $Body .= $Regions; $Body .= "\n"; }
     
    Nathan. The answer you commented on was not meant to be used as written but just a pointer in the general direction.
  13. Like
    MWP reacted to GalaxyTramp in PHP Form Checkbox Mail   
    <label class="checkbox">UK Wide</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="UKWide" /> <label class="checkbox">Scotland</label> <input name="Regions[]" type="checkbox" class="checkbox" id="Regions" value="Scotland" /> <input type='submit' name='submit' value='Get Value'> <?php foreach($_POST['Regions'] as $region){ echo $region; } ?>
  14. Like
    MWP reacted to TheSimpleHost-Nathan in PHP Form Checkbox Mail   
    $_POST['Regions'] will contain an array of selected values. If you do this it should give you a better idea of what's going on:
     

    foreach($_POST['Regions'] as $region){ echo $regions; }
  15. Like
    MWP reacted to GalaxyTramp in PHP Form Checkbox Mail   
    Try this Checkbox
  16. Like
    MWP reacted to FizixRichard in Should I be concerned about W3C error   
    1. Your not setting the attributes correctly

    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
     
    content-type is for your content type, i.e. text/html and character set
     
     
    Here are some no-cache/cache control directives:

    <meta http-equiv="cache-control" content="no-cache" />
     
     
    Values you can put into content are:
    public - cached in public cache
    private - cached in private cache
    no-cache - not cached
    no-store - cached but not archived
     
     
     
    Check this link:
    http://www.w3schools.com/tags/tag_meta.asp
     
    And this one for http-equiv:
    http://www.w3schools.com/tags/att_meta_http_equiv.asp
     
     
    As for W3C Validation...
     
    The whole point of the W3C is to define a global standard for how HTML and CSS should be defined which designers, developers and browsers will stick to.
     
    The idea being, that if everyone (including browser vendors) all follow the same standard, your site should work, function and look the same on all devices.
     
    Because browsers like to do their own thing a bit, it's not perfect, but overall it works.
     
     
    The importance of correct validation is that if your pages validate, it means you have followed the specification to the letter and your site will in theory work and look the same across browsers.
     
    However a failure in validation does not mean your site will not look and work the same in all browsers.
     
    So as a rule of thumb it should validate and the only times it should not validate is when you have knowingly done something that you know won't validate (although I can't think of any scenarios for that off hand).
     
    The reason for your validation failure was because you were outright defining your meta data incorrectly.
  17. Like
    MWP reacted to TomCash in Pointing non www. to www.   
    It's important you tell Google Webmaster tools which version of the website you wish to refer to. Then also build all your links to reflect that.
     
    As for one and one - there's an easy way around this.
     
    If your route directory for your website, where all of your files sit.
     
    Create or edit your .htaccess file to contain the following lines of code:
     

    RewriteEngine On RewriteCond %{HTTP_HOST} ^yoursite\.com [NC] RewriteRule (.*) http://www.yoursite.com/$1 [L,R=301]
     
    That will send anyone from the http://yoursite.com to www.yoursite.com
     
    Hope this helps!
  18. Like
    MWP reacted to user-removed in Pointing non www. to www.   
    They're right, they automatically permanently redirect your non-www to your www. I know, because I have 1&1 and it happened for me.
     
    There's an easy way to find out: http://www.seoconsultants.com/tools/check-server-headers-tool/
     
    If you get a 301 response when you use your non-www domain, then a permanent redirect is already setup.
     
    You don't need to do anything.
  19. Like
    MWP reacted to neil0wen in Thinking of signing upto seomoz   
    You know if you are not too good with on page SEO then there are free tools that can help you with this, such as woorank and pear analytics!
  20. Like
    MWP reacted to zed in IE Problems   
    try validating first http://validator.w3.org/check?uri=http%3A%2F%2Fwww.uksecurity-directory.co.uk%2Fcloseprotection.html&charset=%28detect+automatically%29&doctype=Inline&group=0
     
    other browsers are notorious for allowing coding errors
  21. Like
    MWP reacted to mteam in IE Problems   
    Close your <a href="">
     

    <ol> <li><a href="http://www.perridge-security.co.uk/Close-Protection">Close Protection</a></li> <li><a href="http://www.perridge-security.co.uk/surveillance">Surveillance</a></li> </ol> <ol> <li><a href="http://www.perridge-security.co.uk/home">Consultancy</a></li> <li><a href="http://www.perridge-security.co.uk/contact-me">Contact Me</a></li> </ol>
     
    change .gold width to 520px
  22. Like
    MWP reacted to Renaissance-Design in love spam?   
    419 Eater.
  23. Like
    MWP reacted to MOTIF.tv in Web Designing making me mad!   
    Some days I'll steam through the work without a hickup and other days I'll spend hours wondering why the margin is bigger in IE than it is in Firefox and then finally realise it's very simple to sort , usually Float:left; Display:inline
     
    However if I didn't get these challenges from time to time I'd never feel like i'd acomplished anything. It's great when you solve an issue and then you know what to do when it happens again
     
    Welcome to the world of web development
  24. Like
    MWP reacted to Lewwy in 6 SEO Improvements You Can Make Right Now   
    Hey guys,
     
    This blog post was aimed primarily at businesses just startng out in SEO, so the tips might seem basic to some of you SEO gurus, but I'm sure there is someone out there it will be of use to!
     
    Let me know what you think or if any of the info is off, misleading or unsupported.
     
    6 SEO Improvements You Can Make Right Now
     
    The website is pretty new and I'm hoping to make a business of it when I return from a year out in Australia!
     
    Lewis.
  25. Like
    MWP reacted to Sogo7 in Web Designing making me mad!   
    Wait till you start dating

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.