The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

3 Pages V  1 2 3 >  
Reply to this topicStart new topic
> cant update?
xxkasperxx
post Jan 13 2012, 09:45 AM
Post #1


Serious Coder
*****

Group: Members
Posts: 261
Joined: 30-April 11
Member No.: 14,449



I am trying to create a really simple cms.. here is my code.


sent.php
CODE

<?php
// connect here
$left = $_POST['leftside'];


$result = mysql_query('UPDATE about SET left = "$left" WHERE id = 1');
if (!$result) {
die('Invalid query: ' . mysql_error());
}


//echo 'Your request has been sent';

?>

Member.PHP
CODE

<?php

session_start();


if($_SESSION['username'])
{
    echo "Welcome, ".$_SESSION['username']."!<br><a href='logout.php'>Logout</a><br>";
    $directions = "<h3>Directions:</h3>To edit text, simply click in one of the boxes you wish to change.<br> Click save to save your change. <br> Once you press save, the update will be sent automatically to the Live Site!<br>";
    
     // connect here

    $query = mysql_query("SELECT * FROM about");
    $query_row=mysql_fetch_array($query);

    echo $directions;
    
    
    
}
else
    die("You must be logged in!");
?>

<html>
<head>
<link href="css/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<br />


<div class="column one">
<form method="post" action="sent.php">
<table >
<tr>
<td >
  <label for="leftside"><h4>Home-Left-Side:</h4></label>
</td>
<td valign="top" >
  <textarea  name="leftside" maxlength="1000" cols="30" rows="20" value="lol"><?php echo($query_row[left]); ?></textarea>
  <br />
  <input type="submit" value="Submit">
  <input type="reset" value="Reset">
</table>
</div>

<div class="column two">
<form name="contactform" method="post" action="feedback.php">
<table >
<tr>
<td >
  <label for="comments"><h4>Home-Right-Side:</h4></label>
</td>
<td valign="top" >
  <textarea  name="comments" maxlength="1000" cols="30" rows="21" value="lol"><?php echo($query_row[right]); ?></textarea>
  <br />
  <input type="submit" value="Submit">
  <input type="reset" value="Reset">
</table>
</form>
</div>

</body>
</html>



I keep getting this error on the "Sent.php" page..

Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left = "$left" WHERE id = 1' at line 1

Please help
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Jan 13 2012, 01:21 PM
Post #2


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



QUOTE
Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left = "$left" WHERE id = 1' at line 1


If this is an SQL error, there should not be a '$' in it! Probably you have the quoting wrong (e.g. ' ' instead of " ") somewhere in the program.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Ephraim F. Moya
post Jan 14 2012, 03:23 PM
Post #3


Advanced Member
****

Group: Members
Posts: 167
Joined: 2-September 07
From: New Mexico
Member No.: 3,702



QUOTE(xxkasperxx @ Jan 13 2012, 07:45 AM) *

I am trying to create a really simple cms.. here is my code.


sent.php
CODE

<?php
// connect here
$left = $_POST['leftside'];


$result = mysql_query('UPDATE about SET left = "$left" WHERE id = 1');
if (!$result) {
die('Invalid query: ' . mysql_error());
}


//echo 'Your request has been sent';

?>

Member.PHP
CODE

<?php

session_start();


if($_SESSION['username'])
{
    echo "Welcome, ".$_SESSION['username']."!<br><a href='logout.php'>Logout</a><br>";
    $directions = "<h3>Directions:</h3>To edit text, simply click in one of the boxes you wish to change.<br> Click save to save your change. <br> Once you press save, the update will be sent automatically to the Live Site!<br>";
    
     // connect here

    $query = mysql_query("SELECT * FROM about");
    $query_row=mysql_fetch_array($query);

    echo $directions;
    
    
    
}
else
    die("You must be logged in!");
?>

<html>
<head>
<link href="css/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<br />


<div class="column one">
<form method="post" action="sent.php">
<table >
<tr>
<td >
  <label for="leftside"><h4>Home-Left-Side:</h4></label>
</td>
<td valign="top" >
  <textarea  name="leftside" maxlength="1000" cols="30" rows="20" value="lol"><?php echo($query_row[left]); ?></textarea>
  <br />
  <input type="submit" value="Submit">
  <input type="reset" value="Reset">
</table>
</div>

<div class="column two">
<form name="contactform" method="post" action="feedback.php">
<table >
<tr>
<td >
  <label for="comments"><h4>Home-Right-Side:</h4></label>
