
Darco
Members-
Posts
13 -
Joined
-
Last visited
Everything posted by Darco
-
I can not send mail using my php scripts. If I take my files and move them over to my web host, I can send just fine but when I try to send from my server at the office...nothing. My question is... How do you set up a computer to send mail via php? Do I just config the php.ini? Do I need a mail sending programs such as mercury? Please help, I'm currently try to us XAMPP. Thanks guys,
-
So this is the code...I put in My email.com in the spaces...insted of my real email...anyways heres the code...if anyone can be kind enough to pre post the code...but in working order...lol =D I need it to work with gmail... <?php session_start(); /******************************************************************************* * Title: Easy PHP Contact Form * Version: 1.3 @ October 23, 2009 * Author: Vishal P. Rao * Website: http://www.easyphpcontactform.com ******************************************************************************** * COPYRIGHT NOTICE * Copyright 2009 Vishal P. Rao. All Rights Reserved. * * This script may be used and modified free of charge by anyone * AS LONG AS COPYRIGHT NOTICES AND ALL THE COMMENTS REMAIN INTACT. * By using this code you agree to indemnify Vishal P. Rao or * www.easyphpcontactform.com from any liability that might arise from * it's use. * * Selling the code for this program, in part or full, without prior * written consent is expressly forbidden. * * Obtain permission before redistributing this software over the Internet * or in any other medium. In all cases copyright and header must remain * intact. This Copyright is in full effect in any country that has * International Trade Agreements with the India * * Removing any of the copyright notices without purchasing a license * is illegal! *******************************************************************************/ /******************************************************************************* * Script configuration - Refer README.txt *******************************************************************************/ /* Email address where the messages should be delivered */ $to = 'my email.com'; /* From email address, in case your server prohibits sending emails from addresses other than those of your own domain (e.g. [email protected]). If this is used then all email messages from your contact form will appear from this address instead of actual sender. */ $from = 'my email.com'; /* This will be appended to the subject of contact form message */ $subject_prefix = 'My Website Contact'; /* Form header file */ $header_file = 'form-header.php'; /* Form footer file */ $footer_file = 'form-footer.php'; /* Form width in px or % value */ $form_width = '70%'; /* Form background color */ $form_background = '#F7F8F7'; /* Form border color */ $form_border_color = '#CCCCCC'; /* Form border width */ $form_border_width = '1px'; /* Form border style. Examples - dotted, dashed, solid, double */ $form_border_style = 'solid'; /* Form cell padding */ $cell_padding = '5px'; /* Form left column width */ $left_col_width = '25%'; /* Form font size */ $font_size = '12px'; /* Empty/Invalid fields will be highlighted in this color */ $field_error_color = '#FF0000'; /* Thank you message to be displayed after the form is submitted. Can include HTML tags. Write your message between <!-- Start message --> and <!-- End message --> */ $thank_you_message = <<<EOD <!-- Start message --> <p>We have received your message. If required, we'll get back to you as soon as possible.</p><br /><br /><br /><br /><br /><br /><br /><br /> <!-- End message --> EOD; /* URL to be redirected to after the form is submitted. If this is specified, then the above message will not be shown and user will be redirected to this page after the form is submitted */ /* Example: $thank_you_url = 'http://www.yourwebsite.com/thank_you.html'; */ $thank_you_url = ''; /******************************************************************************* * Do not change anything below, unless of course you know very well * what you are doing *******************************************************************************/ $name = array('Name','name',NULL,NULL); $email = array('Email','email',NULL,NULL,NULL); $subject = array('Subject','subject',NULL,NULL); $message = array('Message','message',NULL,NULL); $code = array('Code','captcha_code',NULL,NULL,NULL); $error_message = ''; if (!isset($_POST['submit'])) { showForm(); } else { //form submitted $error = 0; if(!empty($_POST['name'])) { $name[2] = clean_var($_POST['name']); if (function_exists('htmlspecialchars')) $name[2] = htmlspecialchars($name[2], ENT_QUOTES); } else { $error = 1; $name[3] = 'color:#FF0000;'; } if(!empty($_POST['email'])) { $email[2] = clean_var($_POST['email']); if (!validEmail($email[2])) { $error = 1; $email[3] = 'color:#FF0000;'; $email[4] = '<strong><span style="color:#FF0000;">Invalid email</span></strong>'; } } else { $error = 1; $email[3] = 'color:#FF0000;'; } if(!empty($_POST['subject'])) { $subject[2] = clean_var($_POST['subject']); if (function_exists('htmlspecialchars')) $subject[2] = htmlspecialchars($subject[2], ENT_QUOTES); } else { $error = 1; $subject[3] = 'color:#FF0000;'; } if(!empty($_POST['message'])) { $message[2] = clean_var($_POST['message']); if (function_exists('htmlspecialchars')) $message[2] = htmlspecialchars($message[2], ENT_QUOTES); } else { $error = 1; $message[3] = 'color:#FF0000;'; } if(empty($_POST['captcha_code'])) { $error = 1; $code[3] = 'color:#FF0000;'; } else { include_once "securimage.php"; $securimage = new Securimage(); $valid = $securimage->check($_POST['captcha_code']); if(!$valid) { $error = 1; $code[3] = 'color:#FF0000;'; $code[4] = '<strong><span style="color:#FF0000;">Incorrect code</span></strong>'; } } if ($error == 1) { $error_message = '<span style="font-weight:bold;font-size:90%;">Please correct/enter field(s) in red.</span>'; showForm(); } else { if (function_exists('htmlspecialchars_decode')) $name[2] = htmlspecialchars_decode($name[2], ENT_QUOTES); if (function_exists('htmlspecialchars_decode')) $subject[2] = htmlspecialchars_decode($subject[2], ENT_QUOTES); if (function_exists('htmlspecialchars_decode')) $message[2] = htmlspecialchars_decode($message[2], ENT_QUOTES); $body = "$name[0]: $name[2]\r\n"; $body .= "$email[0]: $email[2]\r\n\r\n"; $body .= "$message[0]:\r\n$message[2]\r\n"; if (!$from) $from_value = $email[2]; else $from_value = $from; $headers = "From: $from_value" . "\r\n"; $headers .= "Reply-To: $email[2]" . "\r\n"; mail($to,"$subject_prefix - $subject[2]", $body, $headers); if (!$thank_you_url) { include $header_file; echo $GLOBALS['thank_you_message']; echo "\n"; include $footer_file; } else { header("Location: $thank_you_url"); } } } //else submitted function showForm() { global $name, $email, $subject, $message, $code, $header_file, $footer_file, $form_width, $form_background, $form_border_color, $form_border_width, $form_border_style, $cell_padding, $left_col_width, $font_size; include $header_file; echo $GLOBALS['error_message']; echo <<<EOD <form method="post" class="cForm"> <table style="width:{$form_width}; background-color:{$form_background}; border:{$form_border_width} {$form_border_style} {$form_border_color}; padding:10px; font-size:{$font_size};" class="contactForm"> <tr> <td style="width:{$left_col_width}; text-align:left; vertical-align:top; padding:{$cell_padding}; font-weight:bold; {$name[3]}">{$name[0]}</td> <td style="text-align:left; vertical-align:top; padding:{$cell_padding};"><input type="text" name="{$name[1]}" value="{$name[2]}" /></td> </tr> <tr> <td style="width:{$left_col_width}; text-align:left; vertical-align:top; padding:{$cell_padding}; font-weight:bold; {$email[3]}">{$email[0]}</td> <td style="text-align:left; vertical-align:top; padding:{$cell_padding};"><input type="text" name="{$email[1]}" value="{$email[2]}" /> {$email[4]}</td> </tr> <tr> <td style="width:{$left_col_width}; text-align:left; vertical-align:top; padding:{$cell_padding}; font-weight:bold; {$subject[3]}">{$subject[0]}</td> <td style="text-align:left; vertical-align:top; padding:{$cell_padding};"><input type="text" name="{$subject[1]}" value="{$subject[2]}" size="40" /></td> </tr> <tr> <td style="width:{$left_col_width}; text-align:left; vertical-align:top; padding:{$cell_padding}; font-weight:bold; {$message[3]}">{$message[0]}</td> <td style="text-align:left; vertical-align:top; padding:{$cell_padding};"><textarea name="{$message[1]}" cols="40" rows="6">{$message[2]}</textarea></td> </tr> <tr> <td style="width:{$left_col_width}; text-align:left; vertical-align:top; padding:{$cell_padding};"> </td> <td style="text-align:left; vertical-align:top; padding:{$cell_padding};"><img id="captcha" src="securimage_show.php" alt="CAPTCHA Image" /></td> </tr> <tr> <td style="width:{$left_col_width}; text-align:left; vertical-align:top; padding:{$cell_padding}; font-weight:bold; {$code[3]}">{$code[0]}</td> <td style="text-align:left; vertical-align:top; padding:{$cell_padding};"><input type="text" name="{$code[1]}" size="10" maxlength="5" /> {$code[4]} <br /><br />(Please enter the text in the image above. Text is not case sensitive.)<br /> <a href="#" onclick="document.getElementById('captcha').src = 'securimage_show.php?' + Math.random(); return false">Click here if you cannot recognize the code.</a> </td> </tr> <tr> <td colspan="2" style="text-align:left; vertical-align:middle; padding:{$cell_padding}; font-size:90%; font-weight:bold;">All fields are required.</td> </tr> <tr> <td colspan="2" style="text-align:left; vertical-align:middle; padding:{$cell_padding};"><input type="submit" name="submit" value="Submit" style="border:1px solid #999;background:#E4E4E4;margin-top:5px;" /></td> </tr> </table> </form> <div style="width:{$form_width};text-align:right;font-size:80%;"> <a href="http://www.easyphpcontactform.com/" title="PHP Contact Form">PHP Contact Form</a> </div> EOD; include $footer_file; } function clean_var($variable) { $variable = strip_tags(stripslashes(trim(rtrim($variable)))); return $variable; } /** Email validation function. Thanks to http://www.linuxjournal.com/article/9585 */ function validEmail($email) { $isValid = true; $atIndex = strrpos($email, "@"); if (is_bool($atIndex) && !$atIndex) { $isValid = false; } else { $domain = substr($email, $atIndex+1); $local = substr($email, 0, $atIndex); $localLen = strlen($local); $domainLen = strlen($domain); if ($localLen < 1 || $localLen > 64) { // local part length exceeded $isValid = false; } else if ($domainLen < 1 || $domainLen > 255) { // domain part length exceeded $isValid = false; } else if ($local[0] == '.' || $local[$localLen-1] == '.') { // local part starts or ends with '.' $isValid = false; } else if (preg_match('/\\.\\./', $local)) { // local part has two consecutive dots $isValid = false; } else if (!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain)) { // character not valid in domain part $isValid = false; } else if (preg_match('/\\.\\./', $domain)) { // domain part has two consecutive dots $isValid = false; } else if (!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', str_replace("\\\\","",$local))) { // character not valid in local part unless // local part is quoted if (!preg_match('/^"(\\\\"|[^"])+"$/', str_replace("\\\\","",$local))) { $isValid = false; } } if ($isValid && function_exists('checkdnsrr')) { if (!(checkdnsrr($domain,"MX") || checkdnsrr($domain,"A"))) { // domain not found in DNS $isValid = false; } } } return $isValid; } ?> Sorry guys but I dont know what im doing with PHP. Thanks for the replys... Darco
-
Hello guys...I need some help...I am nto good in php...so I decided to find me a contact form script...and everyone I find is ok...but it gives me Warning: mail() expects at least 3 parameters, 0 given in C:\Server\htdocs\contact-form.php on line 189 I am trying to get the form to send it to my gmail account but it no work Please help... Thanks!
-
Hello guys! I need help with a php form that will update my MySQL database..But it dosnt update the whole thing...some of the feilds are blank! Heres the code: <style type="text/css"> hr.pme-hr { border: 0px solid; padding: 0px; margin: 0px; border-top-width: 1px; height: 1px; } table.pme-main { border: #004d9c 1px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; } table.pme-navigation { border: #004d9c 0px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; } td.pme-navigation-0, td.pme-navigation-1 { white-space: nowrap; } th.pme-header { border: #004d9c 1px solid; padding: 4px; background: #add8e6; } td.pme-key-0, td.pme-value-0, td.pme-help-0, td.pme-navigation-0, td.pme-cell-0, td.pme-key-1, td.pme-value-1, td.pme-help-0, td.pme-navigation-1, td.pme-cell-1, td.pme-sortinfo, td.pme-filter { border: #004d9c 1px solid; padding: 3px; } td.pme-buttons { text-align: left; } td.pme-message { text-align: center; } td.pme-stats { text-align: right; } </style><?php /* * IMPORTANT NOTE: This generated file contains only a subset of huge amount * of options that can be used with phpMyEdit. To get information about all * features offered by phpMyEdit, check official documentation. It is available * online and also for download on phpMyEdit project management page: * * http://platon.sk/projects/main_page.php?project_id=5 * * This file was generated by: * * phpMyEdit version: 5.7.1 * phpMyEdit.class.php core class: 1.204 * phpMyEditSetup.php script: 1.50 * generating setup script: 1.50 */ // MySQL host name, user name, password, database, and table $opts['hn'] = 'localhost'; $opts['un'] = 'root'; $opts['pw'] = 'ascent'; $opts['db'] = 'clubhouse db'; $opts['tb'] = 'Sign In'; // Name of field which is the unique key $opts['key'] = 'ID'; // Type of key field (int/real/string/date etc.) $opts['key_type'] = 'int'; // Sorting field(s) $opts['sort_field'] = array('ID'); // Number of records to display on the screen // Value of -1 lists all records in a table $opts['inc'] = 15; // Options you wish to give the users // A - add, C - change, P - copy, V - view, D - delete, // F - filter, I - initial sort suppressed $opts['options'] = 'ACPVDF'; // Number of lines to display on multiple selection filters $opts['multiple'] = '4'; // Navigation style: B - buttons (default), T - text links, G - graphic links // Buttons position: U - up, D - down (default) $opts['navigation'] = 'DB'; // Display special page elements $opts['display'] = array( 'form' => true, 'query' => true, 'sort' => true, 'time' => true, 'tabs' => true ); // Set default prefixes for variables $opts['js']['prefix'] = 'PME_js_'; $opts['dhtml']['prefix'] = 'PME_dhtml_'; $opts['cgi']['prefix']['operation'] = 'PME_op_'; $opts['cgi']['prefix']['sys'] = 'PME_sys_'; $opts['cgi']['prefix']['data'] = 'PME_data_'; /* Get the user's default language and use it if possible or you can specify particular one you want to use. Refer to official documentation for list of available languages. */ $opts['language'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'] . '-UTF8'; /* Table-level filter capability. If set, it is included in the WHERE clause of any generated SELECT statement in SQL query. This gives you ability to work only with subset of data from table. $opts['filters'] = "column1 like '%11%' AND column2<17"; $opts['filters'] = "section_id = 9"; $opts['filters'] = "PMEtable0.sessions_count > 200"; */ /* Field definitions Fields will be displayed left to right on the screen in the order in which they appear in generated list. Here are some most used field options documented. ['name'] is the title used for column headings, etc.; ['maxlen'] maximum length to display add/edit/search input boxes ['trimlen'] maximum length of string content to display in row listing ['width'] is an optional display width specification for the column e.g. ['width'] = '100px'; ['mask'] a string that is used by sprintf() to format field output ['sort'] true or false; means the users may sort the display on this column ['strip_tags'] true or false; whether to strip tags from content ['nowrap'] true or false; whether this field should get a NOWRAP ['select'] T - text, N - numeric, D - drop-down, M - multiple selection ['options'] optional parameter to control whether a field is displayed L - list, F - filter, A - add, C - change, P - copy, D - delete, V - view Another flags are: R - indicates that a field is read only W - indicates that a field is a password field H - indicates that a field is to be hidden and marked as hidden ['URL'] is used to make a field 'clickable' in the display e.g.: 'mailto:$value', 'http://$value' or '$page?stuff'; ['URLtarget'] HTML target link specification (for example: _blank) ['textarea']['rows'] and/or ['textarea']['cols'] specifies a textarea is to be used to give multi-line input e.g. ['textarea']['rows'] = 5; ['textarea']['cols'] = 10 ['values'] restricts user input to the specified constants, e.g. ['values'] = array('A','B','C') or ['values'] = range(1,99) ['values']['table'] and ['values']['column'] restricts user input to the values found in the specified column of another table ['values']['description'] = 'desc_column' The optional ['values']['description'] field allows the value(s) displayed to the user to be different to those in the ['values']['column'] field. This is useful for giving more meaning to column values. Multiple descriptions fields are also possible. Check documentation for this. */ $opts['fdd']['ID'] = array( 'name' => 'ID', 'select' => 'T', 'maxlen' => 3, 'sort' => true ); $opts['fdd']['Name'] = array( 'name' => 'Name', 'select' => 'T', 'maxlen' => 255, 'textarea' => array( 'rows' => 5, 'cols' => 50), 'sort' => true ); $opts['fdd']['Date'] = array( 'name' => 'Date', 'select' => 'T', 'maxlen' => 255, 'textarea' => array( 'rows' => 5, 'cols' => 50), 'sort' => true ); $opts['fdd']['Check-In Time'] = array( 'name' => 'Check In Time', 'select' => 'T', 'maxlen' => 255, 'textarea' => array( 'rows' => 5, 'cols' => 50), 'sort' => true ); $opts['fdd']['Check-Out Time'] = array( 'name' => 'Check Out Time', 'select' => 'T', 'maxlen' => 255, 'textarea' => array( 'rows' => 5, 'cols' => 50), 'sort' => true ); $opts['fdd']['Building-Unit'] = array( 'name' => 'Building Unit', 'select' => 'T', 'maxlen' => 255, 'textarea' => array( 'rows' => 5, 'cols' => 50), 'sort' => true ); $opts['fdd']['Guest Name(s)'] = array( 'name' => 'Guest Name(s)', 'select' => 'T', 'maxlen' => 255, 'textarea' => array( 'rows' => 5, 'cols' => 50), 'sort' => true ); $opts['fdd']['Activity'] = array( 'name' => 'Activity', 'select' => 'T', 'maxlen' => 255, 'textarea' => array( 'rows' => 5, 'cols' => 50), 'sort' => true ); $opts['fdd']['Comments'] = array( 'name' => 'Comments', 'select' => 'T', 'maxlen' => 16777215, 'textarea' => array( 'rows' => 5, 'cols' => 50), 'sort' => true ); // Now important call to phpMyEdit require_once 'phpMyEdit.class.php'; new phpMyEdit($opts); ?> I would like it if it works but not all the feilds get updated when I use it. I also would like the Date to be automatic and the ID to be self numbered with each record aswell as the time-in and the Activity feild to have a drop down....I prbly would be ok if somone could just get me the code so it updates all the feilds correctly. Thanks for your help, Darco
-
Well bro...how did u install it on the HDD? If you use WinRAR and install it on the WD HDD and use it as a second drive and start up...WAMP...it should work....and if u look up ur local host it should come up....if not use apache I never had any sutch problems and I can run apache from a cd on any comp... Let me know how it goes...maybe I can be at ferther help... Hope I helped you bro! Darco
-
Hello, guys... I understand this should be under the freelance section....but I wanted to try here first.... I am looking for somone who can make me a replica of craigslist...but much much smaller....Basicly a place for people to post ads on...for free! If anyone can clone craigslist for me and or edit it for me...that would be awesome! Thanks Darco
-
Hey Jnerocorp... I tryed your code and it works! PERFECT but I don't need that specific thing... I'm going to tell you what do need... and that is.... An exact same thing but with more fields to it.... here what I need... I need just a basic php form that will update the MySQL database....The stuff in () is what I would like their fuctions to be... I need something with the following fields: (Automatic) Record # Name (Auto Populated) Date (Auto Populated) Check In Time (Manually Enter) Check Out time Bldg/Unit Resident Name Guests Comments Activity ( For "Activity" I would like somthing thats with 4 drop down menus so I can choose 4 or more activities at the same time) And the dropdown menues need to be all the same with these options: Wifi/Computers Billiards/Foosball Library TV Piano Tour Weight Room Swimming Pool Hot Tub Sauna Game Room Party Room Tennis Court Cardio Room I want 4 dropdowns so I if somone is going to use the weight room then the TV then I can select both...So if you can make 4 dropdowns..... Also I would like to say sorry if this is to harsh or meanful but If you can help me out with this then I would gladly want to help you anytime in need or even give you some rep on PHPFreaks.com if I can. Or help you with any IT problems... Thanks ask me Qs if u need to...
-
Awesome man! Thank You so much...You don't know how much you helped me... Is there anyway I can give you some rep....?
-
Hey I tryed your code and it gives me a error: Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ',' or ')' in C:\AC Web MaNGOS Hybrid\Server\htdocs\input.php on line 2 Please help... I appreciate you helping...
-
Hello Guys, I just joined PHPFreaks.com and I am mainly here for some help. I work for a small biz and we need a form that updates a SQL Database....Here is my code below: The input.html (Form for the fields): <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>GRCA Club House Control Panel</title> <style type="text/css"> <!-- .style1 {color: #006600} .style2 { color: #006600; font-style: italic; font-size: 18px; } --> </style> </head> <body> <table border="1"> <tr> <td align="center">GRCA Club House Check In</td> </tr> <tr> <td> <table> <form method="post" action="input.php"> <tr> <td>Name</td> <td><input type="text" name="name" size="50"></td> </tr> <tr> <td>Address</td> <td><input type="text" name="address" size="50"></td> </tr> <tr> <td></td> <td align="right"><input type="submit" name="submit" value="Save"></td> </tr> </table></td> </tr> </table> <p class="style2"> Helpful Links:</p> <p class="style1"><a href="http://goldenridgecondos.org"><strong>Go to GRCA Website</strong></a></p> <p class="style1"><a href="#"><strong>Lookup Unit</strong></a></p> <p class="style1"><a href="#"><strong>Submit A Work Order</strong></a></p> <p> </p> </body> </html> And the post action PHP form is: <? //the example of inserting data with variable from HTML form //input.php mysql_connect("localhost","root","ascent");//database connection mysql_select_db("employees"); //inserting data order $order = "INSERT INTO data_employees (name, address) VALUES ('$name', '$address')"; //declare in the order variable $result = mysql_query($order); //order executes if($result){ echo("<br>Data was successfully saved into DataBase."); } else{ echo("<br>Data was could not be saved into DataBase. Please check to make sure the DataBase is running or that you have entered the correct info. "); } ?> It submits a new row but, the row is empty. How do I fix this? I do not know alot about PHP that is why I came here for some help. Thanks, Darco