Jump to content

mrcoda

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by mrcoda

  1. I need to first check the form using JS client side, then server side as a back up , then send an email notification to myself and the user , and then update my database, its a quick call back form that adds to my customer database. Heres the form <div class="requestacallform"> <form method="post" id="quickcontact" name="quickcontact" action="update_quickcontacts.php"><fieldset> <ul id="quickcontactform"> <li>name<input name="name" type="text" size="15" maxlength="30" /></li> <li>company<input name="company" type="text" size="15" maxlength="50" /></li> <li>phone<input name="phone" type="text" size="15" maxlength="30" /></li> <li>email<input name="email" type="text" size="15" maxlength="50" /></li> <li><input type="submit" value="send" class="submitbutton" onClick="return checkForm();" /></li> </ul></fieldset> </form> </div> The javascript is ok, but the following php isnt right. The connect to database works on its own , its how I join the two together. The validation and the update. <?php $errmsg = ''; // error message $name = ''; // sender's name $company = ''; // the message itself $email = ''; // sender's email addres $phone = ''; // message subject if(isset($_POST['send'])) { $name=$_POST["name"]; $company=$_POST["company"]; $email=$_POST["email"]; $phone=$_POST["phone"]; if(trim($sname) == '') { $errmsg = 'Please enter your name'; } else if(trim($email) == '') { $errmsg = 'Please enter your email address'; } else if(!isEmail($email)) { $errmsg = 'Your email address is not valid'; } else if(trim($subject) == '') { $errmsg = 'Please enter message subject'; } else if(trim($message) == '') { $errmsg = 'Please enter your message'; } if($errmsg == '') { if(get_magic_quotes_gpc()) { $subject = stripslashes($subject); $message = stripslashes($message); } $to = "richard@rbcreations.co.uk"; $subject = '[Contact] : ' . $subject; $msg = "From : $sname \r\n " . $message; mail($to, $subject, $msg, "From: $email\r\nReturn-Path: $email\r\n"); mysql_connect ("localhost", "rbcreati_richard", "burb1971") or die ('Error: ' . mysql_error()); mysql_select_db ("rbcreati_clients"); $query = "INSERT INTO quickcontacts VALUES ('','$name','$company','$email','$phone')"; mysql_query($query); mysql_close(); ?>
  2. thanks mate , problem solved, a little thing eaI changed the root folder and was uploading and changing for a while and realised the updated files were going to the wrong place. A real mind boggler , especially when coding and every character can throw you. Be warned newbees and oldschool alike. Thanks both of you for your help.
  3. I'm connecting but the data from the form isnt being entered into the fields. HELP , i NEED SOMEBODY, <?php $name=$_POST["name"]; $company=$_POST["company"]; $email=$_POST["email"]; mysql_connect ("localhost", "rbcreati_richard", "burb1971") or die ('Error: ' . mysql_error()); mysql_select_db ("rbcreati_clients"); $query = "INSERT INTO quickcontacts VALUES ('','$name','$company','$email')"; mysql_query($query); ?> <?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="description" content="RB CREATIONS. WEB DESIGN, GRAPHIC DESIGN , DIGITAL PHOTO EDITING, SEO. Search engine optimisation explained in simple terms for business people, web design explained in simple terms for business people. Websites Built to W3C Standards XHTML STRICT, Fast loading graphics, Bespoke designs. " /> <meta name="keywords" content="web design, design web, graphic design, digital photo, creative design, flash, photo editing, flash, seo, xhtml " /> <link href="allstyles.css" rel="stylesheet" type="text/css" /> <title>WWW.RBCREATIONS.CO.UK---------web design----graphic design----digital photo optimising and editing-----search engine optimisation SEO----</title> </head> <body> <div>ggdg <form action="update_quickcontacts.php" method="post" id="quickcontact" > <fieldset> contact name<br /><input id="name" type="text" size="25" maxlength="30" /><br /><br /> company<br /><input id="company" type="text" size="25" maxlength="50" /><br /><br /> email<br /><input id="email" type="text" size="25" maxlength="50" /><br /><br /> <input type="submit" value="up date database" /> </fieldset> </form> </div> </body> </html>
  4. now there no data carried into the database. i'm getting new rows, thats it <form action="update_quickcontacts.php" method="post" id="quickcontact" > <fieldset> contact name<br /><input id="name" type="text" size="25" maxlength="30" /><br /><br /> company<br /><input id="company" type="text" size="25" maxlength="50" /><br /><br /> email<br /><input id="email" type="text" size="25" maxlength="50" /><br /><br /> <input type="submit" value="up date database" /> </fieldset> </form> <?php $name=$_POST["name"]; $company=$_POST["company"]; $email=$_POST["email"]; mysql_connect ("localhost", "rbcreati_richard", "burb1971") or die ('Error: ' . mysql_error()); mysql_select_db ("rbcreati_clients"); $query = "INSERT INTO quickcontacts VALUES ('','$name','$company','$email')"; mysql_query($query); ?>
  5. Thanks mate ,your a star or a asterix depending on how geeky you are, geeky is a compliment obviously.
  6. please look at this for me. its throwing up this error , not even the echo works. VERY NEWBEE. Parse error: syntax error, unexpected '[' in /home/rbcreati/public_html/update_quickcontacts.php on line 3 heres the php file. <?php echo "hello"; $name=$_POST=["name"]; $company=$_POST=["company"]; $email=$_POST["email"]; mysql_connect ("localhost", "rbcreati_richard", "burb1971") or die ('Error: ' . mysql_error()); mysql_select_db ("rbcreati_clients"); ?> and here the xhtml <?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="description" content="RB CREATIONS. WEB DESIGN, GRAPHIC DESIGN , DIGITAL PHOTO EDITING, SEO. Search engine optimisation explained in simple terms for business people, web design explained in simple terms for business people. Websites Built to W3C Standards XHTML STRICT, Fast loading graphics, Bespoke designs. " /> <meta name="keywords" content="web design, design web, graphic design, digital photo, creative design, flash, photo editing, flash, seo, xhtml " /> <link href="allstyles.css" rel="stylesheet" type="text/css" /> <title>WWW.RBCREATIONS.CO.UK---------web design----graphic design----digital photo optimising and editing-----search engine optimisation SEO----</title> </head> <body> <div> <form action="update_quickcontacts.php" method="post" id="quickcontact" > <fieldset> contact name<br /><input name="name" type="text" size="25" maxlength="30" /><br /><br /> company<br /><input name="company" type="text" size="25" maxlength="50" /><br /><br /> email<br /><input name="email" type="text" size="25" maxlength="50" /><br /><br /> <input type="submit" value="up date database" /> </fieldset> </form> </div> </body> </html> check it "NOT" working at http://www.rbcreations.co.uk/quickcontact.html
×
×
  • 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.