Jump to content

AndyB

Member
  • Posts

    37
  • Joined

  • Last visited

Everything posted by AndyB

  1. AndyB

    Learning PHP

    On the "Kilersites University" course,Ben. Here's the url http://www.killersitesuniversity.com/users/courses/ Thanks Ben.
  2. AndyB

    Learning PHP

    Hello everyone, My name is Andrew and I've started Ben's "CRUD with PHP and MySQL" course("Hello Ben!") I am working on the "Updating Records" lesson now, but for some reason it appears that the "Creating New Records" and "Editing Existing Records" lessons are not available,i.e. when I hover over them, they do not highlight. I'd be grateful for tips on how to access those lessons? With thanks, Andrew.
  3. Hello Ben, Would it be possible at all to get a link to that post of yours from late 2010 in which you wrote down and commented on the code for the "Edit","Delete" and "Update" php pages for the" CRUD with PHP and MySQL"? I'm a bit concerned with making unnecessary errors when writing the code, I thought that if I have your work, I can self-correct if I get error messages. Many thanks in advance for your help Ben, With regards, Andrew.
  4. Hello Ben, I just wanted to thank you for your help with the username and password errors I was facing. It's only a little database but it's quite tricky when you do it from the Web Host. I had to figure out how to create the user name, password and database on the Web Host by myself, which was a lot of trial and error, though of course, it is quite trivial for an experienced programmer. I'm quite happy to start the "Prepared Statements in MySQL" video now. This is a link to my database, I've still got to write the code to edit and add records to it, but I think that comes up in videos 5 and 6. http://www.spintheclock.com/PHPWork/view.php Many thanks for your help Ben, With regards, Andrew.
  5. Hello Ben, Thanks a lot for the corrections you suggested and which I actually implemented with the help of a post from yesterday by another user. I think that the user went back to a post of yours with a thorough breakdown of all the pages for the CRUD/PHP/MySQL videos. I don't know if it was intentional but it was quite helpful, I tried to look her name up but there have been many posts since so I couldn't find her to say thanks. Anyway I used the code that you had written with the commented lines that explain clearly what each section does. I have unfortunately come up with some new error messages which I looked up on the Net because they seem to be quite generic. I think they're called mysqli "prepared statements". Warning: mysqli::mysqli() [mysqli.mysqli]: (42000/1044): Access denied for user 'spinthe3_andrewb'@'localhost' to database 'spinthe3_records2' in/home/spinthe3/public_html/PHPWork/connect-db.php on line 8 Warning: mysqli::query() [mysqli.query]: Couldn't fetch mysqli in /home/spinthe3/public_html/PHPWork/view.php on line 18 Warning: main() [function.main]: Couldn't fetch mysqli in /home/spinthe3/public_html/PHPWork/view.php on line 52 Error: Warning: mysqli::close() [mysqli.close]: Couldn't fetch mysqli in /home/spinthe3/public_html/PHPWork/view.php on line 56 Could it mean that my sql password might be invalid? It's strange because the error messages seem to all be related to a syntax error with "mysqli" somehow. WHy couldn't the server "fetch mysqli"? Many thanks in advance for your insight on this matter Ben, Regards, Andrew.
  6. Hello Ben, Thanks for your help with those faulty lines. I've made the necessary changes but now I get this error message: Parse error: syntax error, unexpected T_ELSE in /home/spinthe3/public_html/PHPWork/view.php on line 58 I don't know why that would come up,here's my updated code and thanks again for your help with this matter Ben. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>View Records</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> </head> <body> <h1>View Records</h1> <?php include('connect-db.php'); if ($result = $mysqli->query("SELECT * FROM players ORDER BY id")); { if ($result->num_rows > 0) { echo "<table border='1' cellpadding='10'>"; echo "<tr><th>ID</th><th>First Name</th><th>Last Name</th><th></th><th></th></tr>"; while($row = $result->fetch_object()) { echo "<tr>"; echo "<td>" . $row->id . "</td>"; echo "<td>" . $row->firstname . "</td>"; echo "<td>" . $row->lastname . "</td>"; echo "<td><a href='records.php?id=" . $row->id . "'>Edit</a></td>"; echo "<td><a href='delete.php?id=" . $row->id . "'>Delete</a></td>"; echo "</tr>"; } echo "</table>"; } else { echo "No results to display!"; } } else { echo "Error: " . $mysqli->error; } $mysqli->close(); ?> <a href="records.php">Add New Record</a> </body> </html>
  7. Hello Ben, I've been working on the "CRUD with PHP and my SQL" course for a couple of weeks now. The material is very interesting and I am really looking forward to building my first app. However,I'm having difficulty with displaying the view.php file in my browser, I must say that I use my web host for this purpose. This is the error message that I get: Parse error: syntax error, unexpected '>' in /home/spinthe3/public_html/PHPWork/view.php on line 35 I must have made an error with the code and would be grateful for your insight Ben. Many thansk in advance for your time, Regards, Andrew. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>View Records</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> </head> <body> <h1>View Records</h1> <?php include('connect-db.php'); if ($result = $mysqli->query("SELECT * FROM players ORDER BY id")); { if ($result->num_rows > 0) { echo "<table border='1' cellpadding='10'>"; echo "<tr><th>ID</th><th>First Name</th><th>Last Name</th><th></th><th></th></tr>";" while($row = $result->fetch_object()) { echo "<tr>"; echo "<td>" . $row->id . "</td>"; echo "<td>" . $row->firstname . "</td>"; echo "<td>" . $row->lastname . "</td>"; echo "<td><a href='records.php?id=" . $row->id . "'>Edit</a>"</td>"; echo "<td><a href='delete.php?id=" . $row->id . "'>Delete</a>"</td>"; echo "</tr>"; } echo "</table>"; } else { echo "No results to display!"; } } else { echo "Error: " . $mysqli->error; } $mysqli->close(); ?> <a href="records.php">Add New Record</a> </body> </html>
  8. Hello Ben, I hope you had a good Christmas with friends and family. I've just completed the PHP tutorial on arrays now and I've had a crack at both "Indexed" and "Associative" arrays. This is the code from the tutorial on "Associative" arrays that I wrote as an exercise: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title> 1st Associative Array</title> </head> <body> <?php // indexed array $my_array = array("Derivatives","PHP","JavaScript",40); print $my_array[2]; print "<br><br>"; $prices_array = array("iPad" => "1300.00", "MacBook" => "800.00", "iPhone" => "100.00", ); print $prices_array['iPad']; ?> </body> </html> The code did work alright,displaying "JavaScript" and "1300.00" in the browser. However,at first, I had added £ signs in the values such as "£1300.00" or "£800.00". I had also written the names as such:"i-Pad", "i-Phone"and code wouldn't work. My 1st query today is: 1) Was my initial name-value annotation incorrect? The tutorial also shows another way of displaying the array: $prices_array = array ("iPad" => "1300.00", "MacBook" => "800.00", "iPhone" => "100.00" ); print $prices_array['iPad']; My 2nd query is: 2) Is one way of building the array preferable to the other for reading convenience ? Many thanks in advance for your help with this query Ben, Regards, Andrew.
  9. Hello Ben, Thanks a lot for your reply to my e-mail from last Monday about the "include" keyword. I've just completed the tutorial on arrays now and I've had a crack at both "Indexed" and "Associative" arrays. This is the code from the tutorial on "Associative" arrays that I wrote as an exercise: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title> 1st Associative Array</title> </head> <body> <?php // indexed array $my_array = array("Derivatives","PHP","JavaScript",40); print $my_array[2]; print "<br><br>"; $prices_array = array("iPad" => "1300.00", "MacBook" => "800.00", "iPhone" => "100.00", ); print $prices_array['iPad']; ?> </body> </html> The code did work alright,displaying "JavaScript" and "1300.00" in the browser. However,at first, I had added £ signs in the values such as "£1300.00" or "£800.00". I had also written the names as such:"i-Pad", "i-Phone"and code wouldn't work. My 1st query today is: 1) Was my initial name-value annotation incorrect? The tutorial also shows another way of displaying the array: $prices_array = array ("iPad" => "1300.00", "MacBook" => "800.00", "iPhone" => "100.00" ); print $prices_array['iPad']; My 2nd query is: 2) Is one way of building the array preferable to the other for reading convenience ? Many thanks in advance for your help with this query Ben, Regards, Andrew.
  10. Hello Ben, Thanks a lot for the link you sent me last week to illustrate the difference between the "echo " and "print" keywords". I've got a query about another keyword today which I was hoping you might be able to spare some time on. In the PHP basics 2 tutorial, there's a lesson on the "PHP includes" function. The video demonstrates how a footer can be added to a main page by using the "include " keyword. The tutorial says that the "include" keyword can be used with or without the"@" symbol: -@include or, -include My understanding of it is that: -if the"@" symbol is included and that it links to a non-existent file, no error message will display in the browser -if the "@" symbol is not included and that it links to a non-existent file, an error message will display in the browser. My query therefore is: 1) Is the"@" symbol used with the include function depending on whether or not we plan for the page to be displayed to viewers? Many thanks in advance for your help with this query Ben, With regards, Andrew.
  11. Hello Ben, Many thanks for your last e-mail and your sound advice about the Filezilla transfer. I followed your instructions and was lucky enough to get the desired result. This is the code I wrote for the 1st PHP page which is in video 7 of the PHP basics1 Folder : <!DOCTYPE HTML PUBLIC "-??W3C??DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>1st PHP</title> </head> <body> <?php print "Hello World."; ?> </body> </html> In the video it is recommended to use the "print" function as opposed to "echo",which I've come across before. 2) Is there any difference between the "print" and "echo" functions? Many thanks in advance for your help Ben, Regards, Andrew.
  12. Hello Ben, Thanks for your reply to my post last Thursday. I started the PHP course in the order that you suggested and I've almost completed the php.basics1 folder. I'm having though with something trivial though and I would be grateful for your insight on this matter. In the video, Stefan recommends testing your PHP scripts on: -Local servers such as WAMP or XAMPP -Web host servers. My Web server is Just Host so I decided to focus on this approach. However, the video seems to focus more on people using local servers. I haven't been able to pick up on instructions to test scripts on Web hosts servers. I have written the following basic code from the video: <!DOCTYPE HTML PUBLIC "-??W3C??DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>My 1st PHP</title> </head> <body> <?php print "Hello World."; ?> </body> </html> and saved it as a Notepad file with a PHP file extension. I've tried to upload it to the public_html folder of the Web host in a folder which I called PHP Work but without success. Could you please recommend a way to upload Notepad files to the Web host server to test the scripts? Many thanks in advance for your help Ben, Regards, Andrew.
  13. Hello Ben, I hope you're OK and that work is going alright for you too. I've just purchased the PHP for Beginners tutorial from the store. I realise that without at least a basic understanding of PHP, it's going to be difficult to communicate with real developers. I downloaded 4 zip files: -PHP basics 1 -PHP basics 2 -PHP misc -PHP object oriented programming I suspect that it might not make much of a difference but in which order would you recommend I study these topics? Would you have any general advice about a "best practice" method to use to get to grips with the material thoroughly? Many thanks in advance for your advice Ben, Regards, Andrew.
  14. Hello Ben, Thanks a lot for your reply to my last post. Honestly, your insight was flawless, it was all down to re-writing the code in the header.php template. We had my wife's cousins who are from East Stroudsberg,Pennsylvania visit us for Thanksgiving in the last couple of days. To make a long story short, one of them, Sidney, works in Web development. It was the strangest of coincidence but we ended up talking about design, a thing led to another and he decided to tinker away with the site code. It was very lucky for me because I struggle a lot with PHP with which I'm not fluent at all. Anyway,these are the changes he implemented on the basis of your code. So thanks again for your insight Ben. www.spintheclock.com <!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 profile="http://gmpg.org/xfn/11"> <title><?php woo_title(); ?></title> <?php woo_meta(); ?> <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" media="screen" /> <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php if ( get_option('woo_feed_url') <> "" ) { echo get_option('woo_feed_url'); } else { echo get_bloginfo_rss('rss2_url'); } ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php wp_head(); ?> <?php woo_head(); ?> </head> <body <?php body_class(); ?>> <?php global $woo_options; ?> <div id="background"> <div id="top"> <div class="col-full"> <?php if ( function_exists('has_nav_menu') && has_nav_menu('primary-menu') ) { wp_nav_menu( array( 'depth' => 3, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_class' => 'nav1', 'theme_location' => 'primary-menu' ) ); } else { ?> <ul class="nav1"> <?php if ( get_option('woo_custom_nav_menu') == 'true' ) { if ( function_exists('woo_custom_navigation_output') ) woo_custom_navigation_output('name=Woo Menu 1&depth=3'); } else {/* ?> <li <?php if ( is_home() ) { ?> class="current_page_item" <?php } ?>><a href="<?php echo get_option('home'); ?>/"><?php _e('Home', 'woothemes'); ?></a></li> <?php wp_list_pages('sort_column=menu_order&title_li=&depth=3'); ?> <?php*/ } ?> </ul> <!--/nav1--> <?php } ?> <div class="subscribe"> <?php _e('Subscribe:', 'woothemes'); ?> <a class="posts" href="<?php if ( get_option('woo_feed_url') <> "" ) { echo get_option('woo_feed_url'); } else { echo get_bloginfo_rss('rss2_url'); } ?>"><?php _e('Posts', 'woothemes'); ?></a> <span class="sep">|</span> <a class="comments" href="<?php bloginfo('comments_rss2_url'); ?>"><?php _e('Comments', 'woothemes'); ?></a> <?php if (get_option('woo_subscribe_email') != "") { ?> <span class="sep">|</span> <a class="email" href="<?php echo get_option('woo_subscribe_email'); ?>" target="_blank"><?php _e('Email', 'woothemes'); ?></a> <?php } ?> </div> <div class="fix"></div> </div><!-- .col-full --> </div><!-- #top --> <div id="header"> <div class="col-full"> <div id="logo" > <?php if (get_option('woo_texttitle') <> "true") : $logo = get_option('woo_logo'); ?> <a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('description'); ?>"> <img class="logo" src="<?php if ($logo) echo $logo; else { bloginfo('template_directory'); ?>/images/logo.png<?php } ?>" alt="<?php bloginfo('name'); ?>" /> </a> <?php endif; ?> <?php if( is_singular() ) : ?> <span class="site-title"><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></span> <?php else : ?> <h1 class="site-title"><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1> <?php endif; ?> <span class="site-description"><?php bloginfo('description'); ?></span> </div><!-- #logo --> <?php if ( $woo_options['woo_ad_top'] == 'true' ) { ?> <div id="topad" class="fr"> <?php if ($woo_options['woo_ad_top_adsense'] <> "") { echo stripslashes($woo_options['woo_ad_top_adsense']); } else { ?> <a href="<?php echo $woo_options['woo_ad_top_url']; ?>"><img src="<?php echo $woo_options['woo_ad_top_image']; ?>" width="468" height="60" alt="advert" /></a> <?php } ?> </div><!-- /#topad --> <?php } elseif ( $woo_options['woo_disable_search'] != 'true') { ?> <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/"> <div id="search"> <input type="text" value="<?php _e('Enter search keyword', 'woothemes'); ?>" onclick="this.value='';" name="s" id="s" /> <input name="" type="image" src="<?php bloginfo('template_directory'); ?>/images/btn-search-trans.png" value="Go" class="btn" /> </div><!--/search --> </form><!-- #searchform --> <?php } ?> <div class="fix"></div> </div><!-- .col-full --> </div><!-- #header --> <div id="topmenu"> <div class="col-full"> <?php if ( function_exists('has_nav_menu') && has_nav_menu('secondary-menu') ) { wp_nav_menu( array( 'depth' => 6, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_class' => '', 'menu_id' => 'nav', 'theme_location' => 'secondary-menu' ) ); } else { ?> <ul id="nav"> <?php if ( get_option('woo_custom_nav_menu') == 'true' ) { if ( function_exists('woo_custom_navigation_output') ) woo_custom_navigation_output('name=Woo Menu 2'); } else { ?> <?php //wp_list_categories('title_li=&exclude=') ?> <ul class="sf-menu"> <li><a href="<?php echo bloginfo('url'); ?>/" >Home</a></li> <li><a href="<?php echo bloginfo('url'); ?>/about" >About</a></li> <li><a href="<?php echo bloginfo('url'); ?>/stories-2" >Stories</a> <ul> <?php $mypages = get_pages('child_of=131&post_type=page&sort_order=asc'); //echo "<pre>"; print_r($mypages); die; foreach($mypages as $page) { ?> <li><a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?></a></li> <? } ?> </ul> </li> <li><a href="<?php echo bloginfo('url'); ?>/contactlinks" >Contact</a></li> <li><a href="<?php echo bloginfo('url'); ?>/comments" >Comment</a></li> </ul> <?php } ?> <li> </li> </ul> <?php } ?> <div id="rss" class="fr"> <a href="<?php if ( get_option('woo_feed_url') <> "" ) { echo get_option('woo_feed_url'); } else { echo get_bloginfo_rss('rss2_url'); } ?>"><img src="<?php bloginfo('template_directory'); ?>/images/ico-rss-trans.png" alt="RSS" /></a> </div><!--/rss --> </div><!-- .col-full --> </div><!-- #topmenu--> <div id="content" class="col-full">
  15. Hello Ben, For further clarification, this is the code that I had in my "Stories" tab,which was a page in "Editor" mode, prior to the template change. <?php global $post; $myposts = get_posts( 'offset=4&post_type=page&order=asc' ); ?> <ul> <?php foreach( $myposts as $post ) : setup_postdata($post); ?> <?php $url = substr_replace(get_permalink(), '#', strrpos(get_permalink(), '/')+1, 0); ?> <li><a href="<?php echo $url; ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul> But now as you can see, when you click on the hyperlinks, they only invariably display the "Home" page. Also, the "Comments" and "Posts" links don't display the correct content. To sum it up: 1) How can I get the stories to display from the "Stories" tab only and not be on the top menu? 2) How can I remove the extra "Home" link? 3) How can I remove the "No Categories" tab? 4) How can I re-enable the "Posts" and "Comments" links? Your help would be greatly appreciated yet again Ben, With thanks, Andrew.
  16. Hello Ben, Thanks for your reply to my last post about PHP files. I've spent a little time fixing my new template so here it is at: www.spintheclock.com I previously had a WP template which I changed to Woo Themes. In so doing, many of my settings have been changed. There's that tab that says:"No Categories" . Previously,it was named "Stories" and had content . At the top, "Home", "About" and "Contact/Links " are correct . However,the remainder of the entries were hyperlinks in a drop down list as they were stories. And the drop down list was in the tab that now says "No Categories." My query today is: How can I write code to put the stories back into a list of hyperlinks in that tab that now says "No categories"? Many thanks in advance for your help Ben, Regards, Andrew.
  17. Hello Ben, Thanks for your reply to my last post and making the WAMP/MAMP/XAMPP distinction clearer. My query today is about backing up files. I've come across the SVN(Subversion?) system to maintain files and source code while looking into backing up my own files. 1) Is SVN the software that maintains the source code for a Word Press site? 2) What is the difference between SVN and GIT? Many thanks in advance for your reply Ben, Regards, Andrew.
  18. Hello Ben, I hope you're OK and that your work is going well too. I have a couple of queries I was hoping you might be able to help with. I use Just Host as my Web Host and wamp as my local web server. 1)Have you come across the xamp or mamp local web servers and how would they compare to wamp? 2)How would you rate Expression Engine as a CMS in comparison to WordPress or Drupal? Many thanks in advance for your insights Ben, Regards, Andrew.
  19. Hello Ben, Many thanks for your reply to my last post. I'll be looking forward to show you my work by the end of the week, Kind regards, Andrew.
  20. Hello Ben, I think I got very lucky with the CSS template I was telling you about and I managed to find the line of code that was causing me trouble. In the style sheet, I located the #content rule and changed the width property from “width: 610px;” to “width: auto;”. This expanded the content to fill the room allotted by the parent div element #page (set to 960px). That was a long shot but it seems to have worked out OK. There's a fair amount of basic HTML/CSS work available in small Web agencies here in Brighton,UK. I remember Stefan saying in one of his videos that he doesn't think that small companies are looking for people with an extensive academic background. He seemed to say that the web work you've done, provided it's up to the employer's expectations and standards should be enough to get you interviews. I think he also mentioned that your code should be well written and your sites well presented. I have an HTML/CSS site and WordPress site at the moment under construction. The HTML/CSS site is about philosopher Gilles Deleuze whose work I studied at University. The WordPress site is about my own writings and essays. Would you have any advice on how: -I could make the sites suitable to show at an interview -A web agency will critique the work and what they are looking for in an applicant's work to decide if he/she may be a suitable candidate. Your answers will also help to dust off the work before I can show it to you for a full critique in the next couple of weeks. Many thanks in advance for your help Ben, Regards, Andrew.
  21. Hello Ben, I think I got very lucky with the CSS template I was telling you about and I managed to find the line of code that was causing me trouble. In the style sheet, I located the #content rule and changed the width property from “width: 610px;” to “width: auto;”. This expanded the content to fill the room allotted by the parent div element #page (set to 960px). That was a long shot but it seems to have worked out OK. There's a fair amount of basic HTML/CSS work available in small Web agencies here in Brighton,UK. I remember Stefan saying in one of his videos that he doesn't think that small companies are looking for people with an extensive academic background. He seemed to say that the web work you've done, provided it's up to the employer's expectations and standards should be enough to get you interviews. I think he also mentioned that your code should be well written and your sites well presented. I have an HTML/CSS site and WordPress site at the moment under construction. The HTML/CSS site is about philosopher Gilles Deleuze whose work I studied at University. The WordPress site is about my own writings and essays. Would you have any advice on how: -I could make the sites suitable to show at an interview -A web agency will critique the work and what they are looking for in an applicant's work to decide if he/she may be a suitable candidate. Your answers will also help to dust off the work before I can show it to you for a full critique in the next couple of weeks. Many thanks in advance for your help Ben, Regards, Andrew.
  22. Hello Ben, Thanks for your reply to my last e-mail. Sorry about not having posted the HTML,which seems fairly obvious, I was convinced the element to remove was in the CSS. Here's the HTML and thanks for your help, Regards, Andrew. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Design by Free CSS Templates http://www.freecsstemplates.org Released for free under a Creative Commons Attribution 3.0 License --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <meta name="keywords" content="" /> <meta name="description" content="" /> <link href="style2.css" rel="stylesheet" type="text/css" media="all" /> </head> <body> <div id="wrapper"> <div id="logo"> <h1><a href="#">Machines Intelligence Novelty and Dividuals</a></h1> </div> <div id="header"> </div> <div id="menu"> <ul> <li class="first"><a href="#" accesskey="1" title="">Home</a></li> <li><a href="#" accesskey="2" title="">About</a></li> <li><a href="#" accesskey="3" title="">Articles</a></li> <li><a href="#" accesskey="4" title="">\links</a></li> <li><a href="#" accesskey="5" title="">Contact Us</a></li> </ul> </div> <div id="page"> <div id="content"> <div class="post"> <h2 class="title"><a href="#">Welcome to True Nature </a></h2> <p class="meta">Posted by <a href="#">Someone</a> on February 10, 2011 • <a href="#" class="comments">Comments (64)</a> • <a href="#" class="permalink">Full article</a></p> <div class="entry"> <p><img src="images/img08.jpg" width="143" height="143" alt="" class="alignleft border" />This is <strong>TrueNature </strong>, a free, fully standards-compliant CSS template designed by FreeCssTemplates<a href="http://www.nodethirtythree.com/"></a> for <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>. The picture in this template is from <a href="#">PDPhoto.org</a>. This free template is released under a <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attributions 2.5</a> license, so you’re pretty much free to do whatever you want with it (even use it commercially) provided you keep the links in the footer intact. Aside from that, have fun with it </p> <p class="clearfix"> </p> </div> </div> <div class="post"> <h2 class="title"><a href="#">Lorem ipsum sed aliquam</a></h2> <p class="meta">Posted by <a href="#">Someone</a> on February 8, 2011 • <a href="#" class="comments">Comments (64)</a> • <a href="#" class="permalink">Full article</a></p> <div class="entry"> <p><img src="images/img07.jpg" width="143" height="143" alt="" class="alignleft border" />Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer. Donec ipsum. Proin imperdiet est. Phasellus <a href="#">dapibus semper urna</a>. Pellentesque ornare, consectetuer nisl felis ac diam. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer. </p> <p class="clearfix"> </p> </div> </div> <div class="post"> <h2 class="title"><a href="#">Phasellus pellentesque turpis </a></h2> <p class="meta">Posted by <a href="#">Someone</a> on February 8, 2011 • <a href="#" class="comments">Comments (64)</a> • <a href="#" class="permalink">Full article</a></p> <div class="entry"> <p><img src="images/img09.jpg" alt="" width="143" height="143" class="alignleft" />Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer. Donec ipsum. Proin imperdiet est. Pellentesque ornare, orci in consectetuer hendrerit, urna elit eleifend nunc. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. </p> <p class="clearfix"> </p> </div> </div> <div style="clear: both;"> </div> </div> <!-- end #content --> <div id="sidebar"> <ul> <li> <h2>Aliquam tempus</h2> <p>Mauris vitae nisl nec metus placerat perdiet est. Phasellus dapibus semper hendrerit.</p> </li> <li> <h2>Categories</h2> <ul> <li><a href="#">Aliquam libero</a></li> <li><a href="#">Consectetuer adipiscing elit</a></li> <li><a href="#">Metus aliquam pellentesque</a></li> <li><a href="#">Suspendisse iaculis mauris</a></li> <li><a href="#">Urnanet non molestie semper</a></li> <li><a href="#">Proin gravida orci porttitor</a></li> </ul> </li> <li> <h2>Blogroll</h2> <ul> <li><a href="#">Aliquam libero</a></li> <li><a href="#">Consectetuer adipiscing elit</a></li> <li><a href="#">Metus aliquam pellentesque</a></li> <li><a href="#">Urnanet non molestie semper</a></li> <li><a href="#">Proin gravida orci porttitor</a></li> </ul> </li> <li> <h2>Archives</h2> <ul> <li><a href="#">Aliquam libero</a></li> <li><a href="#">Consectetuer adipiscing elit</a></li> <li><a href="#">Metus aliquam pellentesque</a></li> <li><a href="#">Suspendisse iaculis mauris</a></li> <li><a href="#">Urnanet non molestie semper</a></li> <li><a href="#">Proin gravida orci porttitor</a></li> </ul> </li> <li> <h2>Recent Post</h2> <ul> <li><a href="#">Aliquam libero</a></li> <li><a href="#">Consectetuer adipiscing elit</a></li> <li><a href="#">Metus aliquam pellentesque</a></li> <li><a href="#">Urnanet non molestie semper</a></li> <li><a href="#">Proin gravida orci porttitor</a></li> </ul> </li> </ul> </div> <!-- end #sidebar --> <div style="clear: both;"> </div> </div> </div> <div id="footer"> <p>Copyright © 2010 TemplateName. Designed by <a href="http://www.freecsstemplates.org/"><strong>CSS Templates</strong></a> | <a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></p> </div> </body> </html>
  23. Hello Ben, Thanks for your reply to my last query,it was indeed about whether or not most smart phones do support JavaScript, and your reply made things clearer. I'm working on customising this CSS template that I got from the Free CSS templates site which you recommended to me a little while back. I've got the template HTML and CSS code, but there's this margin line splitting the page and I can't get rid of it. I've gone through various trial and error attempts to get rid of that line but I can't figure out which line(s) need to be removed. Here's the CSS,thanks in advance for your help Ben, Regards, Andrew. html, body { height: 100%; } body { margin: 0px; padding: 0px; background: #3A3A3A; font-family: Arial, Helvetica, sans-serif; font-size: 13px; color: #000000; } h1, h2, h3 { margin-top: 0px; } p, ol, ul { margin-top: 0px; } p { line-height: 170%; } ul { margin: 0px; padding: 0px; list-style: none; } strong { } a { color: #A5C35C; } a:hover { text-decoration: none; } a img { border: none; } img.border { } img.alignleft { float: left; padding-right: 25px; } img.alignright { float: right; } img.aligncenter { margin: 0px auto; } hr { display: none; } /** WRAPPER */ #wrapper { } .container { width: 980px; margin: 0px auto; } .clearfix { clear: both; } /** HEADER */ #header { width: 960px; height: 292px; margin: 0px auto; background: url(images/img02.jpg) no-repeat left top; } /** LOGO */ #logo { width: 960px; height: 80px; margin: 0px auto; text-transform: uppercase; } #logo h1 a { display: block; margin: 0px; padding: 10px 0px 0px 0px; font-size: 36px; } #logo p { margin: -28px 0px 0px 5px; padding: 0px; font-size: 12px; } #logo a { text-decoration: none; } /** MENU */ #menu { width: 960px; height: 48px; margin: 0px auto; background: url(images/img03.jpg) no-repeat left top; } #menu ul { margin: 0px; padding: 0px; list-style: none; line-height: normal; } #menu li { float: left; } #menu a { display: block; height: 32px; margin: 0px 0px 0px 0px; padding: 16px 25px 0px 25px; text-decoration: none; text-transform: uppercase; font-size: 11px; font-weight: bold; color: #FFFFFF; } #menu a:hover { background: #000000; text-decoration: none; color: #FFFFFF; } #menu .first a { background: #000000 url(images/img04.jpg) no-repeat left top; color: #FFFFFF; } /** PAGE */ #page { width: 960px; margin: 0px auto; padding: 30px 0px 10px 0px; } /** CONTENT */ #content { float: center; width: 610px; padding-right: 30px; background: url(images/img06.jpg) repeat-y right top; } /** SIDEBAR */ #sidebar { float: center; width: 300px; } #sidebar h2 { padding: 0px 0px 10px 0px; text-transform: uppercase; font-size: 18px; } #sidebar li ul { margin: 0px 0px 0px 20px; padding: 0px 0px 20px 0px; } #sidebar li li { padding: 0px 0px 5px 0px; } #sidebar p { margin: 0px 0px 20px 20px; } /** POST */ .post { margin-bottom: 20px; background: url(images/img05.jpg) repeat-x left bottom; } .post .title { margin: 0px; padding-bottom: 10px; letter-spacing: -1px; } .post .title a { border: none; text-decoration: none; text-transform: uppercase; font-size: 22px; color: #000000; } .post .meta { display: block; margin-top: -15px; padding: 5px 0px; text-align: left; font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-style: italic; } .post .meta a { } .post .entry { text-align: justify; padding: 10px 0px 10px 0px; } /** FOOTER */ #footer { width: 960px; margin: 0px auto; background: url(images/img05.jpg) repeat-x left top; } #footer p { margin: 0px; padding: 20px 0px 20px 0px; text-align: center; font-size: 11px; } #footer a { color: #000000; }
  24. Hello Ben, Thank you to the solution to my e-mail query from a couple of weeks back. I apologise in replying so late to your explanation but we had family commitments during that time period. My queries today are not directly code related but are about web browsing. -Do we actually "browse" web pages on smart phones and PDA's? -Do smart phones actually"support" JavaScript? Many thanks in advance for your time Ben,I hope your work is going OK too. I'll look forward to posting more regularly from now on. Regards, Andrew.
  25. Hi Ben, Thanks for your insight, I realised I hadn't added the form with the e-mail address field. Here's the code I reworked: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>E-MAIL INFO</TITLE> </HEAD> <BODY> <script LANGUAGE="JavaScript"> <!-- function showUpper(checked) { var showThis; if (checked) { showThis = document.myForm.name.value.toUpperCase(); } else { showThis = document.myForm.name.value.toLowerCase(); } document.myForm.name.value = showThis; } function emailTest(form) { if (form.email_address.value.indexOf("@", 0) < 0) { alert("This is not a valid e-mail address!"); } else { alert("This could be a valid e-mail address"); } } //--> </SCRIPT> <FORM NAME="myForm"> Name:<BR> <INPUT TYPE="text" SIZE="30" NAME="name"> <INPUT TYPE="checkbox" NAME="upperCheckbox" onClick="showUpper(this.checked);"> Covert string to uppercase or lowercase<BR> Email address:<BR> <INPUT TYPE="text" SIZE="30" NAME="email_address"> <INPUT TYPE="checkbox" onclick="(this.checked) ? emailTest(this.form) : '';"> Test for email address<BR> </FORM> </BODY> </HTML> The first field turns the user's name to upper case The second field forces the user to input the @ sign in the e-mail address. How can I modify the email Test function to ensure that it contains the .com suffix? Also Ben,when I reply to your mails, I click: -'Reply' -start typing after the /quote part of your reply -Click 'Add reply' How can I : -Reply to you without having your last mail attached to my reply?And -Does my reply appear on the forum or are we in a private conversation? Thanks for your help Ben, Regards, Andy. 0
×
×
  • Create New...