Jump to content

postonoh

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

postonoh's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Here are two location that may help you. http://www.w3schools.com/php/php_ajax_database.asp http://www.w3schools.com/ajax/ajax_database.asp let me know if this helps. If not give me a design layout for your form.
  2. Hello PHP World, I don't have access to the database yet for the project I am working on so I created a work around until I get full access to the mysql database. I <?php $xml_file = "affiliate.xml"; // OPEN XML FILE ###################################################### if(!$xml=simplexml_load_file($xml_file)){ trigger_error('Error reading XML file',E_affiliate_ERROR); } if(!empty($_GET['add'])){ $u_name = stripslashes($_POST['name']); $u_company = stripslashes($_POST['company']); $u_address = stripslashes($_POST['address']); $u_city = stripslashes($_POST['city']); $u_state = stripslashes($_POST['state']); $u_phone = stripslashes($_POST['phone']); $u_email = stripslashes($_POST['email']); $u_desc = stripslashes($_POST['description']); $u_region = stripslashes($_POST['region']); // Generate new (appended) ID foreach($xml as $affiliate){ $last_id = $affiliate->uid; } $id = $last_id+1; // Add node $x = $xml->addChild("affiliate"); $x->addChild("uid",$id); $x->addChild("name",$u_name); $x->addChild("company",$u_company); $x->addChild("address",$u_address); $x->addChild("city",$u_city); $x->addChild("state",$u_state); $x->addChild("phone",$u_phone); $x->addChild("email",$u_email); $x->addChild("description",$u_desc); $x->addChild("region",$u_region); $xml->asXML($xml_file); } ?> html form <br /> <br /> <h1>Affiliate </h1> <form name="xml_writing" method="post" action="?add=t"> <table width="393"> <tr><td width="56"> Name:<br /></td><td width="206"> <input type="text" name="name" width="150"/></td> <td>Region:</td> <td><select name="region" value="options"> <option value="resellerNE">NorthEast</option> <option value="resellerSE">SouthEast</option> <option value="resellerC">Central</option> <option value="resellerNE">NorthWest</option> <option value="resellerNE">SouthWest</option> <option value="resellerNE">International</option> </select></td> </tr> <tr> <td> Company:<br /></td><td> <input type="text" name="company" width="150" /></td> </tr> <tr><td> Address:<br /></td><td> <input type="text" name="address" width="150"/></td> </tr> <tr><td height="45"> City:<br /></td><td> <input type="text" name="city" width="150"/></td> <tr><td> State:<br /></td><td> <input type="text" name="state" width="150"/></td> <tr><td> Phone:<br /></td><td> <input type="text" name="phone" width="150"/></td> <tr><td> Email:<br /></td><td> <input type="text" name="email" width="150"/></td> </tr> <tr><td colspan="2"> Short description of yourself, your practice, your services, and other information of interest to potential clients or collaborators.<br /></td> <tr><td colspan="2"> <textarea name="description" style="width: 406px; height: 136px;"></textarea></td> </tr> <tr><td></td><td> <input type="submit" value="Submit" /></td> </tr> </table></form> What I am trying to do is have on submit check against the email node in the xml file to see if email exist. if exist string already a member else insert. if you can help with code or point to something that will help. "Everyone needs a mentor to lead them into success." Quote by Shelby Poston
  3. I have this in a file called mailform.php. It check for valid email and phone number. If wrong it echo error but it still send the mail to me. I need for it if error not to send then redirect to same page with problems. no error redirect to main page. I can get to redirect with no problem. I can't figure out how to make it not send if errors. I hope I am explaining this right. $fname = $_POST['firstName']; $lname = $_POST['lastName']; $degree = $_POST['Degree_Certificate']; $company = $_POST['companyName']; $address = $_POST['street']; $city = $_POST['city']; $state = $_POST['stateProvReg']; $phone = $_POST['phone']; $email = $_POST['email']; $message = $_POST['description']; $receive = "we receive your Affiliate information"; $formcontent=" Thank you $receive \n First Name: $fname \n Last Name: $lname \n Degree: $degree \n Company: $company \n Address: $address \n City: $city \n State: $state \n Phone: $phone \n Email: $email \n Description: $message"; $recipient = "webtechnician@brainmaster.com, $email"; $subject = "Affiliate List"; $mailheader = "From: $email \r\n"; if (validatePhone($phone)) { echo $phone . ' is a valid phone number.'; } else { echo $phone . ' is not valid phone number.'; } if (check_email_address($email)) { echo $email . ' is a valid email address.'; } else { echo $email . ' is not a valid email address, please hit the back button.'; } function check_email_address($email) { // First, we check that there's one @ symbol, and that the lengths are right if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { // Email invalid because wrong number of characters in one section, or wrong number of @ symbols. return false; } // Split it into sections to make life easier $email_array = explode("@", $email); $local_array = explode(".", $email_array[0]); for ($i = 0; $i < sizeof($local_array); $i++) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { return false; } } if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name $domain_array = explode(".", $email_array[1]); if (sizeof($domain_array) < 2) { return false; // Not enough parts to domain } for ($i = 0; $i < sizeof($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) { return false; die("hit the back button"); } } } return true; } function validatePhone($phone) { $numbersOnly = ereg_replace("[^0-9]", "", $string); $numberOfDigits = strlen($numbersOnly); if ($numberOfDigits == 7 or $numberOfDigits == 10) { echo $numbersOnly; } else { echo 'Invalid Phone Number'; } } function valIP($string) { if (preg_match( '^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$^', $string)) { echo $string; } else { echo 'Invalid IP Address'; } } mail($recipient, $subject, $formcontent, $mailheader) or die("Error!"); echo "Thank You!"; header('Location: http://#');
  4. I created a email form page. I receive the data from the form. I would like for it to email a link to verify user is real. I am not a PHP programmer. So I have been looking for scripts to help. So far everything I have found has to do with a database.
  5. Html code <div id="feedback"> <p class="error wrong_name"> Fill the correct name</p> <p class="error wrong_email"> Incorrect email</p> <p class="error wrong_message"> Enter your message</p> </div> <form action="sendemail.php" id="contact_us" method="post"> <p class="label_name">Name</p> <p class="input_form"> <input type="text" name="Name" width="20"/> </p> <p class="label_name">Email</p> <p class="input_form"> <input type="text" name="Email" /> </p> <p class="label_name">Message</p> <p class="input_form" id="textarea"> <textarea name="Message" rows="5" cols="4" id="message_input"></textarea> </p> <p id="submit"> <input type="submit" value="Send" name="submitButton" class="button" /> </p> </form> <p id="success">Your message was sent succesfully!</p> Php code <?php $mailTo = 'vmoore@minoritybiz.org'; $name = htmlspecialchars($_POST['Name']); $mailFrom = htmlspecialchars($_POST['Email']); $subject = 'Information Request'; $message_text = htmlspecialchars($_POST['Message']); $message = 'From: '.$name.'; Email: '.$mailFrom.' ; Message: '.$message_text; mail($mailTo, $subject, $message); ?> this works real simple I would like to add a auto respond to the person click the submit button.
  6. postonoh

    mail

    Sorry, I know how to make a basic php contact form. <?php /* Email Variables */ $emailSubject = ' Event'; $webMaster = 'mail@mail.com'; /* Data Variables */ $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $company = $_POST['company']; $address = $_POST['address']; $city= $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $event = $_POST[Event]; $body = <<<EOD <br><hr><br> Name: $name <br> Email: $email <br> Phone: $phone <br> Company: $company <br> Address: $address<br> City: $city <br> State: $state <br> Postal Code: $zip <br> Event: $emailsubject <br> EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /* Results rendered as HTML */ $theResults = <<<EOD <html> <head> <title>sent message</title> <meta http-equiv="refresh" content="3;URL="> <style type="text/css"> <!-- body { background-color: #244a30; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 20px; font-style: normal; line-height: normal; font-weight: normal; color: #fab323; text-decoration: none; padding-top: 200px; margin-left: 150px; width: 800px; } --> </style> </head> <blockquote><center> <div align="center">Registration Complete!<br> You will return to in a few seconds !</div> </center></blockquote> </div> </body> </html> EOD; echo "$theResults"; ?> I need to know how make it loop thru check boxes and if the person register select yes send email to different locations.
  7. postonoh

    mail

    Looking for code form a registration page if a user select yes then send just the contact first and last name to one email address if no send all information to another email address.
×
×
  • 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.