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

Everything posted by James Husband

  1. Thanks gadgetgirl, *Slaps Head* I knew it was something as simple as that....
  2. Hey, I had tried that one. Gets rid of the echoed variable but also stops the ID's from incrementing.
  3. 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..
  4. 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
  5. 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
  6. 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!
  7. 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
  8. 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.
  9. 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
  10. 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.
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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?
  16. bit confused still.. heres my form <form action="Garrack_Hotel/includes/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_name3">Last Name </label> <input type="text" name="last_name" maxlength="50" size="30" /> <label for="email3"> Email Address </label> <input type="text" name="email" maxlength="80" size="30" /> <label for="telephone3"> Telephone </label> <input type="text" name="telephone" maxlength="30" size="30" /> <label for="comments4"> Enquiry<br> </label> <textarea name="comments" cols="44" rows="9"></textarea> <br> ___ Recaptcha anti spam goes here ___ <input type="submit" id="submit" value="Submit" /> </form> and the 'send_form_email.php' <?php if(isset($_POST['email'])) { // Email and Subject $email_to = "sdsconcrete@hotmail.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"; // 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); ?> Not sure where to add to the $replymsg this is a free script i found as php seems to go over my head..
  17. Ok this isnt the most challening of request but being a noob when it comes to php i thought id ask for some help.. Im working on contact form for a hotel website in making. I would like an automatic 'thank you' email to be sent to a user after they submit contact form. Does anyone know of any simple readmade scripts that do this or have any help regarding this matter. Any help is greatly appreciated!
  18. Thx null i think thats what im looking for. Most of the sites content is static except for a few editable sections which iv used 'paglime' as a cms. Its only the comments that i would like to change on each visit. Now the list of comments is quite extensive, would a php array be ok for 100+ comments and also could the array be an external file? I would have no problem adding comments to the array myself if there is no simple way for My client to do it himself. Thanks for all the help everyone, been scratching my head wondering if php or ajax would be most suitable
  19. Iv made the site using standard html and css. Is it going to be difficult to implement a database? I take it i would be using mysql / php for this?
  20. Havnt even got tht far yet. Dont know how to go About it you see
  21. Hi guys, So im making a website for a small shop in the town i live. He has a guestbook in the shop that customers can leave messages in. On the website my client has asked for a random comment to be displayed on pages of the site from a 'list' of comments. Im not sure of the best way to go about this, if anyone could help point me in the right direction i would be grateful Thanks
  22. Hey guys, Let me quickly point something out before i carry on with my post: 1. This is a temporary design hosted for my benefit and so you lovely peeps can help me regain some focus and spark of ideas, with that in mind iv paid almost no attention to loading times, image optimisation etc. Once iv got a design full layed out in my head i will be recoding from scratch. Right, so after staring at the screen for a few hours and reading your posts iv decided to completly axe the header image, I agree with you Dap in saying that it was competing with other main elements. So... with the slider moving up the page (now becoming a more suitable header) I now have the navigation above the fold and a cleaner overall layout to work with. Colours in place at the moment are just temporarily set to high contrast so i can cleary see my elements. Client has asked for reds and greens so im gonna spend a while on good ole' Adobe Kueler for a while tomorrow. As usual and feedback is welcome (same link as op)
  23. Hey, I was asking myself this question for a while, been messing around with web design for nearly 6 years but only really got serious earlier this year. With a few projects completed and available to view on my portfolio site I have just recently landed my first outsourced work from a design company. I think iv got a sound understanding of HTML and CSS but even now im on forums and in books finding the answer to a problem (personally i think thats part of the fun of web design) so i dont think you need to be absolutley fluent in the languages you use but obviosly a standard working knowledge is required. All in all id say its down to yourself when you know your ready, I know id be bloody nervous going to work within a design agency full time at my current level. 2: For an excellent web designers / developers road map check out http://killersites.com/roadmaps/web-programmer.php Hope that helps
  24. Hi everyone, Iv got a bit of designers lock with my current project for a horse stables so i thought id try seeing if anyone can help with ideas. The site is currently hosted at a temporary address - http://lowerbussowtemp.netne.net/ Any thoughts / ideas on the general layout of the design and especially ideas on colour would be great. I think the layout looks ok at the moment but really needs a good colour scheme to shine. The client has request greens and reds so i may have to rethink the whole look...

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.