</td>
<td valign="top" >
  <textarea  name="comments" maxlength="1000" cols="30" rows="21" value="lol"><?php echo($query_row[right]); ?></textarea>
  <br />
  <input type="submit" value="Submit">
  <input type="reset" value="Reset">
</table>
</form>
</div>

</body>
</html>



I keep getting this error on the "Sent.php" page..

Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left = "$left" WHERE id = 1' at line 1

Please help


You need two forms!
EDIT AGAIN Darn IT! Not an Error.
One Form, One Submit!


You need to add $_POST['leftside'] (and rightside) to the POST array. Possibly as hidden variables. You could also key on a different submit value for left or right.
EDIT: Not an error! EFM
But, still need a 'filler' for POST['leftside'] for both sides submission. Right now leaves out ['leftside'] and ['comments'] most of the time so the query comes out short mostly.

This post has been edited by Ephraim F. Moya: Jan 14 2012, 03:52 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
xxkasperxx
post Jan 15 2012, 09:25 PM
Post #4


Serious Coder
*****

Group: Members
Posts: 261
Joined: 30-April 11
Member No.: 14,449



QUOTE


You need two forms!
EDIT AGAIN Darn IT! Not an Error.
One Form, One Submit!


You need to add $_POST['leftside'] (and rightside) to the POST array. Possibly as hidden variables. You could also key on a different submit value for left or right.
EDIT: Not an error! EFM
But, still need a 'filler' for POST['leftside'] for both sides submission. Right now leaves out ['leftside'] and ['comments'] most of the time so the query comes out short mostly.


i am sorry i dont get what you mean
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Ephraim F. Moya
post Jan 16 2012, 12:32 AM
Post #5


Advanced Member
****

Group: Members
Posts: 167
Joined: 2-September 07
From: New Mexico
Member No.: 3,702



Sorry, my edits made my posts almost in-understandable. Sorry.

Design before you mark-up. Do you want to edit only the left side first or do you want to edit the whole thing at one time? If all at once you need one form. If you want to do it in parts you need another page to edit the other side and two handlers to handle left or right.

1) Make sure your form page(s) are(is) VALID. ie. how many forms do you want to edit at a time? Right now your <form> element is invalidly placed.

2) Make sure that EVERY POST element needed is filled in by the submit for all conditions. Right now your failure is caused because POST['leftside'] is missing sometimes. That's what I got confused by.

HTH

This post has been edited by Ephraim F. Moya: Jan 16 2012, 12:35 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
xxkasperxx
post Jan 16 2012, 12:28 PM
Post #6


Serious Coder
*****

Group: Members
Posts: 261
Joined: 30-April 11
Member No.: 14,449



QUOTE(Ephraim F. Moya @ Jan 16 2012, 01:32 AM) *

Sorry, my edits made my posts almost in-understandable. Sorry.

Design before you mark-up. Do you want to edit only the left side first or do you want to edit the whole thing at one time? If all at once you need one form. If you want to do it in parts you need another page to edit the other side and two handlers to handle left or right.

1) Make sure your form page(s) are(is) VALID. ie. how many forms do you want to edit at a time? Right now your <form> element is invalidly placed.

2) Make sure that EVERY POST element needed is filled in by the submit for all conditions. Right now your failure is caused because POST['leftside'] is missing sometimes. That's what I got confused by.

HTH


Here is the new code, i still get the same error though.. i changed down to 1 fourm, and 1 update for the "sent.php" page.

member.php

CODE

<?php

session_start();


if($_SESSION['username'])
{
    echo "Welcome, ".$_SESSION['username']."!<br><a href='logout.php'>Logout</a><br>";
    $directions = "<h3>Directions:</h3>To edit text, simply click in one of the boxes you wish to change.<br> Click save to save your change. <br> Once you press save, the update will be sent automatically to the Live Site!<br>";
    
    $connect = Its filled out in mine
    mysql_select_db("filled out in mine") or die ("Couldnt find table Database. Sorry");

    $query = mysql_query("SELECT * FROM about");
    $query_row=mysql_fetch_array($query);

    echo $directions;
    
    
    
}
else
    die("You must be logged in!");
?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="css/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>



<div class="column one">
<form name="leftside" method="post" action="sent.php">
<table>
<tr>
<td>
  <label for="leftside">Home-Left-Side:</label>
</td>
<td valign="top" >
  <textarea name="leftside"  cols="30" rows="20" ><?php echo($query_row[left]); ?></textarea>
  <br />
  <input type="submit" value="Submit"/>
  <input type="reset" value="Reset"/>
  </td>
