Jump to content

benjaminmorgan

Member
  • Posts

    226
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by benjaminmorgan

  1. I have a form and whenever I am entering a invalid email it still goes through.

     

    I have the form set where if it isn't valid it will pop up an error... BUT when I put in the php section it is this.

     

    if (isset($_REQUEST['Submit'])) {

    $FName=$_POST['fullname'];

    $CName=$_POST['comname'];

    $Cwebsite=$_POST['cwebsite'];

    $Email=$_POST['blemail'];

    $comabout=$_POST['comabout'];

    $prequirements=$_POST['prequirements'];

    $pagenumber=$_POST['pagenum'];

     

     

    if(

    $_POST['fullname']!="" ||

    $_POST['blemail']!="" ||

    $_POST['comabout']!="" ||

    $_POST['prequirements']!="" ||

    $_POST['pagenum']!="" ||

    $_POST['blemail']==preg_match('/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i', $_POST['blemail']))

    {

     

    $query="INSERT INTO quote (full_name, company_name, website, email, company_about, project_requirements, page_numbers)VALUES('".$FName."', '".$CName."', '".$Cwebsite."', '".$Email."', '".$comabout."', '".$prequirements."', '".$pagenumber."')";

    mysql_query($query) or die("Error updating database.". mysql_error());

     

    }

    }

     

    **************************************************************************

    table name is quote and it is inserting fine. I just want to stop it if it does not meet any of the following. I can just submit the form blank (except for the pages because it is a dropdown option with one preselected. ) I want to stop the form if a required field is blank OR the email doesn't match the reg ex

    **************************************************************************

  2. I am trying to style this form and I ran into a problem when the label ran into 2 lines . I am not using this form for real but I need to know how to do this.

    Here is my code

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

    "http://www.w3.org/TR/xhtml1/DTD/xhtml…

     

    <html xmlns="http://www.w3.org/1999/xhtml">

     

    <head>

    <title>Title of document</title>

    <style type="text/css">

    .outform {

    list-style:none;

    padding:10px;

    padding-top:0px;

    padding-bottom:0px;

    width:80%;

    margin:0;

    background-color:black;

    }

    .outform li{

    height:40px;

    line-height:40px;

    background-color:green;

    padding:5px;

    clear:both;

    list-style:none;

    border-bottom:2px solid black;

    }

    .outform input {

    float:left;

    height:100%;

    }

    .outform label {

    width:140px;

    float:left;

    height:30px;

    }

     

    </style>

    </head>

    <body>

    <form method="post" action="quote.php">

    <ul class="outform">

    <li>

    <label> Name </label>

    <input type="text" value="" />

    </li>

    <li>

    <label>Last Name</label>

    <input type="text" value="" />

    </li>

     

    <li>

    <label>Email * </label>

    <input type="text" value="" />

    </li>

    <li>

    <label>Multi Line Label is here</label>

    <textarea rows="4" cols="30"></textarea>

    </li>

    <li>

    <label>yet another Multi Line Label is here</label>

    <textarea rows="4" cols="30"></textarea>

    </li>

    </ul>

    </form>

    </body>

    </html>

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

    <html xmlns="http://www.w3.org/1999/xhtml" >

    <head>

    <title>Simple Event Example</title>

    <script type="text/javascript">

    function addEventHandler(oNode, sEvt, fFunc, bCaptures){

    if (typeof(window.event) != "undefined") {

    oNode.attachEvent("on" + sEvt, fFunc);

    }else{

    oNode.addEventListener(sEvt, fFunc, bCaptures);

    }

    }

     

    function onLinkClicked(e) {

    alert("You clicked the link");

    }

     

    function setUpClickHandler() {

    addEventHandler(document.getElementB… "click", onLinkClicked, false);

    }

    addEventHandler(window,"load", setUpClickHandler, false);

    </script>

    </head>

    <body>

    <a href="#" title="click me" id="clickLink">Click Me!</a>

    </body>

    </html>

     

     

    I got this out of a tutorial

    This works fine in FIREFOX. In CHROME and INTERNET EXPLORER 9 this doesn't work.

    Please help me find the fix.

  4. This doesn't work. When i take no-repeat out of it it will show the 4th one repeat horizontally. when i put the no-repeat in it doesn't show at all.

     

    <html>

    <head>

    <style type="text/css">

    ul {

    list-style:none;

    }

    li {

    background: url(sprites.gif)no-repeat 0 120px;

    }

    </style>

    </head>

    <body>

    <ul>

    <li>Example 1</li>

    <li>Example 2</li>

    <li>Example 3</li>

    </ul>

    </body>

    </html>

     

    sprites.gif

  5. http://img836.imageshack.us/img836/1040/sprites.gif is the link to my sprite. I am trying to get the 3rd one down to appear on an unordered list instead of bullets. Can someone please go through the steps? I have done it before but it has been so long and anything i do seems to screw it up. I've tried looking in several books and online tutorials also.

     

    <ul>

    <li>Example 1</li>

    <li>Example 2</li>

    <li>Example 3</li>

    </ul>

     

    what could the css be to get this to work?

  6. I am looking for a place to learn how to create a slide show complete with buttons and a non pop up calendar. I have read several books and watched a lot of youtube videos but I can never find anything on making either of these. I like the calendar on the left side of this page http://heartlandpcg.com/ I have viewed the source but I don't know how they did it. If they coded out a table for every year and every month and day of that year then that must of took forever...

×
×
  • Create New...