Jump to content

srhino

Members
  • Posts

    66
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

srhino's Achievements

Member

Member (2/5)

0

Reputation

  1. 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 = "scott@lopardos.com"; $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(); ?>
  2. 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
  3. 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?
  4. 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.
  5. 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.
  6. I thought that was the problem too...But as soon as I removed the function and used it as an include...it connected fine.
  7. 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.
  8. 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.
  9. 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
  10. I am trying to populate the drop down list with all the schools in my database. So in response to 1a I do want more than one school. This page I am creating is to set up matchups between two of the 16 schools in the database. I want this form to pass both the school name and school id of the two schools picked over to a page that creates the matchup and then inserts the matchup into the matches database.
  11. Hey guys and gals, I want to pass two variables over in a drop down menu. How can I doo this. I have attached my code below. I want to send both the school name and the school id over. Thanks <?php include("includes/connection.php"); ?> <?php echo"<form action=\"newscore.php\" method=\"post\">"; echo"ENTER NEW MATCH"; echo "<table width=\"100%\" cellpadding=\"1\" border=\"1\">\n"; echo" <tr><td> School 1:</td><td><select name=\"school1\">"; $query="SELECT * from schools"; $result=mysql_query($query); while($row=mysql_fetch_array($result,MYSQL_ASSOC)) { $schoolid = $row['schoolid']; $schoolname = $row['schoolname']; $schoolabb = $row['schoolabb']; echo "<option value=\"$schoolname\">$schoolname</option>\n"; } echo "</select></td>"; echo" <tr><td> School 2:</td><td><select name=\"school2\">"; $query="SELECT * from schools"; $result=mysql_query($query); while($row=mysql_fetch_array($result,MYSQL_ASSOC)) { $schoolid = $row['schoolid']; $schoolname = $row['schoolname']; $schoolabb = $row['schoolabb']; echo "<option value=\"$schoolname\">$schoolname</option>\n"; } echo "</select></td></tr> </table>"; echo "<input type=\"submit\" value=\"Submit\">\n"; echo "<input type=\"hidden\" name=\"content\" value=\"newscore\">\n"; echo "</form>\n"; ?>
  12. OMG I am so stupid....Thanks! I knew I was looking at this too long
  13. I have been staring at the computer all day and I can't see what I am missing....Can anyone tell me why I can't insert this info. Here is the code <?php include("includes/connection.php"); ?> <?php $matchid = $_POST['matchid']; $round = $_POST['round']; $school1 = $_POST['school1']; $school2 = $_POST['school2']; $query = "INSERT INTO match (matchid, round, school1, school2) " . " VALUES ('$matchid', '$round', '$school1', '$school2')"; $result = mysql_query($query) or die('Sorry, we could not post your tournament to the database at this time'. mysql_error()); if ($result) echo "<a href=\"index.php\"><h2>Tournament posted</h2></a>\n"; else echo "<h2>Sorry, there was a problem posting your tournament</h2>\n"; ?> Here is the form that is sending over the variables <?php $matchid = $_POST['matchid']; $round = $_POST['round']; $school1 = $_POST['school1']; $school2 = $_POST['school2']; echo "<table width=\"100%\" border=\"1\" align=\"center\"><form action=\"newmatch.php\" method=\"post\"> <tr><td colspan=\"9\" align=\"center\">New Schools</TD></tr> <tr> <td width=\"10%\">Match</td> <td width=\"5%\">Round</td> <td width=\"75%\">Teams</td> </tr> <tr> <td rowspan=\"2\"><input type=\"text\" name=\"matchid\" ></td> <td rowspan=\"2\"><input type=\"text\" name=\"round\"></td> <td><input type=\"text\" name=\"school1\" value=\"$school1\"></td> <tr><td><input type=\"text\" name=\"school2\" value=\"$school2\"></td> <tr><td colspan=\"4\" align=\"center\"><input type=\"submit\" value=\"Submit\"> <input type=\"hidden\" name=\"content\" value=\"newmatch\"></td></tr> </form></table>" ?>
  14. andrewgauger, Thank you for your help. That is getting me in the right direction. This is for a tennis tournament. Each "match" consists of 9 inner matches. d1 stands for doubles one and s1 stands for singles one....etc I have attached 2 pictures of the webpage output I am trying to construct. The display now is fine... but much like march madness it is a bracket tournament. Each day is different matchups and for now we have to input the players and the schools each time a new round starts. I am trying to make it more effecient so we only have to input the teams and the players once. So from what you put together...it would probably be better to create the teams seperate and the players seperate and give the players two id's a singles id and a doubles id ? [attachment deleted by admin]
×
×
  • 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.