</tr>
</table>
</form>
</div>


</body>
</html>

sent.php
CODE

<?php

     $connect = Its filled out in mine
    mysql_select_db("filled out in mine") or die ("Couldnt find table Database. Sorry");
$left = $_POST['leftside'];


$result = mysql_query('UPDATE about SET left = "$left"');


if (!$result) {
die('Invalid query: ' . mysql_error());
}




?>


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Ephraim F. Moya
post Jan 16 2012, 05:22 PM
Post #7


Advanced Member
****

Group: Members
Posts: 167
Joined: 2-September 07
From: New Mexico
Member No.: 3,702



I don't know how to help you. You're trying to jump right in the middle of middling hard code without knowing how to plan your code.

I suggest you simplify your first task to make a VALID form page that calls a simple data viewer so you can see what happens when you do different things.

For instance, make an action page that just displays $_POST and $_GET. Call it io.php. It could look like this:

CODE

<?php
// program: io.php

$ars = "<h2>_POST</h2>" . print_r( $_POST, true ) .
       "<h2>_GET</h2>"  . print_r( $_GET,  true );

$page = <<<END
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>IO Display Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
h1 { text-align:center; }
div { display: table; margin: 0 auto }
</style>
</head>

<body>
<h1>IO Array Displays</h1>
<div>
<pre>
{$ars}
</pre>
</div>
</body>
</html>
END;
echo $page;
?>


Then make a test form page for just one form. testform1.php. It could look like this:

CODE

<?php
// program testform1.php

$page = <<<END
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test Form 1</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
h1, form { text-align: center; }
</style>
</head>

<body>
<h1>Test Form 1</h1>
<form method="post" action="io.php">
<input type="text" name="nam1" value="txt1">
<input type="hidden" name="hid1" value="hiddenValue1"><br>
<input type="submit" name="sub1" value="press here">
</form>
</body>
</html>
END;
echo $page;
?>


Read and understand both these programs. Then test them as is and see if you can predict what it should be doing then see if it is doing that. Understand what all the words mean and what effect they have.

Then change ONE VARIABLE at a time and see what effect that has.

Then you can start making changes to do what you want to do in your CMS. (One thing at a time)
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Jan 16 2012, 11:12 PM
Post #8


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



QUOTE
Here is the new code, i still get the same error though.. i changed down to 1 fourm, and 1 update for the "sent.php" page.



What is the actual error message you get? You have to solve them one at a time; Ephrain is right that you may be trying to take on vastly too big a job when you don't really understand what is going on.

I also helps if you give a link to the working (or non-working!) page; at least we can see what you are talking about. It is not reasonable to ask someone to read pages of code, visualise what it does, debug it mentally, and so on.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
xxkasperxx
post Jan 17 2012, 05:06 PM
Post #9


Serious Coder
*****

Group: Members
Posts: 261
Joined: 30-April 11
Member No.: 14,449



QUOTE(Ephraim F. Moya @ Jan 16 2012, 06:22 PM) *

I don't know how to help you. You're trying to jump right in the middle of middling hard code without knowing how to plan your code.

I suggest you simplify your first task to make a VALID form page that calls a simple data viewer so you can see what happens when you do different things.

For instance, make an action page that just displays $_POST and $_GET. Call it io.php. It could look like this:



Read and understand both these programs. Then test them as is and see if you can predict what it should be doing then see if it is doing that. Understand what all the words mean and what effect they have.

Then change ONE VARIABLE at a time and see what effect that has.

Then you can start making changes to do what you want to do in your CMS. (One thing at a time)


I did this, and still cannot get the grasp on how to do it.. I feel completely lost now.. I get how the form you set up works, and i get how to pass the edited text into "sent.php", but i dont know how to get it to Update in the database.. I keep getting this error.. "Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left=' at line 1"

This makes me just want to delete everything, and not look again.. i thought i had it all planned out..

Login => Edit page. (Edit text) => Sent.php(edited text is recieved, and updated).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Ephraim F. Moya
post Jan 17 2012, 08:21 PM
Post #10


Advanced Member
****

Group: Members
Posts: 167
Joined: 2-September 07
From: New Mexico
Member No.: 3,702



Post a link to your test of the code I sent. With all the changes you made.

We'll analyze that.

Barring that, Use my code to change the text field to a textarea and get it working. Then post that. That's a really easy change.


This post has been edited by Ephraim F. Moya: Jan 17 2012, 08:23 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
xxkasperxx
post Jan 17 2012, 08:36 PM
Post #11


Serious Coder
*****

