Jump to content

Leaderboard


Popular Content

Showing most liked content since 01/23/2018 in all areas

  1. 2 points
    Included files must have <?php ?> blocks around the code.
  2. 1 point
    Anytime you're checking for input values in POST, GET, or COOKIE you should use isset () to check that they exist before doing any operations with them. This is not new to PHP. My guess is that previously you had warnings turned off. Using empty () also works since it uses isset () internally.
  3. 1 point
    I can not fix this script, because the output is not in sync. I have 3 arrays. 1) present column names. 2) prefix (fixed name). 3) suffix (uniqid value). Can someone explain how exactly I should create a foreach loop in a foreach loop with 3 arrays and fetching the field value from the get_result command as the the value it is related to. This would result in: <---->Present Column Name <-----> New Column Name <---->value1 <--------------------------------> value1_abcd <---->value2 <------------------------------> value2_abcd etc. <?php $prefix_arr = array( 'col_a' , 'col_b' ,'col_c' , 'col_d', 'col_e' , 'col_f' , 'col_g' , ) ; $col2 = uniqid(); $suffix = substr($col2, 5, 11); $servername = "localhost"; $username = "userx"; $password = "pass12345"; $dbname = "test_database"; $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $stmt = $conn->prepare("SHOW COLUMNS FROM table_xyz"); $stmt->execute(); $res = $stmt->get_result(); $pres_colname = $res; // var_dump($prefix_arr); foreach ($prefix_arr as $los_ele){ $prefix = $los_ele; // var_dump($prefix); // var_dump($suffix); $col_new = $prefix."_".$suffix; //var_dump($col_new); foreach ($pres_colname as $val){ $col = $val['Field']; // var_dump($col); ?> <br><input type="text" value =" <?php echo $col; ?>"><input type="text" value ="<?php echo $col_new;?>"> <?php $stmt = $conn->prepare("ALTER TABLE `table_xyz` CHANGE COLUMN `$col` `$col_new` VARCHAR(30) NOT NULL;"); $stmt->execute(); } } //$stmt->close(); $conn->close(); ?> The complicated thing this time is that I need the exact 'Field' value which is an output of get_result, so I can not fit it in.
  4. 1 point
    OR use array $pr_ar $key in foreach to apply index key ref to the newly created array item each loop $pr_ar = array(0 => 'cola', 1 => 'colb', 2 => 'colc', 3 => 'cold'); $unique = uniqid(); $suf = substr($unique, 0, 11); foreach ($pr_ar as $key => $pre) { $new_col = $pre . $suf; $cna = []; $cna[$key] = $new_col; var_dump($cna); } ?> It will give the correct result from your previous post, but why create another array? just gather the string value on each loop, and use to rewrite column name, if this is to used to change column names? as indicated by another topic.
  5. 1 point
    I wouldn't recommend using this code. First, there's a polyfill to define document.getElementsByClassName if it's not already defined, that's there to support browsers older than IE11. document.getElementsByClassName is supposed to return a list of elements that have a particular class. That's all the result array is used for. That's the list of matching elements that gets returned. The addTracker function is supposed to be a cross-browser way to attach an event, but it's not written correctly. Spot the error: if (obj.addEventListener) { obj.addEventListener(type, fn, false); } else if (obj.addEventListener) { The get_targeted_links function is going to immediately send a tracking request for all links on the page, it does not wait for them to be clicked. In fact, nothing happens when they are clicked. That's where he sets the source of a new image to the PHP page. The browser will send a request for that URL. That's a rather lazy way of sending data to the server. Ajax communication has been possible since IE5, I'm not sure why he describes setting the src of an image as "genius". About the only thing that will do is only cause 1 tracking request per user because the browser will cache that URL thinking it's supposed to be an image. That "addTracker" function is just supposed to assign an event handler to an element. We already have terminology for that so I'm not sure why he's calling event handlers "trackers". Then, finally, all he's doing is tracking page clicks. That would only be useful if he's trying to track clicks to external websites, otherwise his own web server is already keeping logs of every page the server sends out, and there are plenty of statistics packages to analyze server logs. Then there are things like Google Analytics which will capture the same kind of information and a whole lot more. So I'm not sure how much information he's really gathering that's going to be useful. The save_click function also has a while loop at the end that compares the current timestamp to a variable called then, but he never sets the value of then. I'm not sure what the point of that loop is, but you never want to use infinite loops in Javascript, you'll bring the browser down. There's always a better way to do something than have a while loop keep going until the time changes.
  6. 1 point
    Unless its changed, focus is limited to inputs and anchor elements, so targeting elements other than these is your problem. From https://api.jquery.com/focus/ The focus e vent is sent to an element when it gains focus. This event is implicitly applicable to a limited set of elements, such as form elements (<input>, <select>, etc.) and links (<a href>). In recent browser versions, the event can be extended to include all element types by explicitly setting the element's tabindex property. An element can gain focus via keyboard commands, such as the Tab key, or by mouse clicks on the element.
  7. 1 point
    Yes. Is there anything in the included file db.php that produces printed output -- say, an echo(), print_r(), or similar such statement? Roddy
  8. 1 point
    Ex 2; https://validator.w3.org/nu/?showsource=yes&doc=http%3A%2F%2Fwww.grammarcaptive.com%2Fpodcast_hostpage.php%3Fhash%3D30a6836a3f7c5fc57751a61098e5c221%26podcast_no%3D21#l452c96 Compared to Ex 1 https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.grammarcaptive.com%2Fpodcast_hostpage.php&showsource=yes Ex 3 https://validator.w3.org/nu/?showsource=yes&doc=https%3A%2F%2Fwww.grammarcaptive.com%2Fpodcast_hostpage.php%3Fhash%3D30a6836a3f7c5fc57751a61098e5c221%26podcast%3D21 Even though they have errors, they don't have misplaced or extra closing elements, which is causing alignment issue because the wrapper only wraps the header and does not wrap sidebar OR footer elements. The wrappers bottom margin causes the misalignment of sidebar.
  9. 1 point
    For some reason with Experiment Two, the pagewrap element is not enclosing the sidebar and footer elements, the border along with bottom margin appears wrapping round the header only, which pushes the unenclosed sidebar down. I think you have a extra misplaced closing div after closing main tag, as when viewing page source, the last div is highlighted in red, indicating there is no relative opening div tag to go with it.
  10. 1 point
    My solution is to use click/touch instead of hover. Keep in mind also that hover doesn't work on mobile devices, the browser doesn't know when you're just pointing at something.
  11. 1 point
    You need to do some debugging. You can't just copy some code and give up when the code doesn't work. Look for solutions. You have one single condition to test for here: if($row['amount'] > 0) { header('Location: http://www.example.com/'); } If it redirects, then the count is greater than zero, if it does not redirect then the count is zero or less. You have to do some debugging to find out why this number is zero or less. To start off, print the number. Since it's not redirecting, my guess is that the number is zero, but you should check to make sure. Once you have verified that the number is actually zero then that's clear evidence that the database table does not have any rows that match your query. Maybe there's something wring with your query. The query has two inputs, $user_name and $password. Print out both their values, then check the database table for yourself using phpMyAdmin or similar software to see if there is a row that contains both of those values. There are two possibilities: The values you passed into the query are wrong or the database actually does not contain that data. I can't tell you why the code is not working, but I've just told you how you can find out.
  12. 1 point
    No, that wouldn't work. The function needs a name if you want to use it like that, and there's no guarantee that the file has been parsed yet when the callback is executed. If you want to go with the anonymous function, have it executed as soon as its declared like this: (function() { // Function content })(); // Executed immediately. // Load the external file, it runs on its own so nothing else needs to be done $.getScript('data.js'); I don't really get the point of loading a separate file containing Javascript, though. It's better to just load a script file containing all the functions when the page loads using a <script> tag and then call those functions by name whenever they're needed.
  13. 1 point
    What do you want to happen if they select a language and also type one in? That's a decision for you to make. The rest is just a little logic when you validate the form.
  14. 1 point
    Insert the following code echo $row['amount']; after the following line of code $row = $cf->fetch(PDO::FETCH_ASSOC); and see if its value is, indeed, greater than zero. For, if it is not, you have not met the condition of the if-statement in which the header() function is located. Roddy
  15. 1 point
    URLs take this form, things in brackets are optional: scheme:[//[user[:password]@]host[:port]][/path][?query][#fragment]
  16. 1 point
    The default. Don't set the data type, don't set the content type. It will send the request to PHP using the appropriate content type, and PHP will send the response with a content-type of text/html as the default. That should be fine. You can even use those settings with JSON data. If you're trying to send a bunch of post data, don't use JSON to convert that to non-post data, just set the data object/string like you would for any other post request. Post data is not submitted using JSON, so if you try to force that then PHP isn't going to know what to do with it. Just submit it as regular form data.
  17. 1 point
    Have you checked to see what the contents of the dataString variable look like? var dataString = JSON.stringify(name,email,mobile); I don't think it translates into the POST variables you're expecting.
  18. 1 point
    You are looking for something like this I thinks <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" id="viewport" content="target-densitydpi=high-dpi,initial-scale=1.0" /> <title>Document Title</title> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script> <style type="text/css"> </style> </head> <body> <form id="sevengates"> <input type="text" name="name" value="Steve Majors"> <input type="email" name="email" value="Steve@Majors.com"> <input type="text" name="mobile" value="077123456789"> <input type="submit" name="submitthis"> </form> <script> $("#sevengates").submit(function(e) { e.preventDefault(); $.ajax({ type: "POST", url: "newsletter_filler_form.php", data: {name: $(this).find("input[name='name']").val(), email: $(this).find("input[name='email']").val(), mobile: $(this).find("input[name='mobile']").val(), dataType: 'json'}, success: function(jsonData) { alert(jsonData) } }); }); </script> </body> </html> and finally <?php $phpObj = (object) []; If (isset($_POST['name'], $_POST['email'], $_POST['mobile'])) { $phpObj->name = $_POST['name']; $phpObj->email = $_POST['email']; $phpObj->mobile = $_POST['mobile']; echo json_encode($phpObj); } If you are going to encode it you require name and value, to send multiple value, you require array with named indexes and values associated to them, or object array where you can define the object and apply data to it.
  19. 1 point
    The new created div with id="message", and after that the code that adds the header text will work fine, because it is newly referring to this specific element once it is created, but take the image with id="checkmark" IF ANY js code from the actual page, that was targeting this img with this id on loading, would not work because it did not exist when the page was loaded. Unless jquery '.on() was used or the js code targeting this img was added after the img was appended, like how the header and text was added after #message element was added.
  20. 1 point
    Try this $.ajax({ url: 'newsletter_filler.php', data: {name: 'personal', length: 200}, dataType: 'JSON', statusCode: { 404: function() { alert("Page not found"); }}, success: function(jsonData) { console.log(jsonData); $.getScript('wordcount.js').done(function() { setWordConstraint(jsonData.personal['id'], jsonData.personal['length']); }); } }); The done() make sure script has completed, I don't know why used each function, as it will only loop through one set of json associated index row data? unless you plan to expand on this where multiple row of data will be read.
  21. 1 point
    I think you might want to add a "#" to the id selector in these lines of code: $("#" + id + ' span.word_limit').text(max); $("#" + id + ' textarea').on('keydown', function(e) { $("#" + id + ' span.display_count').text(words); $("#" + id + ' span.words_remaining').text(max-words); To write to the console, it's console.log()
  22. 1 point
    The CSS and HTML will work as intended. I do not know how jQuery's getScript() method works, their documentation does not make it clear what is passed to the callback function, it just says "data" but that could refer to the file's contents, or something else. In any case, the following line of code will do nothing because it's local to the callback function: var wordmax = jsonData; You need to do something with the wordmax variable if you want it to work. If wordcount.js has a function in it, you could pass wordmax to that function as a parameter, but considering that wordmax contains data that's already in wordcount.js, you probably shouldn't have to do that. Another thing to note is that the order in which the HTML, CSS and JS are returned from your function calls is unpredictable because they are asynchronous. The JS might load first and try to manipulate HTML that does not yet exist.
  23. 1 point
    What is $flash? Is that a PDO object?
  24. 1 point
    Eliminate all blank spaces before the header() function is invoked. There should be no blank lines, and no blank spaces after each EOL delimiter. This is, by far, the most common source of a failed header() function. Well, at least in my experience. Roddy
  25. 1 point
    Yes, you can pass values through the query string. They will be accessible through the $_GET array.
  26. 1 point
    Most certainly it's violating copyright. It's two years out of date, so the content may not be as accurate as the current W3Schools website.
  27. 1 point
    The real_escape_string() function is not needed for prepared statements, in fact it will probably add unnecessary backslashes which make the query not return the expected results.
  28. 1 point
    You should not have any data inside the query if you're using prepared statements at all. That hash value should be passed to the prepared statement, not put inside the SQL. And when you pass data to prepared statements it will always handle the data correctly, you don't need to sanitize anything. The problems you're seeing with that are how PHP handles strings in general, it doesn't have anything to do with MySQL or SQL in general or prepared statements, it's PHP doing what it thinks you want to do with that string.
  29. 1 point
    Because all the menu anchor links are floated left, any non float: left; element placed at beginning will be forced right by these elements. So make it float: left; also.
  30. 1 point
    https://www.w3schools.com/code/tryit.asp?filename=FO133WMN1LUP The position: fixed; nav element (container element) with property top:0; forces IT, menu items, and if you add image like I have done within IT, to be fixed to top of browser window.
  31. 1 point
    You can't use array_merge with $_GET['letter_no'] because it's not an array. The array_merge function combines two arrays. If you want to add a scalar value to your array, you would do so the regular way: $_SESSION['key'] = $value array_merge() does not change either of the source arrays, instead it returns a completely new array based on the inputs.
  32. 1 point
    To address your original error, note that prepare returns false if it fails: http://php.net/manual/en/mysqli-stmt.prepare.php The error message from MySQL does not get automatically printed by PHP. If you're not checking for errors and error messages then you're going to end up in a staring contest with your code until the truth reveals itself. Don't do that, just print the error message and figure out exactly why it's not working. if (!$mysqli_stmt->prepare($sql_select)) { echo $mysqli_stmt->error; } The same is true for other methods like bind_param, with the mysqli extension you need to check for errors yourself and print the messages.
  33. 1 point
    OK, I'm the idiot, I read your reply as "caused the error", not "caught the error". It doesn't look like you're using prepared statements though.
  34. 1 point
    This is also another reason to use prepared statements. In your second example, since you are using a double-quoted string, PHP sees $OiW8q... as being a variable and trying to substitute the value. That's why you use prepared statements, so things like that don't happen.
  35. 1 point
    Every time the user opens a page on your website, they send cookies belonging to your domain. Aside from being the program that sends the session cookie, the browser is irrelevant to how sessions work. The browser does not know what a session is, it just sends cookies. When PHP's session_start() method is called, it uses the ID provided by the session cookie, searches for data from the specified session based on that ID and stores that data into the $_SESSION variable, which is available to you. $_SESSION is just a regular array, the only difference being that its value is retained when the user changes pages. Session restrictions are exactly the same as cookie restrictions: The session expires when the session's cookie expires The same session can be used every single PHP page from the domain that the cookie belongs to, including subdomains. Cookies have the option to be restricted to particular subdomains or even directories if necessary. You can set the cookie parameters using session_set_cookie_params().
  36. 1 point
    You may have two problems 1) Use double quotes to surround SQL, single quote for text string within double quotes. 2) HASH is a keyword that has significance in SQL https://dev.mysql.com/doc/refman/5.5/en/keywords.html you might want to use backticks for that column name, so no conflict occurs.
  37. 1 point
    ?? a.pc_link:link { color: #999999; font-weight: normal; text-decoration: none; } a.pc_link:visited { color: #aaaaaa; font-weight: normal; } a.pc_link:hover { color: #ffffff; font-weight: bold; } a.pc_link:active { color: #fadb9d; font-weight: bold; } but these do, the styling will be overridden by #middle a:hover { color: #999999; font-weight: 800; } #middle a:link { color: #5a4149; font-weight: 400; text-decoration: none; } and so on.
  38. 1 point
    You would want to merge the two arrays, you can use array_merge() for that.
  39. 1 point
    The sub menu is supposed to be taken out flow from other elements by using position: absolute; .main-menu-list { position: absolute; } You will also find z-index won't take effect unless position: absolute, relative or fixed are used.
  40. 1 point
    That expression copies the data from $_GET to the session. It has drawback of overwriting all the rest of the data you may have had in the session previously. Instead, you can create a session variable just for the GET data. $_SESSION['parameters'] = $_GET; If you're doing a query with the GET data and want the query result on multiple pages then it would be far more efficient to store the query results in the session instead of the GET parameters.
  41. 1 point
    This is how you increment the value of a field with an SQL query: UPDATE `field1` SET `field1` = `field1` + 1 WHERE `field2` = 'value' You probably will need to adjust this query to match your table's structure and software requirements. Since I don't have any information about your project or database structure I'm just providing a very generalized solution.
  42. 1 point
    There's literally no reason to do that. You don't have to pass it as a parameter, it's called a "superglobal" for a reason. If you want to pass a parameter telling it whether or not to check in $_GET that's one thing, but there's no reason to copy the data and pass that. Also, there's no reason to use both isset and empty - the description for empty says it will only return true if the variable is set and is not empty. In other words, calling empty includes an implicit call to isset.
  43. 1 point
    In the function construct, one of the parameters is the super global $_GET. After doing some testing just to be certain, you cannot re-assign values to it. This is the error I got while testing: Fatal error: Cannot re-assign auto-global variable _GET in /Applications/MAMP/htdocs/testing/classTest.php on line 12 Did you see this error? I noticed the super global $_GET earlier in the construct but dismissed/overlooked it.
  44. 1 point
    Have you tried printing the stmt and result objects after the match attempt to see for errors? Also not sure if this may be the issue but I don't think you need to call the first line below because when calling 'prepare' it returns a stmt object for you. $mysqli_stmt = $this->mysqli_obj->stmt_init(); $mysqli_stmt->prepare($sql_select); So instead try: $mysqli_stmt = $this->mysqli_obj->prepare($sql_select); Also noticed: $match = mysqli_num_rows($mysqli_result); Looks like calling procedural function calling attempt? Instead for number of rows, try: $mysqli_stmt->num_rows Use in the if condition instead of $match > 0. Also noticed and just to note, when calling a function from another function within the same object, use $this->update_record(); instead of just update_record(); Good luck! I'm sure some of the others will be here to assist as well!
  45. 1 point
    It would be easier to address this if you could show examples of your template and maybe the data.
  46. 1 point
    The following SQL statement is in error $sql = "INSERT INTO users (fname, lname, uname, email, pwd, ) VALUES ('$fname', '$lname', '$uname', '$email' '$pwd')"; You have a comma after the variable name pwd that does not belong, and you left out the necessary comma between the two variable values $email and $pwd. Roddy
  47. 1 point
    It might be an SSL problem on your server, a workaround is described here: https://github.com/PHPMailer/PHPMailer/issues/1022
  48. 1 point
    If you decide to go with that approach, it is. The server would return a JSON structure a bit like this: { "html" : "<div class=\"something\">Some content</div>", "stylesheet" : "/css/style.css" } There are hundreds of potential solutions, that's just one of them. Programming is about identifying and solving problems. I'm not saying this is the best solution for your project, it is just one of them.
  49. 1 point
    Hey w3schools, I am a huge fan of python language and I am currently learning flask. In general there is also a huge community using python for web applications. Have you any plans to add Python (Flask or Django) to w3schools?
  50. 1 point
    If you have a solution to a common HTML or XHTML problem, you can PM me. Please provide the problem and solution with a reference to the website where you found this (if applicable).HOW DO I Make a Guestbook in HTML? Make a Forum in HTML? Make a Blog in HTML? Send emails from a form in HTML? The short answer is, you can't. Basically, any site where you want the visitor/client/user to be able to interact with something on the website, you need what is called Serverside Technologies, that is a Programming Language that executes commands and processes the input from the visitor/client/user, and a Database of some sort that the Programming Language can use as storage space. Look under "Server Scripting" and ".NET (dotnet)" for some popular Programming Languages. Some more that (as of now) are not covered by w3schools include Cold Fusion (CF) and Java Server Pages (JSP) to name a few. TUTORIALS http://w3schools.com/html/default.asphttp://w3schools.com/xhtml/default.asp NOVICE Incorrect Nesting of ElementsElements in HTML cannot overlap each other. The following is invalid:<strong><em>Incorrect nesting</strong></em>In this example, the B element is intended to contain an I element. To be truly contained within the B element, the I element's end tag must occur before the B element's end tag. The following is valid:<strong><em>Correct nesting</em></strong>Using all lowercase letters in a DOCTYPEIn a DOCTYPE, the formal public identifier--the quoted string that appears after the PUBLIC keyword--is case sensitive. A common error is to use the following:<!doctype html public "-//w3c//dtd html 4.0 transitional//en">Here the formal public identifier (FPI) is all lowercase. The validator does not recognize the document as HTML 4.0 Transitional since the expected FPI for HTML 4.0 Transitional uses different case:<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">Missing a required sub-element of HEADIf you receive the error "Missing a required sub-element of HEAD", check that you have included the TITLE element in the HEAD. The TITLE element is required in all HTML documents.Uppercase letters in XHTML tagsIn XHTML, unlike HTML, element and attribute names must be all lowercase. For example, onMouseOver is an invalid attribute in XHTML, which requires use of onmouseover instead. Either is fine in HTML.Email form to yourselfYou'll need to define the action attribute in your form element. Like so <form method="post" action="mailto:myemail@domain.com">It is recommended to use server-side scripting languages such as asp, php, coldfusion... to handle a form. This way the user which submits your form won't need to have a mailing application on his computer and you have more power over the data that is sent to you.Linking within a documentLinks that link within a document work almost the same way as external links using the <A> tag. However, there is an extra step involved. With these types of links you have to create the link and the target.This is how you link to a specific section in a document.<a href="page.html#section1">section 1</a>When you are linking in the same document where the section is you may remove the url in front of the #.<a href="#section1">section 1</a>Here is how you set the section, this is where the link will go to.<a name="section1"></a> INTERMEDIATE Validation Problems with ASCII CharactersOne of the requirements of XHTML-Strict validation is to code certain characters in ASCII syntax. Below is a list of characters and the ASCII equivalents that must be used to achieve proper validation. & = &< = <> = >...Closing /When coding in XHTML you are required to close all non-closing elements with a / at the end.HTML: <img src="images.jpg" alt="">XHTML: <img src="images.jpg" alt="" />Here is a list of non closing elements: br, hr, img, input, link, meta and script (optional).Attribute MinimizationIncorrect: <textarea readonly>READ-ONLY</textarea>Correct: <textarea readonly="readonly">READ-ONLY</textarea>Same goes for selected, should be selected="selected".Deprecated ElementsOlder HTML tags and attributes that have been superseded by other more functional or flexible alternatives (whether as HTML or as CSS) are declared as deprecated in HTML4 by the W3C - the consortium that sets the HTML standards. Browsers should continue to support deprecated tags and attributes, but eventually these tags are likely to become obsolete and so future support cannot be guaranteed.<applet>, <basefont>, <center>, <dir>, <font>, <isindex>, <menu>, <s>, <strike>, <u> and <xmp>. ADVANCED When to use IDs and ClassesClasses aren't always necessary! If every <p> element is going to have the same style, adding a class to every paragraph is redundant at best.IDs should be unique on a page. Let me repeat that: don't reuse IDs! Remember that ID is an abbreviation for "identifier". Use IDs to target specific, individual elements.Classes are meant to be reused. They work great for things like alternating background colors in table rows. (Give every second row a class="alt-bg", for example.)When to use DIVs and SPANsOverviewThe primary difference between the <span> and <div> tags is that <span> doesn't do any formatting of it's own. The <div> tag acts includes a paragraph break, because it is defining a logical division in the document. The <span> tag simply tells the browser to apply the style rules to whatever is within the <span>.DIVThe <div> tag defines logical divisions (defined) in your Web page. It acts a lot like a paragraph tag, but it divides the page up into larger sections.<div> also gives you the chance to define the style of whole sections of HTML. You could define a section of your page as a call out and give that section a different style from the surrounding text.But that's not all it does! The <div> tag gives you the ability to name certain sections of your documents so that you can affect them with style sheets or Dynamic HTML.One thing to keep in mind when using the <div> tag is that it breaks paragraphs. It acts as a paragraph end/beginning, and while you can have paragraphs within a <div> you can't have a <div> inside a paragraph. SPANThe <span> tag has very similar properties to the <div> tag, in that it changes the style of the text it encloses. But without any style attributes, the <span> tag won't change the enclosed items at all.The primary difference between the <span> and <div> tags is that <span> doesn't do any formatting of it's own. The <div> tag acts includes a paragraph break, because it is defining a logical division in the document. The <span> tag simply tells the browser to apply the style rules to whatever is within the <span>. GOOD PRACTICE Quoting all attribute valuesExample: <td rowspan=3>Correct syntax: <td rowspan="3">This is required for XHTML.Lowercase tagsExample: <STRONG>Correct syntax: <strong>This is required for XHTML.Validate your codeAlways validate your code. W3C HTML/XHTML Validator REFERENCES http://htmlhelp.com/tools/validator/problems.htmlhttp://www.andybudd.com/archives/2004/08/m...n_css_problems/http://www.blackwidows.co.uk/resources/tut...mon-errors.htmlhttp://w3schools.com/tags/default.asphttp://dhost.info/profmemberone/Pages/deprecated.phphttp://webdesign.about.com/od/htmltags/a/aa011000a.htmmyself!
×