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.

rotorhead

Members
  • Joined

  • Last visited

Everything posted by rotorhead

  1. Ah OK I didn't realise that was the case with SEO implications. The file is already actually a php include file so I might as well leave it where it is! Thanks for the hints. .....still learning :-)
  2. Hello, I am slowly learning how to do more and more with php and integrating it into my sites. The latest thing I have come up with is to swap the logo on a site depending upon the time of year. 5 logos: a default and then one for Christmas, Easter, valentine and Halloween. It seems to work but I am sure there is a way to make this better. It currently inserts the link into an <img src""/> but all the php is included within the src"" which seems a little untidy! Would I be better to remove this to an external file and have it insert only the relevant link? I am concerned about not only the page looking untidy but also the SEO implications of having all this code at the top of my site. thanks <?php $today = date('Y-m-d'); $xmasOn = '2010-12-01'; $xmasOff = '2011-01-06'; $valentineOn = '2011-02-07'; $valentineOff = '2011-02-21'; $easterOn = '2011-04-17'; //easter sunday - April 24 $easterOff = '2011-05-01'; $halloweenOn = '2011-10-24'; $halloweenOff = '2011-11-06'; if ( ( $today >= $xmasOn ) && ( $today <= $xmasOff ) ) {echo "images/winking_logo_xmas.gif";} elseif ( ( $today >= $valentineOn ) && ( $today <= $valentineOff ) ) {echo "images/winking_logo_valentine.gif";} elseif ( ( $today >= $easterOn ) && ( $today <= $easterOff ) ) {echo "images/winking_logo_easter.gif";} elseif ( ( $today >= $halloweenOn ) && ( $today <= $halloweenOff ) ) {echo "images/winking_logo_halloween.gif";} else {echo "images/winking_logo.gif";} ?>
  3. wonderful, thanks very much for taking the time to be so informative. All makes sense now :-) I think I'll keep the {} so I don't forget when I come back to it at a later stage. thanks again.
  4. Ah, a full stop is all I was missing...easy when you know how. Thanks :-) Should the { } be around the echo statement or not? Also, does it matter if I use ' or " around 'item' and '&item=' thanks again
  5. Thanks for that. Yes I can see that might be much better than passing variables in the url between my pages and I think will be the way to go in the long term as the site grows. For the moment however, I don't have the time to learn how to use sessions so will make it part of my to-do list :-) What is the best way to tidy up the code I already have?............just for now..........
  6. I am new to php and have generated something that works but I am sure can be tidied up! A variable is passed from page 1 to page 2 and then it needs to to be passed on again to page 3 but only if set on page 1. therefore as part of the link to page 3: <?php if(isset ($_GET['item'])) {echo "&item=";}{echo $_GET['item'];} ?> Surely the 2 echos can be joined? There is probably even a better way to achieve this as well but I would still like an answer to the above if possible? Thanks
  7. Yeah that works perfectly for opening the file, now I just need to find a way of turning my fdf into a pdf. Not had much success in making sense of anything I have found thus far. Thanks for that tho....another step closer! :-)
  8. now that would explain why I could not for the life of me make it work! Thanks, I will have a look and inevitably come crawling back to the forum in a couple of hours!
  9. Ok, so I assume that this is fairly simple but I don't have enough programming experience to get it to work correctly. I have a html form that I have made to generate a fdf file and save it on the server. This file should then be opened using a pdf also on the server and insert the form details into the correct part of the pdf. It works fine but not in one simple step. I need to add something to my php such that when the form is submitted, the fdf file is saved and then immediately opened and displayed to the user. As it currently stands, the file needs opening manually. I've been messing about with fdf_open but without success!? <?php // check that a form was submitted if(isset($_POST) && is_array($_POST) && count($_POST)){ // we will use this array to pass to the createFDF function $data=array(); if(isset($_POST['Text2'])){ // the name field was submitted $pat='`[^a-z0-9\s]+$`i'; if(empty($_POST['Text2']) || preg_match($pat,$_POST['Text2'])){ // no value was submitted or something other than a // number, letter or space was included die('Invalid input for Text2 field.'); }else{ $data['Text2']=$_POST['Text2']; } if(!isset($_POST['Text3'])){ die('You did not submit the correct form.'); } $data['Text3']=$_POST['Text3']; $data['Text4']=$_POST['Text4']; $data['Text5']=$_POST['Text5']; // Date $data['Text1']=date('d/m/Y'); // FDF file - function definition require_once 'createFDF.php'; // file name .fdf $fdf_file=$_POST['Text2'].time().'.fdf'; // the directory to write the result in $fdf_dir=dirname(__FILE__).'/results'; // pdf file for data to go into $pdf_doc='../voucher_online.pdf'; // generate the file content $fdf_data=createFDF($pdf_doc,$data); } }else{ echo 'You did not submit a form.'; } ?>
  10. Welcome to Firefox. The more you use it, the more you will discover! Might I also recommend that you insall the following add-ons to help with your web development: FireBug (to completely inspect a page and even change and remove things directly) ColorZilla (to 'sample' colours on a page) Web Developer Toolbar (pretty much to do everything else! All about viewing info on a site) IE Tab (to quickly try a page in IE but still using FF!!) And then also software called MultipleIEs to install other versions on the same machine. As for your concerns about using style sheets for layout.... tables will irritate you beyond belief and aside from anything else...that's not what they are supposed to be used for. Making a site according to the standards will be rewarded by speed of the site, ease of alterations and also by the search engines. Yes, there are problems with divs and style when using IE but that is because of problems with IE not with the design method and these problems are well documented and understood online; whereas tables just do things seemingly at random. Overall.....layout with style is much better. It's probably fair to say that as a complete newbie, tables are easier but you will quickly realise their limitations. Have fun!!
  11. I must just re-empathise that I dont actually want to add this flash page to the site for those reasons amongst others! However, I lost the battle with that one so... ...my logic for adding the flash vid to a div that will overlay the rest of the site was so that the rest of the page will still be there underneath and so will be trawlable. Is this sensible? Also, I was thinking it might be a good idea to actually have the div generated by java itself and therefore if someone does not have it available it will not load. As for not having flash, is there some way of making the java not load unless flash is enabled? I have thought of some ways of making this as thing as tidy as it possibly can be but just don't have the knowledge to generate the code!
  12. Well done! You will find this kind of thing happens lots and lots with using tables. Divs are just defined 'areas' in a defined place on the page and of a defined size. You can then add content (ie text) to them. They are the main alternative way of making a laout to using a table...and much better! Tables should only be used for tabular data! Do some searches on div so see what they do. Most sites are constructed of a series of div 'boxes'. I suggest that if you don't use Firefox as your web browser, you start doing so and then you install an add-on called firebug. You can then use this to highlight the way in which a page is constructed from divs or tables. Have fun!
  13. I have lost the battle in persuading against this so... I have a 3 second animation that needs to play on a black screen before then automatically loading the website. Since it has to be there, I want to make it as user friendly as it possibly can be. My thoughts are: - Make it short (3 seconds) - Make it go directly to the site (without an ENTER HERE) - Make it only ever play once on a PC (using a cookie i guess) - Somehow make the actual web page load during this 3 seconds so it is ready and waiting behind the animation. The animation could then fade away? I have written the the website from scratch using fully validated XHTML. I have also made the animation. The problem is that i never done anything like this before and do not know how to do any of the other parts. I have had a good look around for tutorials etc but cant seem to find anything.....i guess because no-one does this on websites any more!! Does anyone have any suggestions for any of this? Or tutorials? I literally just have a site and an animation and the only other progress i have made towards this is: Ive generated a div placed at the top of my html that is black and covers the whole screen, then raised to the top with z-index. I thought I would then add the flash to the middle of this. This should load first because it is at the top and the rest of the page will load behind it. I now need this whole thing to disappear once the video has finished...and it would be nice if it fades!! Im guessing using java? I could ignore the cookie part for now if that helps. I really wish I could avoid all this as i don't really like them and I also have no idea how to do it. I guess I'll take it as a learning opportunity. Thanks
  14. I think you have summarised your opening statement quite nicely! This is one reason why we don't use tables for layout :-) Sorry! Have you tried simply adding a div with the repeated image as a horizontal line? Or border-bottom, or make it 5px height and set the background?
  15. I second that! The leap from DW to Notepad++ is liberating! :-)
  16. Youve asked a very open question! :-) Are you planning on designing sites for companies or just a personal one? Do you have any code experience? Do you know the basics of html and css? Can you use dreamweaver and photoshop? When you say 'this' website, do you mean the forum?

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.