Group: Members
Posts: 261
Joined: 30-April 11
Member No.: 14,449



CODE

<?php
// program testform1.php

$page = <<<END
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test Form 1</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
h1, form { text-align: center; }
</style>
</head>

<body>
<h1>Home-Left-Side</h1>
<form method="post" action="io.php">
<input type="text" name="name1" value="Imported text here">
<input type="hidden" name="hid1" value="hiddenValue1"><br>
<input type="submit" name="sub1" value="Update">
</form>
</body>
</html>
END;
echo $page;
?>


CODE

<?php
// program: io.php

$ars = "<h2>_POST</h2>" . print_r( $_POST, true );

$page = <<<END
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>IO Display Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
h1 { text-align:center; }
div { display: table; margin: 0 auto }
</style>
</head>

<body>
<h1>Test Form</h1>
<div>
<pre>
{$ars}
</pre>
</div>
</body>
</html>
END;
echo $page;
?>


Thats all i did with your code, and i get everything that goes on, It didnt help me with the update function or anything.. Am i making this too complicated?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Ephraim F. Moya
post Jan 18 2012, 10:08 AM
Post #12


Advanced Member
****

Group: Members
Posts: 167
Joined: 2-September 07
From: New Mexico
Member No.: 3,702



QUOTE(xxkasperxx @ Jan 17 2012, 06:36 PM) *

CODE

<?php
// program testform1.php

$page = <<<END
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test Form 1</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
h1, form { text-align: center; }
</style>
</head>

<body>
<h1>Home-Left-Side</h1>
<form method="post" action="io.php">
<input type="text" name="name1" value="Imported text here">
<input type="hidden" name="hid1" value="hiddenValue1"><br>
<input type="submit" name="sub1" value="Update">
</form>
</body>
</html>
END;
echo $page;
?>


CODE

<?php
// program: io.php

$ars = "<h2>_POST</h2>" . print_r( $_POST, true );

$page = <<<END
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>IO Display Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
h1 { text-align:center; }
div { display: table; margin: 0 auto }
</style>
</head>

<body>
<h1>Test Form</h1>
<div>
<pre>
{$ars}
</pre>
</div>
</body>
</html>
END;
echo $page;
?>



Once you are Completely familiar with io.php, testform1.php and are sure that all pages made are VALID then:

Use testform1.php as a template for a COMPLETELY new form that gets a visitor's username and password. Make sure the form page is VALID. Use io.php as the action and be sure that ALL possible combinations of entries result in reasonable POST data.

Doing this will get you a long way to success. Bad programs are frequently called "Garbage IN, Garbage Out" programs. We're working on fixing the Garbage In part.

I suggest you find several php programming online tutorials and study those while you're doing these.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
xxkasperxx
post Jan 18 2012, 04:52 PM
Post #13


Serious Coder
*****

Group: Members
Posts: 261
Joined: 30-April 11
Member No.: 14,449



i read through my php book.. and am now going back through it again.. and doing EVERYTHING to full detail and studying it alot harder, thanks for your help! ill post when i think i figured it out smile.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Ephraim F. Moya
post Jan 19 2012, 10:32 AM
Post #14


Advanced Member
****

Group: Members
Posts: 167
Joined: 2-September 07
From: New Mexico
Member No.: 3,702



QUOTE(xxkasperxx @ Jan 18 2012, 02:52 PM) *

i read through my php book.. and am now going back through it again.. and doing EVERYTHING to full detail and studying it alot harder, thanks for your help! ill post when i think i figured it out smile.gif


ATTA Boy !

What a GREAT attitude!

Ephraim F. Moya
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
xxkasperxx
post Jan 20 2012, 06:30 PM
Post #15


Serious Coder
*****

Group: Members
Posts: 261
Joined: 30-April 11
Member No.: 14,449



QUOTE(Ephraim F. Moya @ Jan 19 2012, 11:32 AM) *


ATTA Boy !

What a GREAT attitude!

Ephraim F. Moya


Hahaha! actually made me laugh.. i understand how to pass the users information better, and now i am working on the actual update function.. how important are arrays going to be in further php?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
xxkasperxx
post Jan 20 2012, 07:09 PM
Post #16


Serious Coder
*****

Group: Members
Posts: 261
Joined: 30-April 11
Member No.: 14,449



Are there certain examples you can list for me, to create and see if they are good or bad Please?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Ephraim F. Moya
post Jan 20 2012, 09:06 PM
Post #17


Advanced Member
****

Group: Members
Posts: 167
Joined: 2-September 07
From: New Mexico
Member No.: 3,702



