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.

James Husband

Members
  • Joined

  • Last visited

  1. Thanks gadgetgirl, *Slaps Head* I knew it was something as simple as that....
  2.    James Husband reacted to a post in a topic: Help with code..
  3. Hey, I had tried that one. Gets rid of the echoed variable but also stops the ID's from incrementing.
  4. Hi all, got a bit of code here that I could use a hand with. I know the answer is probably a simple 'slap the head' one but it's been driving me nuts so thought I would ask for help... The code below uses glob to generate a list of images from a certain directory and add classes and unique ID that increments with each file. My problem is that the ID increment is being echoed and displayed on the page as text. See code below.. PHP <?php $files = glob("images/assets/*.{png,jpg,jpeg}", GLOB_BRACE); $i = 1; foreach ($files as $file) echo "<li id:\"S-$i\"><img class=\"zuper\" src=\"$file\" /></li>", $i++; // This is the incrementor for the LI css id, the problem is that it is being echoed ?> GENERATED HTML <li id:"S-1"><img class="zuper" src="images/assets/1.jpg" /></li>1 <li id:"S-2"><img class="zuper" src="images/assets/2.jpg" /></li>2 <li id:"S-3"><img class="zuper" src="images/assets/3.jpg" /></li>3 <li id:"S-4"><img class="zuper" src="images/assets/4.jpg" /></li>4 <li id:"S-5"><img class="zuper" src="images/assets/5.jpg" /></li>5 <li id:"S-6"><img class="zuper" src="images/assets/bistro.jpg" /></li>6 <li id:"S-7"><img class="zuper" src="images/assets/hotel.jpg" /></li>7 <li id:"S-8"><img class="zuper" src="images/assets/view.jpg" /></li>8 <li id:"S-9"><img class="zuper" src="images/assets/weddings.jpg" /></li>9 You can see the li css id's are being incremented which is good but at the end of each line the variable is being echoed. Any help would be appreciated..
  5. Thanks jack.. You know, I really hate footers! They seem to be the one task I hate doing on my projects... I guess with it being the 'footer' iv perhaps run out of the steam and motivation you have at the start of the project Maybe I should start doing the footer early on from now... I see what your saying there, kind of looks glued to wrapper.. Im going to edit the css right now and take a look. (dont forget to refresh if you take another look!) Cheers mate
  6.    SearchEngineTool reacted to a post in a topic: Hotel Website - Reviews Welcome
  7. Hi all, Just designed the website for the hotel I work for. I decided to do it for free as I like the job and hey, it's another respected company in my Portfolio! Its pretty much done just the usual code sifting, meta data adding etc but the design work is in place and I 'believe' is compatible in all browsers (Damn you IE8). Would welcome any feedback from a fresh pair of eyes, any thoughts on design, UI or content would be appreciated.. Website Link Many thanks, James
  8. right so i have downloaded and had a good read of the html5bp, just to be clear to uncomment parts of the htaccess do i just remove the # from the parts I wish to use? Lots of usefull stuff within this boilerplate! Anyone who has yet to check it out I would suggest taking a look... Thanks again spired!
  9. Wow, Thanks for that info inspired.. Didnt really understand htacces but just done a little research and think I understand it a little more (basically a text file uploaded to web server yes?) Also just checked out the html5bp and cant say thank you enough for bringing this amazing template to my attention! Saw it somewhere before but never really gave it much thought. Could you maybe give a helping hand or point me In the right direction for righting my own htacces files? Would like to use your method of preventing 3G from inlining my JS files. Thanks again for the insight mate
  10. I hope this bit of code helps anyone having problems with 3G providers changing their code! Sure helped me and wanted to pass on the solution.
  11. Right, with some searching on google i've found a solution... <script type="text/javascript"> // <![CDATA[ // Using document.write to load Javascript dependencies to bypass O2 network inlining of Javascript. function loadJS(file){document.write("<" + "script type='text/javascript' src='" + file + "'></" + "script>")} loadJS("/js/jquery-1.4.2.min.js"); loadJS("/js/myJSLibrary.js"); // ]]> </script> The code above prevents google from 'inlining' js code and messing stuff up. Kudos goes to 'Sroebuck' at StackOverflow http://stackoverflow.com/questions/3282373/web-site-exhibits-javascript-error-on-ipad-iphone-under-3g-but-not-under-wifi
  12. Hi all, got a problem thats been driving me insane and would love some advice. So im using an image gallery plugin called 'Galleria', it has a nifty flickr plugin that allows me to make categorised galleries using sets from my clients flickr accounts. Everything works fine over WIFI but when viewed on 3G it doesnt load at all, I think it has to do with 3G providers changing JS files to inline. The funny thing is if I clear the cache (ctrl - shift - r on firefox) it then loads. the gallery is hosted at: http://sdsimprintedconcrete.co.uk/sdsgallery.html been trying to figure out the problem myself and read about 'Cache-Control:no-transform' but even though iv added it to my header im still having the same issue. Any help would be greatly appreciated.
  13. its ok iv figured it out.. just needed the follow line and value of form changed. $email_message .= $_POST['newsletter'] == "unscribe" ? "Newsletter: Yes \n" : "Newsletter: No \n"; one thing i would like to do which may be a bit out my league is to automatically add the email address of people who selected 'yes' to the newsletter mailing list. i was thinking of going down the mailchimp route but would rather figure out a way to do myself
  14. Hi all, having a bit of trouble working out how to send a YES / NO value from a tickbox form, its basically for people to opt in / out of a newsletter. Any help would be greatly appreciated. Heres the HTML form: <form action="send_form_email.php" method="post" name="contactform"> <label for="first_name">First Name </label> <input type="text" name="first_name" maxlength="50" size="30" /> <label for="last_name">Last Name </label> <input type="text" name="last_name" maxlength="50" size="30" /> <label for="email"> Email Address </label> <input type="text" name="email" maxlength="80" size="30" /> <label for="telephone"> Telephone </label> <input type="text" name="telephone" maxlength="30" size="30" /> <label for="comments">Enquiry<br></label> <textarea name="comments" cols="44" rows="9"></textarea> <br> [b]<label for="newsletter">May we contact you regarding future offers?</label>[/b] [b] <input id="checkbox" type="checkbox" name="vehicle" value="1">[/b] <input type="submit" id="submit" value="Submit" /> </form> -------------------------------- and the php include <?php if(isset($_POST['email'])) { // Email and Subject $email_to = "info@makebelievemedia.co.uk"; $email_subject = "SDS Website enquiry"; function died($error) { // your error code can go here echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['first_name']) || !isset($_POST['last_name']) || !isset($_POST['email']) || !isset($_POST['telephone']) || !isset($_POST['comments'])) { died('We are sorry, but there appears to be a problem with the form you submitted.'); } $first_name = $_POST['first_name']; // required $last_name = $_POST['last_name']; // required $email_from = $_POST['email']; // required $telephone = $_POST['telephone']; // not required $comments = $_POST['comments']; // required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email_from)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$first_name)) { $error_message .= 'The First Name you entered does not appear to be valid.<br />'; } if(!preg_match($string_exp,$last_name)) { $error_message .= 'The Last Name you entered does not appear to be valid.<br />'; } if(strlen($comments) < 2) { $error_message .= 'The Comments you entered do not appear to be valid.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "First Name: ".clean_string($first_name)."\n"; $email_message .= "Last Name: ".clean_string($last_name)."\n"; $email_message .= "Email: ".clean_string($email_from)."\n"; $email_message .= "Telephone: ".clean_string($telephone)."\n"; $email_message .= "Comments: ".clean_string($comments)."\n"; $email_message .= "Newsletter: ".clean_string($newsletter)."\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); $headers2 = 'From: '.$email_to."\r\n". 'X-Mailer: PHP/' . phpversion(); $replymsg = "Thank you for your request."; mail($email_from, $email_subject, $replymsg, $headers2); ?> I added $email_message .= "Newsletter: ".clean_string($newsletter)."\n"; which shows the Newsletter header in the sent email but i cant work out how to send a value from the tick box. any advice? James
  15. Thanks again Wickham, iv used the second bit of code you supplied and it works perfectly! Thank you email is now sent 'from' hotels email
  16. hi wickham, thanks for your help, iv used the first example you showed @mail($email_to, $email_subject, $email_message, $headers); $replymsg = "Thank you for your request."; mail($email_from, $email_subject, $replymsg, $headers); ?> but as you said it is sent from the users email, does the second example send an email (or appear to) from the Hotels Email as this is would obviously look more professional. I think if some users receive the thank you email from there own email it could cause some confusion. thanks again, James
  17. ok so iv got it working but one little question remains, iv tried adding quote symbols (parenthisis?) to the comments ie. "this" instead of this. but adding this seems to not let the comment show. my guess is that adding "" is making it act like code? is there a way to add "" around my comments?

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.