-
Posts
66 -
Joined
-
Last visited
Profile Information
-
Gender
Not Telling
srhino's Achievements

Member (2/5)
0
Reputation
-
I havent really had a hard time with this form before...I just ordered a new domain and hosting from Go Daddy and since they have switched to c panel this form doesnt work... Is there something in the code I can change... **and by not working I mean...I never receive the e-mail...the form seems to process... Thanks for looking ! <?php if(isset($_POST['email'])) { // CHANGE THE TWO LINES BELOW $email_to = "[email protected]"; $email_subject = "Lopardos Website form submissions"; function died($error) { // your error code can go here echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['first_name']) || !isset($_POST['last_name']) || !isset($_POST['email']) || !isset($_POST['telephone']) || !isset($_POST['comments'])) { died('We are sorry, but there appears to be a problem with the form you submitted.'); } $first_name = $_POST['first_name']; // required $last_name = $_POST['last_name']; // required $email_from = $_POST['email']; // required $telephone = $_POST['telephone']; // not required $comments = $_POST['comments']; // required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email_from)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$first_name)) { $error_message .= 'The First Name you entered does not appear to be valid.<br />'; } if(!preg_match($string_exp,$last_name)) { $error_message .= 'The Last Name you entered does not appear to be valid.<br />'; } if(strlen($comments) < 2) { $error_message .= 'The Comments you entered do not appear to be valid.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "First Name: ".clean_string($first_name)."\n"; $email_message .= "Last Name: ".clean_string($last_name)."\n"; $email_message .= "Email: ".clean_string($email_from)."\n"; $email_message .= "Telephone: ".clean_string($telephone)."\n"; $email_message .= "Comments: ".clean_string($comments)."\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?> <!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> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" type="text/css" href="css/main2.css"> <title>Lopardo's New York Pizza and Pasta</title> </head> <body> </body> <div id="outer" align="center"> <div id="logo"> </div> <div id="header" align="center"> <div id="header_logo"><img src="Lopardos_Logo.jpg" height="94" width="180" /></div> </div> <div id="nav"> <div class="nav"> <ul class="topmenu"> <li><a href="index.html" class="current">HOME</a> </li> <li><a href="" target="_blank">MENU </a> <ul class="submenu"> <li><a href="">PDF MENU</a></li> <li><a href="index.html">Starters</a></li> <li><a href="index.html">Pizza</a></li> <li><a href="index.html">Italian Specialties</a></li> <li><a href="index.html">Heroes</a></li> </ul> </li> <li><a href="index.html">ABOUT</a> </li> <li><a href="contact.html">CONTACT</a></li> <li><a href="index.html">LOCATION</a></li> </ul> </div> </div> <!--NAVIGATION*** --> <div id="content"> <h1>Thanks! We will be in touch!</h1> <div id="footer"> <p class="footer">| © | Lopardo's New York Pizza and Pasta | 770.423.0082 |</p> </div> <!--FOOTER --> </div> <!--***CONTENT***--> <!--***FOOTER***--> </div> <!-- ***OUTER --> </html> <?php } die(); ?>
-
I am working on trying to lay out a navigation bar using css...So far it looks great in every browser except in IE ! Heres the scenario...I have a logo floated to the left...I then want my navigation to be floated left and be 175px to the right of the logo. here is the css... I am new to this so it could just be I am using bad practice? Please help !? I have also attached the HTML doc Thanks for your time! @charset "UTF-8"; /* CSS Document */ html { background: #000 url(../images/skyline.png) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } p { color:#FFFFFF; font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; font-size:18px; font-weight:bold; text-align: left; margin: 5px; padding: 5px; } p.indent { text-indent: 10px; } p.footer { text-align:center; } p.center { text-align:center } h1 { text-align:center; color:#FFFFFF; font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-size: 24px; font-weight:bold; } h2 { color:#FFFFFF; text-align:center; font-family:Arial, Helvetica, sans-serif; font-size:24px; } label { color:#FFFFFF; font-family:Arial, Helvetica, sans-serif; } #outer { position:relative; background:url(../images/Content_Background.png); height: 160px; top: 0; width: 85%; margin:auto; text-align:left; } #nav { position:absolute; top: 110px; height: 2.3em; background-color:#666; width: 100%; z-index: 2; } #logo { position:absolute; z-index: 3; float:left; } #content { position:absolute; background: url(../images/Content_Background.png); top:160px; height:auto; width:100%; } #footer { position: absolute; background:#000; color:#FFFFFF; bottom: -50px; width: 100%; height: 50px; } img.left { float:left; border: solid 5px #FFF; margin: 25px; box-shadow:#000 5px 5px 2px; vertical-align:text-top; } .hr { color:#FFF; clear:both; } .fb-like-box { float:right; background-color:#CCCCCC; clear:both; margin: 15px; } /* NAVIGATION AND MENUS */ .cf:before, .cf:after { content:""; display:table; } .cf:after { clear:both; } .cf { zoom:1; } nav { background-color: #ccc; height: 2.3em; margin-left: 175px; } ul, li { margin: 0; padding: 0; list-style: none; float:left; } ul { background: #666; height: 2em; width: 100%; } li { position:relative; } li a { display: block; line-height: 2em; padding: 0 1em; color: white; text-decoration: none; } li a:hover, .topmenu > li:hover > a { background: #f00; height: 2em; } .current, a:hover.current { background: #F00; color: #eee; } /*dropdown menu styles*/ ul.submenu { float: none; color:#000000; background: #666; width: auto; height: auto; position:absolute; top: 2em; left: -9000em; } ul.submenu li { float: none; } .topmenu li:hover ul { left:0; } ul.submenu li a { border-bottom: 1px solid white; padding: .2em 1em; white-space: nowrap; } ul.submenu li:last-child a { border-bottom: none; } ul.submenu li a:hover; { background: #CCC; height: 2em; padding-top:.2em; top: 0; } HTML code
-
Thanks...I will look there!
-
Yeah I assume that would be the correct way...I just don't know how to do that... I want 4 records to show on one TR and then 4 more on the next TR and so on... How would I make a variable out of the incoming rows?
-
I am new and trying to figure out a way to take my records from the data base and display 4 to a row instead of just one record at a time... Here is the code I am working with. $query = "select * from products"; $result = mysql_query($query); echo "<table width=\"100%\" border=\"0\" align=\"center\">\n"; while($row=mysql_fetch_array($result, MYSQL_ASSOC)) { $prodid = $row['prodid']; $description = $row['description']; $price = $row['price']; $quantity = $row['quantity']; echo "<tr><td align = \"center\">\n"; echo "<tr><td><img src=\"showimage.php?id=$prodid\" width=\"80\" height = \"80\">\n</br>"; echo "<a href=\"updatecart.inc.php?id=$prodid\"> $description </a>" ; echo "</td></tr>\n"; } echo "</table>\n"; ?> I thank you in advance for your help.
-
Sorry If you look below in my code you see I wrote the function in the "mylibrary folder" the code below is in my index...I <?php include("mylibrary/login.php"); include("mylibrary/showproducts.php"); include("mylibrary/getThumb.php"); login(); <------------------------------------I removed this call to the function and it worked. ?> I guess it works, but i would like to be able to re use the login when needed. Yes that is true.
-
I thought that was the problem too...But as soon as I removed the function and used it as an include...it connected fine.
-
I keep getting this error when I try to load my page. I cant figure out why it wont use the function "login". I have attached some of the code as well Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'XXXXXXX.db.9999999.hostedresource.com' (110) in /home/content/s/r/h/xxxx/html/softball/mylibrary/login.php on line 4 Could not connect to server Here is where on the index page the function is called... <?php session_start(); ?> <!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> <link rel="stylesheet" type="text/css" href="mystyle.css" /> <link rel="stylesheet" media="print" type="text/css" href="print.css" /> <title></title> </head> <?php include("mylibrary/login.php"); include("mylibrary/showproducts.php"); include("mylibrary/getThumb.php"); login(); ?> and here is where I defined the function <?php function login() { $con = mysql_connect("xxxxxxx.db.999999.hostedresource.com", "gxxxxxx", "xxxxxx") or die('Could not connect to server'); mysql_select_db("xxxxxx", $con) or die('Could not connect to database'); } ?> Thanks in advance for any help and explanation of why this would happen...I am new to this and am trying to learn.
-
OK I am stupid I should have checked my remote server first before I posted this...for some reason no matter how many times I 'put' this it is not showing up on the remote server.
-
I keep getting the following error....I am new to this and I am trying to learn where I am making this error. Can anyone help my figure this out? Warning: main(editproducts.inc.php) [function.main]: failed to open stream: No such file or directory in /home/content/s/r/h/srhino/html/softball/store/admin/admin.php on line 40 Warning: main(editproducts.inc.php) [function.main]: failed to open stream: No such file or directory in /home/content/s/r/h/srhino/html/softball/store/admin/admin.php on line 40 Warning: main() [function.include]: Failed opening 'editproducts.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/s/r/h/srhino/html/softball/store/admin/admin.php on line 40