QUOTE(xxkasperxx @ Jan 20 2012, 05:09 PM) *

Are there certain examples you can list for me, to create and see if they are good or bad Please?


This site is a 'help' site as opposed to a 'teach' site. This means that the infrastructure of the site is not as well suited to teaching.

My just previous post is 100% sincere. It is the rare student that recognizes that he is on the WRONG road, admits it and takes steps to get on the RIGHT road. That ability serves a life well.

In your case you're trying to do two things at once. One is the session system of a web site and the other is the web site itself. A working web site is first. Then you do the session stuff on a well prepared foundation.

I believe that the php type to use is 5.2 or later.

Learn:
basic php,
functions,
variables,
function and variable visibility,
arrays, <= yes these are VERY valuable because they can remove disk latency in programs.

With these, VERY good programs can be written.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
xxkasperxx
post Jan 23 2012, 07:46 PM
Post #18


Serious Coder
*****

Group: Members
Posts: 261
Joined: 30-April 11
Member No.: 14,449



How is this looking?

index.php
CODE

<html>
<head>
<title>Contact/Register</title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
</head>

<body>

    <div id="container">
        <div class="column one"><p>
        
        <form action="someform.php" method="post">
Name: <input type="text" name="Name" value="Jim" /><br />
Password: <input type="password" name="Password" maxlength="10" /><br />
Age range: <select name="Age">
<option value="Under 16">Under 16</option>
<option value="16-30" selected="selected">16-30</option>
<option value="31-50">31-50</option>
<option value="51-80">51-80</option>
</select><br /><br />
Life story:<br /> <textarea name="Story" rows="10" cols="80">Enter your life story here</textarea><br /><br />
<input type="radio" name="FaveSport" value="Tennis"> Tennis</input>
<input type="radio" name="FaveSport" value="Cricket"> Cricket</input>
<input type="radio" name="FaveSport" value="Baseball"> Baseball</input>
<input type="radio" name="FaveSport" value="Polo"> Polo</input>

<br /><input type="submit" />
</form></p></div>


    </div>

</body>
</html>


someform.php
CODE
<?php

$Name = $_POST['Name'];

$Password = $_POST['Password'];

$Age = $_POST['Age'];

$Story = $_POST['Story'];

$Favsport = $_POST['FaveSport'];




echo 'You name is: '.$Name.'<br/>';
echo 'Your desired password is: '.$Password.'<br/>';
echo 'Your age is: '.$Age.'<br/>';
echo 'This is your story... '.$Story.'<br/>';
echo 'Your favorite sport is: '.$Favsport.'<br/>';

?>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Ephraim F. Moya
post Jan 24 2012, 06:37 PM
Post #19


Advanced Member
****

Group: Members
Posts: 167
Joined: 2-September 07
From: New Mexico
Member No.: 3,702



index.php
CODE

<html>
<head>
<title>Contact/Register</title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
</head>

<body>

    <div id="container">
        <div class="column one"><p>
        
        <form action="someform.php" method="post">
Name: <input type="text" name="Name" value="Jim" /><br />
Password: <input type="password" name="Password" maxlength="10" /><br />
Age range: <select name="Age">
<option value="Under 16">Under 16</option>
<option value="16-30" selected="selected">16-30</option>
<option value="31-50">31-50</option>
<option value="51-80">51-80</option>
</select><br /><br />
Life story:<br /> <textarea name="Story" rows="10" cols="80">Enter your life story here</textarea><br /><br />
<input type="radio" name="FaveSport" value="Tennis"> Tennis</input>
<input type="radio" name="FaveSport" value="Cricket"> Cricket</input>
<input type="radio" name="FaveSport" value="Baseball"> Baseball</input>
<input type="radio" name="FaveSport" value="Polo"> Polo</input>

<br /><input type="submit" />
</form></p></div>


    </div>

</body>
</html>


That's pretty good.

Now, make it valid in html 4.01 transitional, xhtml transitional and xhtml strict. You may also try in html. (html 5)

I've made it valid in html 4.01 strict here: http://moya.us/Kasper20120124.html

ps. I don't believe that two word class names are valid but I can't find the rules for them. ( "column one" )


This post has been edited by Ephraim F. Moya: Jan 24 2012, 06:46 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Jan 24 2012, 06:50 PM
Post #20


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



QUOTE
<div class="column one">
This isn't a "two-word class name". This is an element with two classes ("column" and "one").
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

3 Pages V  1 2 3 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd April 2024 - 05:50 AM