PHP - Moved: Godaddy Gdform.php Modification (mailform Processor)
This topic has been moved to Third Party PHP Scripts.
http://www.phpfreaks.com/forums/index.php?topic=332575.0 Similar TutorialsThis topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=327718.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=355561.0 the sript tells me he send it, without i fill in anything.
and i dont get any mail
testversion : remcogaasenbeek.nl/nieuw index.html <form name="form1" method="post" action="verzenden.php"> <table width="400" border="0"> <tr> <td colspan="2"> </b></td> </tr> <tr> <td width="30%"><font face="Arial" size="2"><font color="#f19028">*</font> Naam</font></td> <td width="70%"> <input type="text" name="naam" size="20"> </td> </tr> <tr> <td width="30%"><font face="Arial" size="2"><font color="#f19028">*</font> Email</font></td> <td width="70%"> <input type="text" name="email" size="20"> </td> </tr> <tr> <td width="30%"><font face="Arial" size="2"><font color="#f19028">*</font> Telefoonnummer</font></td> <td width="70%"> <input type="text" name="telefoonnummer" size="20"> </td> </tr> <tr> <td width="30%"><font face="Arial" size="2"><font color="#f19028">*</font> Woonplaats</font></td> <td width="70%"> <input type="text" name="woonplaats" size="20"> </td> </tr> </tr> <tr> <td colspan="2"> <font face="Arial" size="2"><br> <input type="submit" name="submit" value="Verstuur"> </font> </td> </tr> </table> </form> <font color="#f19028">*</font> <font size="1"> De proefles is gratis indien men besluit om een rijopleiding <BR>bij rijschool Remco Gaaseneek te nemen. anders blijft het een vrijblijvende les van €25,-.</font> <?php if (!isset($_POST['naam']) || !isset($_POST['email']) || !isset($_POST['telefoonnummer'])) { echo 'U heeft niet alle velden ingevuld!'; exit; } $naam = htmlspecialchars($_POST['naam']); $email = htmlspecialchars($_POST['email']); $telefoonnummer = htmlspecialchars($_POST['telefoonnummer']); $woonplaats= htmlspecialchars($_POST['woonplaats']); $tijd = time(); $datum = strftime('%d/%m/%y %H:%M', $tijd); $ip = getenv('REMOTE_ADDR'); $message = $naam.' met het e-mailadres '.$email.' en het IP '.$ip.' stuurde op '.$datum.' het volgende nummer en woonplaats: ____________________________________ '.$telefoonnummer.' '.$woonplaats.' ------------------------------------'; mail('timiejboi@gmail.com', 'proefles', $message, 'From: '.$email); echo 'Uw bericht is verzonden. U krijgt zo snel mogelijk antwoord.'; ?>i hope u guys can help me out. cheers, timmiejboi I am looking to edit my php code to make my own webpages display my thank you message when people submit a form from my website. I have attached the code of my current form, however these only produce basic text screens and i would like them to be redirected to a premade webpage so it doesnt look so tackey. I am new to php but am desperatly trying to grasp the basics. I am trying to also send a copy of the submited form back to the sender via email, but again do not know where in this code it goes. Any Help would be much appreciated. Thanks Code: [Select] <?php if(!$_POST) exit; $email = $_POST['email']; //$error[] = preg_match('/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i', $_POST['email']) ? '' : 'INVALID EMAIL ADDRESS'; if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email )){ $error.="Invalid email address entered"; $errors=1; } if($errors==1) echo $error; else{ $values = array ('name','email','message'); $required = array('name','email','message'); $your_email = "myaddress@gmail.com"; $email_subject = "New Message: ".$_POST['subject']; $email_content = "new message:\n"; foreach($values as $key => $value){ if(in_array($value,$required)){ if ($key != 'subject' && $key != 'company') { if( empty($_POST[$value]) ) { echo 'PLEASE FILL IN REQUIRED FIELDS'; exit; } } $email_content .= $value.': '.$_POST[$value]."\n"; } } if(@mail($your_email,$email_subject,$email_content)) { header("Location: http://www.temporary.com"); } else { echo 'ERROR!'; } } ?> That is the contact.php file i'm using. The information is sending but after the user submits the information the redirect is going to contact.php instead of the Location address I noted above. Also, on IE9 the Echo I replaced with header("Location..."); is showing up saying thanks while on sitename.com/contact.php and while in Chrome it's just blank. Both instances do not redirect. Please help. I'm extremely frustrated. Thanks. I am looking for a special PHP processor. I am gonna list what I need from most to least important. I will have a job application form in which people can apply for a job by filling out long form. The applications needs to be not e-mailed but stored on the server. They should be able to be well databased. I should have an option to backup the database, search through applications, sort through applications. Then I should be able to assign certain applications to certain admins (who would not have access to others). This restriction should be done by category. I will also have a client sign up sheet. Client information should also be stored on the server not e-mailed. I should be able to search, sort clients too. Clients should also be assigned to lower admins based on certain criteria. It would be nice to download applications as pfs and databases as xls or something like that. Both applicant and client should be able to login and change their information. An admin can change the status of an applicant to an employee/contractor. Then an admin can assign an employee to multiple clients. And then in best case scenario employee can bill client for particular services. I am willing to pay for a script that is kind of similar to this. What is the closest PHP script to this? Thanks I wrote this html form: Code: [Select] <form action=filterwords.php method=post ENCTYPE="multipart/form-data" target="iFramestatus"> <input type=hidden name=action value=modified> <input type=hidden name=login value="%%login%%"> <input type=hidden name=ID value="%%ID%%"> <textarea cols=28 rows=4 name=Unused10>%%Unused10%%</textarea> <input type=submit name=submit value=" Update "> </form> Most of this form is filled out by my members area cgi script. I am trying to use filterwords.php to remove curse words from the textarea field "unused10" and then resubmit the data to my members area cgi script "pm.cgi" Here is my php script. <?php $action = $_REQUEST['action'] ; $login = $_REQUEST['login'] ; $ID = $_REQUEST['ID'] ; $text = $_REQUEST['Unused10'] ; $submit = $_REQUEST['submit'] ; function filterBadWords($str){ // words to filter $badwords=array( "[badword1]", "[badword2]"); // replace filtered words with random spaces $replacements=array( "[ ]", "[ ]", "[ ]" ); for($i=0;$i < sizeof($badwords);$i++){ srand((double)microtime()*1000000); $rand_key = (rand()%sizeof($replacements)); $str=eregi_replace($badwords[$i], $replacements[$rand_key], $str); } return $str; } $text = filterBadWords($text); ?> How do i send the modified data to pm.cgi? Did i use the filter script correctly? Thanks for the help Hi, This is currently my code that generates a mail to me with all info the user provided in the form on the site. + it sends a auto reply to the user with details in it. I'd like to keep both emails stored in a log file for future use. Is this possible ? is it hard to add ? I've got no clue Anyone could help ? Code: [Select] <?php ob_start(); include_once('verbinding.php'); $result1 = mysql_fetch_array (mysql_query("SELECT COUNT(*) FROM `Clicks` WHERE Aan = '0'")); // controleren hoeveel rijen er zijn met "Aan" op 0 $lijst1 = $result1[0]; if($lijst1=='0') { // als de lijst leeg is wil dit zeggen dat ze allemaal op 1 staan en mogen ze gereset worden. mysql_query("UPDATE `Clicks` SET `Aan`= '0' WHERE `Aan`='1'"); } // indien er ook maar 1 veld op 0 staat zal er direkt naar hier worden gesprongen $result = mysql_fetch_array(mysql_query("SELECT ID,Email FROM `Clicks` WHERE Aan = '0' ORDER BY RAND() LIMIT 1")); $naarwie = $result['Email']; $ID = $result['ID']; echo $ID; echo $naarwie; mysql_query("UPDATE `Clicks` SET `Aan`= '1' WHERE ID = '$ID'"); mysql_close($verbinding); // Sluit de verbinding. // We hebben hem nu niet meer nodig. $fromemail="No-Reply <ikwerkthuis.be>"; // change here if you want $toemail=$naarwie; // change here if you want $sub="Online info aanvraag"; // change here if you want $success_page_name="bedankt.html"; ////// do not change in following if($_SERVER['REQUEST_METHOD']=="POST") { $fieldnm_1=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_1'])); $fieldnm_2=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_2'])); $fieldnm_3=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_3'])); $fieldnm_4=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_4'])); $fieldnm_5=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_5'])); $fieldnm_6=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_6'])); $contentmsg=stripslashes("<br><b><font style=color:#CC3300>$sub</font></b><br> <table width=708 border=0 cellpadding=2 cellspacing=1 bgcolor=#CCCCCC> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Voornaam *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_1</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Achternaam *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_2</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>E-mail *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_3</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Telefoon *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_4</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Werkstatus *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_5</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Leeftijd *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_6</td> </tr> </table> "); //// $headers = "MIME-Version: 1.0 "; $headers .= "Content-type: text/html; charset=iso-8859-1 "; $from=$fromemail; $headers .= "From: ".$from." "; @mail($toemail,$sub,$contentmsg,$headers); $IP = $_SERVER['REMOTE_ADDR']; $DATE = date("Y-m-d"); $TIME = date("H:i:s"); $NameOfSender = $fieldnm_1; $SurnameOfSender = $fieldnm_2; //$emailadd = $naarwie; $headers2 = "MIME-Version: 1.0 "; $headers2 .= "Content-type: text/html; charset=iso-8859-1 "; $from=$naarwie; $headers2 .= "From: ".$from." "; $email = $fieldnm_3; // use their addy instead of yours $subject = 'ikwerkthuis.be inloggegevens introductie film'; // change subject $text = 'Beste '. $NameOfSender .' '. $SurnameOfSender .',<br> <br> Welkom bij <A HREF="ikwerkthuis.be" TABINDEX="4">ikwerkthuis.be</A>.<br> Hieronder vind U de logingevens voor het bekijken van de introductiefilm:<br> <br> Adres: <A HREF="http://ikwerkthuis.be/index.php/introductie" TABINDEX="4">http://ikwerkthuis.be/index.php/introductie</A><br> Gebruikersnaam: introductie<br> Paswoord: film2012<br> <br> '. $contentmsg .'<br> <br> Wij nemen spoedig contact met u op.<br> <br> Met vriendelijke groeten,<br> Het ikwerkthuis.be team<br> <br> IP: '. $IP .'<br> Date: '. $DATE .'<br> Time: '. $TIME .''; // change text mail($email, $subject, $text,$headers2); // send another one out header("Location:$success_page_name"); } ?> I am using the Stripe API. Been at it for a day and still no luck. I keep getting this error. POST http://localhost/pay 404 (Not Found) Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position // this error is because of this line .then(handleServerResponse); It has specifically to do with this function. function handlePaymentMethodResult(result) { if (result.error) { // An error happened when collecting card details, show it in the payment form resultContainer.textContent = result.error.message; } else { // Otherwise send paymentMethod.id to your server (see Step 3) fetch('/pay', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ payment_method_id: result.paymentMethod.id }) }).then(function(result) { return result.json(); }).then(handleServerResponse); } } What is "/pay" suppose to be exactly? I assumed it was a page where i run my server process code. But it keeps giving me that error no matter what I try it.
Here is my full mode. INDEX.php <?php require_once 'library/stripe/init.php'; ?> <!DOCTYPE HTML> <head> <meta charset="UTF-8"> <title>Title</title> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="description" content="---"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <link rel="shortcut icon" href="/images/favicon.png" /> <link href="css/screen.css?v=1.1" media="screen, projection" rel="stylesheet" /> <script src="javascripts/jquery-3.2.0.min.js"></script> <script src="https://js.stripe.com/v3/"></script> <script src="javascripts/client.js" defer></script> </head> <body> <?php $total_amount = 20; ?> <div id="payment-box"> <div id="p-box-heading"> Total Amount: <span>$<?php if(empty($total_amount)){echo '0.00';}else{echo $total_amount;} ?> CAD</span> </div> <div id="p-box-body"> <form id="payment-form"> <div id="card-element"><!-- placeholder for Elements --></div> <button id="card-button">Submit Payment</button> <p id="payment-result"><!-- we'll pass the response from the server here --></p> </form> </div> </div> </body>
CLIENT.js var stripe = Stripe("pk_test_ROlyXpDaTbqIvSpndWp7IdxW"); var elements = stripe.elements(); var cardElement = elements.create('card'); cardElement.mount('#card-element'); var form = document.getElementById('payment-form'); var resultContainer = document.getElementById('payment-result'); cardElement.on('change', function(event) { if (event.error) { resultContainer.textContent = event.error.message; } else { resultContainer.textContent = ''; } }); form.addEventListener('submit', function(event) { event.preventDefault(); resultContainer.textContent = ""; stripe.createPaymentMethod({ type: 'card', card: cardElement, }).then(handlePaymentMethodResult); }); function handlePaymentMethodResult(result) { if (result.error) { // An error happened when collecting card details, show it in the payment form resultContainer.textContent = result.error.message; } else { // Otherwise send paymentMethod.id to your server (see Step 3) fetch('/pay', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ payment_method_id: result.paymentMethod.id }) }).then(function(result) { return result.json(); }).then(handleServerResponse); } } function handleServerResponse(responseJson) { if (responseJson.error) { // An error happened when charging the card, show it in the payment form resultContainer.textContent = responseJson.error; } else { // Show a success message resultContainer.textContent = 'Success!'; } }
SERVER.php \Stripe\Stripe::setApiKey('sk_test_GPxllXVIfWnuczEjLAGh7BaX'); header('Content-Type: application/json'); # retrieve JSON from POST body $json_str = file_get_contents('php://input'); $json_obj = json_decode($json_str); try { // Create the PaymentIntent $intent = \Stripe\PaymentIntent::create([ 'amount' => 1099, 'currency' => 'usd', 'payment_method' => $json_obj->payment_method_id, # A PaymentIntent can be confirmed some time after creation, # but here we want to confirm (collect payment) immediately. 'confirm' => true, # If the payment requires any follow-up actions from the # customer, like two-factor authentication, Stripe will error # and you will need to prompt them for a new payment method. 'error_on_requires_action' => true, ]); generateResponse($intent); } catch (\Stripe\Exception\ApiErrorException $e) { // Display error on client echo json_encode(['error' => $e->getMessage()]); } function generateResponse($intent) { if ($intent->status == 'succeeded') { // Handle post-payment fulfillment echo json_encode(['success' => true]); } else { // Any other status would be unexpected, so error echo json_encode(['error' => 'Invalid PaymentIntent status']); } }
Hey guys, I am adding to my current php form processor and I need it to be able to support image uploads, that also show up as an attachment in the email with the rest of the form data. The only part I am having problems with is getting the image to work as an attachment in the email, at the moment, it is not showing up at all in the email but it is successful at showing up on the web server (which I have it doing for storage reasons). I have attached the code involved for the image processing portion, an also a snippet of code showing how the emails are sent. This code is for the image attachment processing <?php //Get the uploaded file information $name_of_uploaded_file = basename($_FILES['uploaded_file']['name']); //Get the file extension of the file $type_of_uploaded_file = substr($name_of_uploaded_file, strrpos($name_of_uploaded_file, '.') + 1); $size_of_uploaded_file = $_FILES["uploaded_file"]["size"]/1024;//size in KBs //Settings $max_allowed_file_size = 150; // size in KB $allowed_extensions = array("jpg", "jpeg", "gif", "bmp", "png"); //Validations if($size_of_uploaded_file > $max_allowed_file_size ) { $errors .= "\n File size too large! Max file size alowed is $max_allowed_file_size"; } //------ Validate the file extension ----- $allowed_ext = false; for($i=0; $i<sizeof($allowed_extensions); $i++) { if(strcasecmp($allowed_extensions[$i],$type_of_uploaded_file) == 0) { $allowed_ext = true; } } if(!$allowed_ext) { $errors .= "\n The uploaded file is not supported file type. ". " Only the following file types are supported: ".implode(',',$allowed_extensions); } //Copy the temp. uploaded file to server $path_of_uploaded_file = $upload_folder . $name_of_uploaded_file; $tmp_path = $_FILES["uploaded_file"]["tmp_name"]; if(is_uploaded_file($tmp_path)) { if(!copy($tmp_path,$path_of_uploaded_file)) { $errors .= '\n Error while copying the uploaded file'; } } ?> This is the header setup for sending the email, which for some reason I think i am missing something here, causing the image to not show up in the email. Code: [Select] $headers = "From: edited_out_for_this_post@edited_out_for_this_post.com\r\n"; $headers .= "Reply-To: no-reply@edited_out_for_this_post.com\r\n"; $headers .= "Return-Path: no-reply@edited_out_for_this_post.com\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; Thanks for your help in advance! I'm so angry right now. Just want to vent a little.
Godaddy sucks. They are currently taking an blow torch to their servers, or them damn gremlins. Our shared host cpanel server is on for a few seconds then down again. If it is up, it can't connect to mysql. Then it works, then back. Why? oh ohhh ohhhh! Cause yesterday, from 7pm to this morning, 5 am they did what ever it is those nuts do and well now my client, our customers and I can't use the site. YAY!
No idea when it will be back. Work to do. But...why would that piss me off so much? That's not it!!
The day before yesterday, which would be Tuesday they had already started screwing things up. What ever they did caused the sql settings in my php.ini file to no longer mesh with the server. SO, I get the call from client and employees, "it's not working." Can't get to mysql. Call GoDaddy, they disable my php.ini and the timezone for the server changed and some odd hours later employees where calling me saying the data changed early.
72 hours, roughly of on edge, what's going to be next from GoDaddy.
This is just the past few days!
The 2 weeks before that I was trying to get a asp.net c# MVC application to run on another of their servers. Nope. Ended up getting a new host. 2 weeks!! Those 2 weeks were filled with godaddy saying "Everything is ok on our end.. something is wrong with your code." Upload the code to new server and it just worked. Hum?
Over the past 6+ years I have had nothing but head aches dealing with godaddy. Their normal solution is found in the next pay package, or it isn't their problem in the first place.
We had issues sending emails out from PHP. This was a big one. 5+ years of dealing with it. Sometimes they got the email, sometimes they didn't. Looked around the net, use a php mailer plug in. Same problem. Tweaked sent froms and return's to. Same thing. Years of godaddy saying they are setup right. Guess what! Nope! Found out they had a setting hidden deep in the horrid control panels that tweaked something I don't even know what and that seemed like a fix. Nope. So we start doing an in depth look at our server reputation and logging the ip's emails came from. Testing those IP's to see if they were black listed showed us that yes some of them were black listed. We send maybe 25 emails out a month? All legit, clean. But shared server so, someone did it. GoDaddy said there was nothing they could or would do about it. That's right! Their server's were blacklisted, shucks!
My last 2 clients on godaddy are making the switch. Soon I will be godaddy free and will strongly recommend new clients away.
Sorry that this was a big long BLAH of garbage. Thank you for listening. I feel better now.
For the first time in my life, I can't open a webpage with curl: $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); //curl_setopt($ch, CURLOPT_SSLVERSION, 3); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.02; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).'/godaddycokie.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__).'/godaddycokie.txt'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $url = 'https://auctions.godaddy.com'; curl_setopt($ch, CURLOPT_REFERER, $url); echo curl_exec($ch); Any clues? Some Javascript trick?! Is there a PHP "API" that can connect to GoDaddy, list domains, change the dns and whois? Possibly add new domains? I highly doubt it, and if not, I'll start writing one. However, GoDaddy uses what must be the worst HTML code EVER. WHO THE @$%^ uses javascript FOR EVERY LINK. That is just plain unnecessary. And I have a feeling GoDaddy wouldn't like such an API, and would make any attempt to break it Thanks Hello, I have a script that will resize all images in a directory.. the script functions properly on my normal hosting (through hostgator) but when I try to run the script on a GoDaddy site, the script will only get about half way done and then just stop without any errors. I've checked the max_execution_time and it's set to 90 but the script seems to stop after around 25 seconds. I wrote another script that was just a for loop with sleep(1) to run 90 times and it did without any issues.. I was thinking it was a memory error but I don't get any fatal errors saying so... I know its something to do with the config of GoDaddy but I can't figure out the exact cause. the server does have PHP5 installed and the only error i can even get to throw through the GoDaddy logs is a warning about ./json.so not being able to load.. Can anyone think of anything off the top of their head that could cause this to happen only on GoDaddy? this is the gist of the function but its been modified a tiny bit... (only filenames that are created etc) <?php // The file $filename = 'test.jpg'; // Set a maximum height and width $width = 200; $height = 200; // Content type header('Content-type: image/jpeg'); // Get new dimensions list($width_orig, $height_orig) = getimagesize($filename); $ratio_orig = $width_orig/$height_orig; if ($width/$height > $ratio_orig) { $width = $height*$ratio_orig; } else { $height = $width/$ratio_orig; } // Resample $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); // Output imagejpeg($image_p, null, 100); ?> thanks! Hi I've created my website, I'm hosting it on Godaddy but my email doesn't work at all, it shows the errors so it looks like it works and the mail has been sent, but i don't get any emails at all. I used different emails, one from Gmail and one from Godaddy. I've been loking for the solution for that for last few days... can you help, please? Hello, I am new. I have created a very simple webpage that has content the changes when a link is clicked. The site works perfectly on my "localhost". I am running Apache 2.2 and PHP 5.3 on localhost. When I upload to my GoDaddy shared hosting, ( I beleive Apahe 1.3 and PHP 5.2) my "index.php" displays fine on load. However, when any of the links are clicked the content area where it is supposed to change disapeears. Here is a sample of the code that I am using: // These are the links in the index.php html code... <li><a href="index.php?id='home'" id="home" name="home">Home</a></li> <li><a href="index.php?id='form'" id="form" name="form">Register</a></li> <?php include("form1.php"); getPage(); ?> html.... Then on the form1.php page is the following code... function getPage() { $linkID = $_GET['id']; if ($linkID == NULL) { changeBool("'home'"); } else changeBool($linkID); } //end example The function "changeBool()" has a switch structure that is determined by the $_GET[] var. I beleive this has something to do with the php.ini settings, possibly the apache settings...any ideas would be greatly appreciated. Hi I was wondering if anybody could help me. I have used this form script on other hosting packages and it work well however I can not get it to work on Godaddy. I have not written the script i got it off the web and therefore i am having trouble implementing the advise from Godaddy. "It appears that the form in question allows you to define the To address for the message, but that in most cases the From address is designated as the email address entered by the party submitting the form. For anti-spam purposes, emails using a major provide as the From address (e.g. @hotmail, @gmail, @yahoo, etc) will often be rejected. As a result, we recommend that the From address for your message be a dedicated address utilizing your hosted domain; for example, contactform@your-directories.com. We recommend that you update your configuration to use a defined From address as previous indicated in order to resolve the issues which you are encountering" I guess what I am asking for is a fairy godmother/father to look at my code and tell me what I need to do to make it work. If anybody can help me I would be really greatful as I have been trying to make this work for day. Thanks for your time Kelly Code: [Select] <?php // ------------- CONFIGURABLE SECTION ------------------------ $mailto = 'kpayne@your-directories.com' ; $subject = "ContactForm" ; $formurl = "http://www.your-directories.com/contact.html" ; $thankyouurl = "http://www.your-directories.com/Forms/Thankyoucontact.html" ; $errorurl = "http://www.your-directories.com/Forms/Errorcontact.html" ; $email_is_required = 1; $name_is_required = 1; $comments_is_required = 1; $uself = 0; $use_envsender = 1; $use_sendmailfrom = 1; $smtp_server_win = '' ; $use_webmaster_email_for_from = 1; $use_utf8 = 1; $my_recaptcha_private_key = '' ; // -------------------- END OF CONFIGURABLE SECTION --------------- define( 'MAX_LINE_LENGTH', 998 ); $headersep = (!isset( $uself ) || !$uself) ? "\r\n" : "\n" ; $content_type = (!isset( $use_utf8 ) || ($use_utf8 == 0)) ? 'Content-Type: text/plain; charset="iso-8859-1"' : 'Content-Type: text/plain; charset="utf-8"' ; if (!isset( $use_envsender )) { $use_envsender = 0 ; } if (isset( $use_sendmailfrom ) && $use_sendmailfrom) { ini_set( 'sendmail_from', $mailto ); } if (isset( $smtp_server_win ) && strlen($smtp_server_win)) { ini_set( 'SMTP', $smtp_server_win ); } $envsender = "-f$mailto" ; $fullname = (isset($_POST['fullname']))? $_POST['fullname'] : $_POST['name'] ; $phone = $_POST['phone'] ; $email = $_POST['email'] ; $department = $_POST['department'] ; $comments = $_POST['comments'] ; $http_referrer = getenv( "HTTP_REFERER" ); if (!isset($_POST['email'])) { header( "Location: $formurl" ); exit ; } if (($email_is_required && (empty($email) || !preg_match('/@/', $email))) || ($name_is_required && empty($fullname)) || ($comments_is_required && empty($comments))) { header( "Location: $errorurl" ); exit ; } if ( preg_match( "/[\r\n]/", $fullname ) || preg_match( "/[\r\n]/", $email ) ) { header( "Location: $errorurl" ); exit ; } if (strlen( $my_recaptcha_private_key )) { require_once( 'recaptchalib.php' ); $resp = recaptcha_check_answer ( $my_recaptcha_private_key, $_SERVER['REMOTE_ADDR'], $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field'] ); if (!$resp->is_valid) { header( "Location: $errorurl" ); exit ; } } if (empty($email)) { $email = $mailto ; } $fromemail = (!isset( $use_webmaster_email_for_from ) || ($use_webmaster_email_for_from == 0)) ? $email : $mailto ; if (function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc()) { $comments = stripslashes( $comments ); } $messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n" . "------------------------------------------------------------\n" . "Name of Sender: $fullname\n" ."------------------------------------------------------------\n" . "Phone Number of Sender: $phone\n" ."------------------------------------------------------------\n" . "Email of sender: $email\n" ."------------------------------------------------------------\n" . "For the Attention of Department: $department\n" . "------------------------- COMMENTS -------------------------\n\n" . "------------------------------------------------------------\n" . "------------------------------------------------------------\n" . wordwrap( $comments, MAX_LINE_LENGTH, "\n", true ) . "\n\n------------------------------------------------------------\n" ; $headers = "From: \"$fullname\" <$fromemail>" . $headersep . "Reply-To: \"$fullname\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.16.1" . $headersep . 'MIME-Version: 1.0' . $headersep . $content_type ; if ($use_envsender) { mail($mailto, $subject, $messageproper, $headers, $envsender ); } else { mail($mailto, $subject, $messageproper, $headers ); } header( "Location: $thankyouurl" ); exit ; ?> MOD EDIT: [code] . . . [/code] tags added. Hey guys, bit of a newb here. But I am having a brutal time trying to get the php mail() function to work with GoDaddy. I contacted them and they said I must use their PHP gdform.php script to send out emails. My script sends the emails from register.php and functions.php. Does anyone know how I can integrate godaddy's gdform.php to work with my functions.php mail() script. Doesn't make sense to me my go daddy makes this so difficult to use a simple function. Thanks in advance!!! My register.php script Code: [Select] <?php include ('config.inc.php'); include ('functions.php'); // Those two files can be included only if INCLUDE_CHECK is defined session_name('wkLogin'); // Starting the session session_set_cookie_params(2*7*24*60*60); // Making the cookie live for 2 weeks session_start(); if($_SESSION['id'] && !isset($_COOKIE['wkRemember']) && !$_SESSION['rememberMe']) { // If you are logged in, but you don't have the wkRemember cookie (browser restart) // and you have not checked the rememberMe checkbox: $_SESSION = array(); session_destroy(); // Destroy the session } if(isset($_GET['logoff'])) { $_SESSION = array(); session_destroy(); header("Location: tester.php"); exit; } if($_POST['submit']=='Login') { // Checking whether the Login form has been submitted $err = array(); // Will hold our errors if(!$_POST['username'] || !$_POST['password']) $err[] = 'All the fields must be filled in!'; if(!count($err)) { $_POST['username'] = mysql_real_escape_string($_POST['username']); $_POST['password'] = mysql_real_escape_string($_POST['password']); $_POST['rememberMe'] = (int)$_POST['rememberMe']; // Escaping all input data $row = mysql_fetch_assoc(mysql_query("SELECT id,usr FROM wk_members WHERE usr='{$_POST['username']}' AND pass='".md5($_POST['password'])."'")); if($row['usr']) { // If everything is OK login $_SESSION['usr']=$row['usr']; $_SESSION['id'] = $row['id']; $_SESSION['rememberMe'] = $_POST['rememberMe']; // Store some data in the session setcookie('wkRemember',$_POST['rememberMe']); } else $err[]='Wrong username and/or password!'; } if($err) $_SESSION['msg']['login-err'] = implode('<br />',$err); // Save the error messages in the session header("Location: tester.php"); exit; } else if($_POST['submit']=='Register') { // If the Register form has been submitted $err = array(); if(strlen($_POST['username'])<4 || strlen($_POST['username'])>32) { $err[]='Your username must be between 3 and 32 characters!'; } if(preg_match('/[^a-z0-9\-\_\.\@]+/i',$_POST['username'])) { $err[]='Your username contains invalid characters!'; } if(!checkEmail($_POST['email'])) { $err[]='Your email is not valid!'; } if(!count($err)) { // If there are no errors $pass = substr(md5($_SERVER['REMOTE_ADDR'].microtime().rand(1,100000)),0,6); // Generate a random password $_POST['email'] = mysql_real_escape_string($_POST['email']); $_POST['username'] = mysql_real_escape_string($_POST['username']); // Escape the input data mysql_query(" INSERT INTO wk_members(usr,pass,email,regIP,dt) VALUES( '".$_POST['username']."', '".md5($pass)."', '".$_POST['email']."', '".$_SERVER['REMOTE_ADDR']."', NOW() )"); if(mysql_affected_rows($link)==1) { send_mail( 'noreply@mygodaddydomain.com', $_POST['email'], 'Registration System Demo - Your New Password', 'Your password is: '.$pass); $_SESSION['msg']['reg-success']='We sent you an email with your new password!'; } else $err[]='This username is already taken!'; } if(count($err)) { $_SESSION['msg']['reg-err'] = implode('<br />',$err); } header("Location: tester.php"); exit; } $script = ''; if($_SESSION['msg']) { // The script below shows the sliding panel on page load $script = ' <script type="text/javascript"> $(function(){ $("div#panel").show(); $("#toggle a").toggle(); }); </script>'; } ?> My Mail() funtions.php script Code: [Select] <?php function checkEmail($str) { return preg_match("/^[\.A-z0-9_\-\+]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{1,4}$/", $str); } function send_mail($from,$to,$subject,$body) { $headers = ''; $headers .= "From: $from\n"; $headers .= "Reply-to: $from\n"; $headers .= "Return-Path: $from\n"; $headers .= "Message-ID: <" . md5(uniqid(time())) . "@" . $_SERVER['SERVER_NAME'] . ">\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Date: " . date('r', time()) . "\n"; mail($to,$subject,$body,$headers); } ?> Godaddys gdform.php Code: [Select] <?php $request_method = $_SERVER["REQUEST_METHOD"]; if($request_method == "GET") { $query_vars = $_GET; } elseif ($request_method == "POST") { $query_vars = $_POST; } reset($query_vars); $t = date("U"); $file = $_SERVER['DOCUMENT_ROOT'] . "\ssfm\gdform_" . $t; $fp = fopen($file,"w"); while (list ($key, $val) = each ($query_vars)) { fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\r\n"); fputs($fp,"$val\r\n"); fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\r\n"); if ($key == "redirect") { $landing_page = $val; } } fclose($fp); if ($landing_page != "") { header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page"); } else { header("Location: http://".$_SERVER["HTTP_HOST"]."/"); } ?> Just a basic email test gives me this error: Warning: mail() [function.mail]: Failed to connect to mailserver at "relay-hosting.secureserver.net" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\hosting\7746358\html\testmail.php on line 7 Mail Sent. mailtest.php Code: [Select] <?php $to = "someone@domain.com"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "noreply@mygodaddydomain.com"; $headers = "From:" . $from; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?> Hello, I have been working on my website lateley and realized that godaddy only allows a 1000 email limit. I am sure this will be fine when the site first launches but if I get more and more users it will cause some issues. How can I fix this? Is there like a function that can bypass this or something??? Thanks in advance :-) |