Jump to content

Colton.Wagner

Members
  • Posts

    157
  • Joined

  • Last visited

Posts posted by Colton.Wagner

  1. Awesome I was just looking for something a lot more complex like some function name instead of append. It's always the easy stuff that gets me. Now I have a second question when I append html it displays the html as text rather than using the element tags I provide.

     

    Thanks,

    Colton Wagner

  2. I am trying to make this script so that when I click on a radio button the text is replaced not appended. I have tried the code replaceChild(). That did not work basically what I am asking is every time I run the function showForm() I want it to replace text in the extra Div.

     

    <!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>
                <title>programming test.</title>
                <script type="text/javascript">
                            function showForm(x) {
                                    if (x == "1") {
                                        var extra = "This means you have children!";
                                    } else if (x == "0") {
                                        var extra = "This means you do not have children!";
                                    }
                            
                                var myText = document.createTextNode(extra);
                                document.getElementById("extra").appendChild(myText);
    
                            }
                </script>
            </head>
        
            <body>
                <p>
                    <form action="?submit=true" method="post">
                        <h3>Personal Information</h3>
                        <strong>Username:</strong> <input type="text" value="" name="username" /> <br />
                        <strong>Password:</strong> <input type="password" value="" name="password" /> <br />
                        <strong>First Name:</strong> <input type="text" value="" name="fname" /> <br />
                        <strong>Last Name:</strong> <input type="text" value="" name="lname" /> <br />
                        <strong>Email:</strong> <input type="text" value="" name="email" /> <br />
                        <strong>Do you have children?</strong> <br /> 
                        Yes <input type="radio" value="1" onclick="showForm(this.value)" name="children" /> No <input type="radio" value="0" onclick="showForm(this.value)" name="children" /><br />
                        <div id="extra" style="color: red;"></div>
                        <input type="submit" value="submit" /><br />
                    </form>
                </p>
            </body>
            
        </html>

     

    Any help would be greatly appreciated.

    Thanks,

    Colton Wagner

  3. Your problem does not lie within your css3. The problem is actually in your html. Internet explorer is very strict about having the doctype defined. Simply add this to the top of your html document.

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

     

    So that it looks like:

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <style>
    h1 { font-size:24px;color:#428800; }
    h2 { color:#428800;font-weight:bold;
       background-color: #f0f0f0;
       width: 518px;
       height: 50px;
       margin: 0 auto 0 auto;
       padding: 0px;
       border: 1px solid #d7d7d7;
    
       -moz-border-radius: 11px;
       -webkit-border-radius: 11px;
       border-radius: 11px;
       behavior: url(/css/border-radius.htc);
    }
    #content { float:left;margin:0;padding:0 5px;width:960px;background:url(/images/template/main-background.jpg); }
    #main { float:left;margin:0 15px 0 10px;width:520px;background:transparent; }
    </style>
    </head>
    
    <body>
    
    <div id="content">
    
    <div id="main">
    
       <h1>Contact Us</h1>
    
       <h2>Advertising Opportunities</h2>
       <h2>Editorial Enquiries</h2>
       <h2>Order Enquiries</h2>
    
    </div>
    
    </div>
    
    </body>
    </html>

    I hope I could be of some assistance.

    Thanks,

    Colton Wagner

  4. If you will notice you do not have:

     

    <html>

     

    Defined at the top of the page but this does not fix the problem. You have this as your document type:

     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

     

    It needs to be replace with:

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>

     

    This should fix your problem hope I could be some assistance.

    Thanks,

    Colton Wagner

  5. I would say the website needs some work and definitely needs to be re-organized.

    • The home page looks like a parked website.
    • There really isn't a color scheme
    • The ad's are in a terrible place.
    • It looks like there is not a header.

     

    Hope I could be of some assistance.

    Thanks,

    Colton Wagner

  6. I like the design but I have a few things I would personally change and some strong points.

     

    • The navigation bar has to many colors and it clashes with the design of the website.
    • I would slow down the transition of the news feed.
    • Great use of easy slider.
    • In the navigation try to keep it uniform. If you capitalize one name capitalize them all.
    • Also I would allow the picture /btn/code/images/topdesign.jpg to be resized with the rest of the site. When I viewed this in 800 X 600 it's width was wider than the website itself.

     

    Hope I could be of some assistance. I really like all of the jqueries you are using it is really flush and does not really clash.

    Thanks,

    Colton Wagner

  7. Here is the Code

     

    <?php
    session_start(); 
    $_SESSION['parts'] = array();
    error_reporting(E_ALL);
    ?>
    <html>
       <head>
          <link rel="shortcut icon" href="/favicon.ico" />
          <title>
             NickNackery.com
          </title>
       </head>
       
    	<body>
    <?php
    
    mysql_connect('localhost', 'root', 'roflmao315');
    mysql_select_db('products');
    
    $parser = xml_parser_create();
    
    function start($parser, $element_name, $element_attrs)
       {
             switch($element_name)
                {
                   case "SKU":
                   // this is the start of a set of data
                   $_SESSION['parts'] = array(); // create an empty set
                   break;
                   case "TIME":
    		   $query = sprintf("UPDATE products SET products_quantity = $quantity WHERE products_model = $part");
    			mysql_query($query);
                   break;
                   default:
                }
       }
    
    function stop($parser, $element_name)
          {
          }
          
    function char($parser,$data)
    {
       $data = trim($data);
       $quantity = trim($quantity);
       $part = trim($part);
       if($data != ''){
          if(!isset($_SESSION['parts']['SKU'])){
             $_SESSION['parts']['SKU'] = $data;
          } elseif (!isset($_SESSION['parts']['QTY'])){
             $_SESSION['parts']['QTY'] = $quantity;
          } elseif (!isset($_SESSION['parts']['PART'])){
             $_SESSION['parts']['PART'] = $part;
          }
       }
    }
    
    xml_set_element_handler($parser, "start", "stop");
    xml_set_character_data_handler($parser, "char");
    
    $fp=fopen("http://morris.morriscostumes.com/out/available_batchnynyy_001.xml","r");
    
    while ($data=fread($fp,4096))
      {
      xml_parse($parser,$data,feof($fp)) or
      die (sprintf("XML Error: %s at line %d",
      xml_error_string(xml_get_error_code($parser)),
      xml_get_current_line_number($parser)));
      }
    
    xml_parser_free($parser);
    ?>
          </body>
    </html>

     

    Here is the error

     

    Notice: Undefined variable: quantity in  on line 45
    
    Notice: Undefined variable: part in  on line 46

  8. I am tryin to loop the same number into a databas 17659 times but with the following code:

     

    <?php
    
    error_reporting(E_ALL);
    $con = mysql_connect('localhost', 'root', '');
       if (!$con) {
          die('Connection Error:' . mysql_error());
       }
    mysql_select_db('catgories', $con);
          
    for($i=0;$i<=17659;$i++)
    {
    $query="INSERT INTO categories(`products_id`,`categories_id`) select $i,categories_id from categories"; 
    mysql_query($query) or trigger_error("SQL: $query, ERROR: ", E_USER_ERROR);
    }
    ?>

     

    However I get the following error:

     

    Fatal error: SQL: INSERT INTO categories ('products_id'. 'categories_id') VALUES ('', '18'), ERROR: in H:\Xampp\xampplite\htdocs\categories.php on line 13

  9. So I am trying to use an xml file to update a products quantity by checking the product id then updating it in the database.

     

    <?php
    session_start(); 
    $_SESSION['parts'] = array();
    error_reporting(E_ALL);
    ?>
    <html>
       <head>
          <link rel="shortcut icon" href="/favicon.ico" />
          <title>
             
          </title>
       </head>
       
    	<body>
    <?php
    
    mysql_connect('', '', '');
    mysql_select_db('products');
    
    $parser = xml_parser_create();
    
    function start($parser, $element_name, $element_attrs)
       {
             switch($element_name)
                {
                   case "SKU":
                   // this is the start of a set of data
                   $_SESSION['parts'] = array(); // create an empty set
                   break;
                   case "TIME":
    		   $query = sprintf("UPDATE products SET products_quantity = $quantity WHERE products_model = $part");
    			mysql_query($query);
                   break;
                   default:
                }
       }
    
    function stop($parser, $element_name)
          {
          }
          
    function char($parser,$data)
    {
       $data = trim($data);
       $quantity = trim($quantity);
       $part = trim($part);
       if($data != ''){
          if(!isset($_SESSION['parts']['SKU'])){
             $_SESSION['parts']['SKU'] = $data;
          } elseif (!isset($_SESSION['parts']['QTY'])){
             $_SESSION['parts']['QTY'] = $quantity;
          } elseif (!isset($_SESSION['parts']['PART'])){
             $_SESSION['parts']['PART'] = $part;
          }
       }
    }
    
    xml_set_element_handler($parser, "start", "stop");
    xml_set_character_data_handler($parser, "char");
    
    $fp=fopen("http://morris.morriscostumes.com/out/available_batchnynyy_001.xml","r");
    
    while ($data=fread($fp,4096))
      {
      xml_parse($parser,$data,feof($fp)) or
      die (sprintf("XML Error: %s at line %d",
      xml_error_string(xml_get_error_code($parser)),
      xml_get_current_line_number($parser)));
      }
    
    xml_parser_free($parser);
    ?>
          </body>
    </html>

     

    I get this error:

     

    Notice: Undefined variable: quantity in  on line 45
    
    Notice: Undefined variable: part in on line 46

  10. Is this the entire code? If nothing it happening when the code is run you should almost certainly be getting an error message. Have you tried using view source to see what if any HTML is written to the browser?

    cags: the same error

    The html document contains an error now because we set it to tell us.

     

    Fatal error: SQL: INSERT INTO categories(`products_id`,`categories_id`) select 0,categories_id from categories, ERROR: in F:\Xampp\xampplite\htdocs\categories.php on line 13
    

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.