Jump to content

benjaminmorgan

Member
  • Posts

    226
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by benjaminmorgan

  1. Thanks for everyones help. Learning is hard but I will get it eventually. Like Stefan said just jump in and start learning
  2. I had them closed in my code, is my new code with them closed (26 and 27) and i took Email == the preg match off and just left preg match and it seems to be working it is just sending duplicates of each form now. i also commented out the global variables.
  3. http://pastebin.com/SpDarS8J is my exact code. I don't see any non closed if statements. there is an if within an if though.
  4. i was just trying to fix it. I can submit it to the database even if it is blank or not valid. I don't want that.
  5. the only time it won't submit if all fields are blank. other than that if u just type one thing in a box it will submit.
  6. 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 **************************************************************************
  7. 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>
  8. <!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.
  9. oops i was using background-url it is working now. Thanks
  10. It works with just the single image but not the sprite. UGGHH!. I just hope this gets figured out.
  11. 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>
  12. That isn't the problem. I am trying to figure out how to use that sprite.
  13. 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?
  14. 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...
  15. Hmm, I wonder about everyone else. I have Windows 7 Home Premium and I have Google Chrome, Firefox, Safari, Opera, IE, and IE tester which has the versions 5.5+ and I use that a lot. I am new to these forums. Do people post here often?
  16. Thanks So MUCH. I can't wait til i turn 18 so i can buy your videos
  17. Which operating system do you use and prefer and why? Which is easiest to code on etc...
×
×
  • Create New...