PHP - Phpmailer Won't Send To Gmail, Yahoo, Etc. (but Will Send To Local Domain Addys)
I am working on a phpmailer script that sends an order confirmation email to the customer AND the client at the same time. If I have the customer email and client email set both to the originating domain's email addresses (myname@myserver.com), then it sends fine. However, if I try to send to an outside mail server (eg. someone@gmail.com), I get the following errors:
Code: [Select] SMTP -> FROM SERVER:220 myserver.com ESMTP Exim 4.63 Sat, 18 Sep 2010 15:08:21 -0700 SMTP -> FROM SERVER: 250 myserver.com Hello localhost [127.0.0.1] 250-SIZE 52428800 250-PIPELINING 250-AUTH LOGIN PLAIN 250-STARTTLS 250 HELP SMTP -> FROM SERVER:250 OK SMTP -> FROM SERVER:250 Accepted SMTP -> FROM SERVER: SMTP -> ERROR: RCPT not accepted from server: SMTP Error: The following recipients failed: someone@gmail.com Message could not be sent. Mailer Error: SMTP Error: The following recipients failed: someone@gmail.com SMTP server error: I'm not sure what's going on here. Any SMTP or phpmailer geniuses here that can shed some light on what needs to happen here for this to send to any address? Similar TutorialsAlright so I have 3 pages. Signup, Password reset and Send message. All three pages/forms email to the recipient.
So far my test have only been with hotmail and gmail.
All emails go through for hotmail accounts. They show up in the hotmail.
All emails DO go through for gmail accounts. But they don't show up in the gmail. The only page that gmail is able to receive emails from is "send message". The emails derived from that send message show up in gmail. The other two don't.
There are not errors on the server side that show up. It clearly shows emails being sent.
Does anyone have a clue why this is happening?
Edited by man5, 23 August 2014 - 03:48 PM. Hi every one I've downloaded some classes but they weren't work . How do I send a private message? thanks Dear all, I am using PHPMailer to send notification emails after someone submits the form and as a result I'm receiving an email which has only one line: "A new user has been registered to your website". What I want is to receive an HTML email (in a table format) with all the data in it. Data Field Date January 3, 2010 Name: Aaaaa Surname: BBbbb... Email: test@email.com Gender: male .... .... Which code do I need to add in my thanks.php file in order to do this. After filling all the data in www.domain.com/apply.php, it automatically directs the user to thanks.php file Here is my code (thanks.php): <?php require_once("phpMailer/class.phpmailer.php"); require_once("phpMailer/class.smtp.php"); require_once("phpMailer/language/phpmailer.lang-en.php"); $to_name = "My Website"; $to = "email@mydomain.com"; $subject = "A new user has been registered to my website"; $message = "A new user has been registered to my website"; $message = wordwrap($message,70); $from_name = "My Website"; $from = "email@mydomain.com"; //PHP SMTP version $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "mail.website.org"; $mail->Port =25; $mail->SMTPAuth = false; $mail->Username = "username"; $mail->Password = "password"; $mail->FromName = $from_name; $mail->From = $from; $mail->AddAddress($to, $to_name); $mail->Subject = $subject; $mail->Body =<<<EMAILBODY A new user has been registered to my website. EMAILBODY; $result = $mail->Send(); echo $result ? 'Thanks for your registering...' : 'Error'; ?> i want to send email to multiple user.this is my code: I am looking for a script that is used in Facebook. Wherein, user enters the email address and password and the system will automatically fetch the addresses from the address book of Hotmail or Gmail etc and sends invitation to join the site network. Do you have any link for such a script that comes free. Looking forward to that. Thanks, Faisal I have phpmailer on a website and after clicking send, it goes to the forms action page and don't seem to redirect to the enquiry confirmation page, the forms action page is a blank white page which am guessing is correct as it's PHP coding but thought it should redirect. I don't get any errors showing what the issue is. I have the phpmailer uploaded onto the FTP server and has the class.phpmailer.php file inside the phpmailer folder. The client has their email going through office365. Below is the code I have + <?php ini_set('display_errors', '1'); ini_set('display_startup_errors', '1'); error_reporting(E_ALL); //index.php $error = ''; $name = ''; $email = ''; $subject = ''; $message = ''; function clean_text($string) { $string = trim($string); $string = stripslashes($string); $string = htmlspecialchars($string); return $string; } if(isset($_POST["submit"])) { if(empty($_POST["name"])) { $error .= '<p><label class="text-danger">Please Enter your Name</label></p>'; } else { $name = clean_text($_POST["name"]); if(!preg_match("/^[a-zA-Z ]*$/",$name)) { $error .= '<p><label class="text-danger">Only letters and white space allowed</label></p>'; } } if(empty($_POST["email"])) { $error .= '<p><label class="text-danger">Please Enter your Email</label></p>'; } else { $email = clean_text($_POST["email"]); if(!filter_var($email, FILTER_VALIDATE_EMAIL)) { $error .= '<p><label class="text-danger">Invalid email format</label></p>'; } } if(empty($_POST["subject"])) { $error .= '<p><label class="text-danger">Subject is required</label></p>'; } else { $subject = clean_text($_POST["subject"]); } if(empty($_POST["message"])) { $error .= '<p><label class="text-danger">Message is required</label></p>'; } else { $message = clean_text($_POST["message"]); } if($error == '') { require 'phpmailer/class.phpmailer.php'; $mail = new PHPMailer; $mail->SMTPDebug = 2; $mail->IsSMTP(); //Sets Mailer to send message using SMTP $mail->Host = 'smtp.office365.com'; //Sets the SMTP hosts $mail->Port = '587'; //Sets the default SMTP server port $mail->SMTPSecure = 'tls'; //Sets connection prefix. Options are "", "ssl" or "tls" $mail->SMTPAuth = true; //Sets SMTP authentication. Utilizes the Username and Password variables $mail->Username = 'email@domain.co.uk'; //Sets SMTP username $mail->Password = 'password'; //Sets SMTP password $mail->From = $_POST["email"]; //Sets the From email address for the message $mail->FromName = $_POST["name"]; //Sets the From name of the message $mail->AddAddress('email@domain.co.uk', 'Name');//Adds a "To" address $mail->AddCC($_POST["email"], $_POST["name"]); //Adds a "Cc" address $mail->WordWrap = 50; //Sets word wrapping on the body of the message to a given number of characters $mail->IsHTML(true); //Sets message type to HTML $mail->Subject = "New Website Enquiry"; //Sets the Subject of the message $mail->Body = "Name: " . $_POST["name"] . "<br><br>" . "Email: " . $_POST["email"] . "<br><br>" . "Subject: " . $_POST["subject"] . "<br><br>" . "Message: " . "<br>" . $_POST["message"]; //An HTML or plain text message body if (!$mail->Send()) //Send an Email. Return true on success or false on error { header('Location: https://www.domain.co.uk/enquiry-confirmation.php'); } else { $error = '<label class="text-danger">There is an Error</label>'; } $name = ''; $email = ''; $subject = ''; $message = ''; } } ?>
I have an auctions website and I want to create a feature that is similar to ebay in which users will receive an email if one of the auctions they are watching will end in less than 3 hours. I will be using a cron job to call up this page every 15 minutes. When the cron job executes, I would like it to send 1 email per auction to every user that has that auction on their watchlist if the auction will be ending in 3 hours. I don't know whether it needs to be a separate email for each user or one mass email where their emails are hidden. The 4 tables in my database we are concerned about are "auctions, "users, "watchlists" and "products." I am trying to use the script phpMailer to execute the code because I heard it was the best one. Anways here is what I have so far. I am missing alot because I had no clue what to do. <?php require("class.phpmailer.php"); $holder = mysql_connect("localhost", "user", "password"); mysql_select_db("database", $holder); // NEED TO FIX THIS // Need to get ALL of the auction id's where the end time is less than 3 hours and the notification hasn't already been sent // $auctionid = mysql_query("SELECT id FROM auctions WHERE DATE_ADD(NOW(), INTERVAL 3 HOUR) <= end_time AND notification = 0", $holder); // get the auction title of EACH of the auctions selected above which is not stored in the auctions table but in the products table..will be used for body of email /// AGAIN, NEED THIS TO GET ME ALL OF THE NAMES OF AUCTIONS THAT ARE ENDING IN 3 HOURS// $auctiontitle = mysql_query("SELECT name FROM products LEFT JOIN auctions ON auctions.product_id=products.id WHERE auctions.id = $auctionid", $holder); // PROBABLY NEED TO FIX THIS // Need to get ALL of the email addresses who have ANY of the above auction ids on their watchlist // $email = mysql_query("SELECT email FROM users LEFT JOIN watchlists ON users.id=watchlists.user_id WHERE watchlists.auction_id = $auctionid", $holder); // Update the auctions table. Turn notification to 1 so the notification for that auction can't be sent again // AGAIN NEED THIS FOR ALL OF THE AUCTIONS ENDING IN 3 HOURS // $query1="UPDATE auctions SET notification = '1' WHERE id = '$auctionid'"; mysql_query($query1) or die(mysql_error()); $mail = new PHPMailer(); $mail->From = "no-reply@domain.com"; $mail->FromName = "Site Name"; // Getting and error message for the foreach but I saw a similar example and this is what I was told to do // NEED THIS TO ADD EACH OF THE EMAIL ADDRESSES INDIVIDUALLY // foreach ( $email as $recipients ) { $mail->AddAddress ($recipients); } $mail->WordWrap = 50; // set word wrap to 50 characters $mail->IsHTML(true); // set email format to HTML $mail->Subject = "Your Watched Auction is Ending Soon"; // Sample Body // WANT TO DISPLAY THE TITLE OF THE AUCTION (NAME OF PRODUCT) FOR THE AUCTION ID USING $auctiontile FROM ABOVE // $mail->Body = "Your auction titled $auctiontile is ending soon"; // Same as above // $mail->AltBody = Your auction titled $auctiontile is ending soon"; if(!$mail->Send()) { echo "Message could not be sent."; echo "Mailer Error: " . $mail->ErrorInfo; exit; } echo "Message has been sent"; ?> This topic has been moved to Other Web Server Software. http://www.phpfreaks.com/forums/index.php?topic=347283.0 Hi, For about a month, I have been trying to figure out why my code will not return anything after posting a wwwForm (I have also tried the newer equivalent of this function but I had no luck with that either.) The nameField and passwordField are taken from text boxes within the game and the code used in my login script is copied and pasted from a Register script but I have changed the file location to the login.php file. The register script works fine and I can add new users to my database but the login script only outputs "Form Sent." and not the "present" that should return when the form is returned and it never gets any further than that point meaning that it lets the user through with no consequence if they use an invalid name because the script never returns an answer. What should I do to fix this? Thanks, Unity Code: using System.Collections; using UnityEngine; using UnityEngine.UI; using UnityEngine.Networking; public class Login : MonoBehaviour { public InputField nameField; public InputField passwordField; public Button acceptSubmissionButton; public void CallLogInCoroutine() { StartCoroutine(LogIn()); } IEnumerator LogIn() { WWWForm form = new WWWForm(); form.AddField("username", nameField.text); form.AddField("password", passwordField.text); WWW www = new WWW("http://localhost/sqlconnect/login.php", form); Debug.Log("Form Sent."); yield return www; Debug.Log("Present"); if (www.text[0] == '0') { Debug.Log("Present2"); DatabaseManager.username = nameField.text; DatabaseManager.score = int.Parse(www.text.Split('\t')[1]); Debug.Log("Log In Success."); } else { Debug.Log("User Login Failed. Error #" + www.text); } } public void Validation() { acceptSubmissionButton.interactable = nameField.text.Length >= 7 && passwordField.text.Length >= 8; } } login.php: <?php echo "Test String2"; $con = mysqli_connect('localhost', 'root', 'root', 'computer science coursework'); // check for successful connection. if (mysqli_connect_errno()) { echo "1: Connection failed"; // Error code #1 - connection failed. exit(); } $username = mysqli_escape_string($con, $_POST["username"]); $usernameClean = filter_var($username, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH); $password = $_POST["password"]; if($username != $usernameClean) { echo "7: Illegal Username, Potential SQL Injection Query. Access Denied."; exit(); } // check for if the name already exists. $namecheckquery = "SELECT username, salt, hash, score FROM players WHERE username='" . $usernameClean . "';"; $namecheck = mysqli_query($con, $namecheckquery) or die("2: Name check query failed"); // Error code # 2 - name check query failed. if (mysqli_num_rows($namecheck) != 1) { echo "5: No User With Your Log In Details Were Found Or More Than One User With Your Log In Details Were Found"; // Error code #5 - other than 1 user found with login details exit(); } // get login info from query $existinginfo = mysqli_fetch_assoc($namecheck); $salt = $existinginfo["salt"]; $hash = $existinginfo["hash"]; $loginhash = crypt($password, $salt); if ($hash != $loginhash) { echo "6: Incorrect Password"; // error code #6 - password does not hash to match table exit; } echo "Test String2"; echo"0\t" . $existinginfo["score"]; ?>
Hi, I'm trying to setup a quick PHP script that will grab the email from the url (see below) and after inserting into MySQL db - which is working fine - the script will complete two additional tasks: 1. send that same captured email out to a external db as in shown via http://domain1.com/insert.php?email=$lead (example), but then send to a DIFFERENT source - the originator of the lead - a portback acknowledgement using Header (sending the status and email to http://domain2.com/check.php?e=$lead&s=$status for their records). See the code below: ------------------------- Code: [Select] $lead = $_REQUEST['e_mail']; // will grab email from posted url string and assign to local variable $result = mysql_query($command); // this is just to execute the MySQL insert which works just fine but included here to explain validation below // Create API Call string to insert lead into iContact folder $requestURL = "http://domain1.com/insert.php?email=$lead"; // Execute API Call to CAKE $xml = simplexml_load_file($requestURL) or die("feed not loading"); if ($result) { $status = 1; // mark lead as sucess // send postback on lead status header("Location: http://domain2.com/check.php?e=$lead&s=$status"); } -------- Problem: I'm getting all sorts of errors with the simplexml_load_file() function and can't figure out why it won't work. Any input appreciated as this the only way I know how to pass the lead onward and then inform/update the other party of receipt of information. thanks! I'm using a simple form to grab an email address and send the person who signs up and automatic response. It was working for a while and now it's not. Not sure what happened. My hosting company told me to look into my headers. Can anyone help? Here is my code. Thanks, Code: [Select] <?php /* Set e-mail recipient */ $subject = "Sign Up"; $headers = "From: admin@xxx.com" . "\r\n" . "CC: admin@xxx.com"; /* Check all form inputs using check_input function */ $sign_up_email_address = check_input($_POST['sign_up_email_address'], "Please enter your email address."); /* If e-mail is not valid show error message */ if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $sign_up_email_address)) { show_error("E-mail address not valid"); } /* Let's prepare the message for the e-mail */ $response_message = "Sample Message"; /* Send the message using mail() function */ mail($sign_up_email_address, $subject, $response_message, $headers); /* Functions we used */ function check_input($data, $problem='') { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); if ($problem && strlen($data) == 0) { show_error($problem); } return $data; } function show_error($myError) { ?> <?php echo $myError; ?> Thank you, I have successfully used the Yahoo local search API and received results in XML format. I am trying to use PHPs Simple XML to parse the data into an array so I can loop through and print specific elements. I cannot get to specific elements and I have read several threads online. Below is some code and below that is the XML. I am trying to get to the elements like title, address, etc. Code: [Select] $url = 'http://local.yahooapis.com/LocalSearchService/V3/localSearch?appid=<my yahoo api key>&category=Casinos&query=blackjack&zip=95035&radius=20&results=10'; $xml = file_get_contents($url); $phpobject = simplexml_load_string($xml); foreach($phpobject->attributes() as $name=>$attr) { $res[$name]=$attr; } Code: [Select] <ResultSet xsi:schemaLocation="urn:yahoo:lcl http://local.yahooapis.com/LocalSearchService/V3/LocalSearchResponse.xsd" totalResultsAvailable="48" totalResultsReturned="10" firstResultPosition="1"> − <ResultSetMapUrl> http://maps.yahoo.com/broadband/?q1=Milpitas%2C+CA+95035&tt=poker&tp=1 </ResultSetMapUrl> − <Result id="34179399"> <Title>Bay Area Poker Chip</Title> <Address>1274 Piper Dr</Address> <City>Milpitas</City> <State>CA</State> <Phone>(408) 263-8611</Phone> <Latitude>37.412359</Latitude> <Longitude>-121.891794</Longitude> − <Rating> <AverageRating>5</AverageRating> <TotalRatings>1</TotalRatings> <TotalReviews>1</TotalReviews> <LastReviewDate>1198993183</LastReviewDate> − <LastReviewIntro> I bought 100% real clay chips from here and obsolutely love it. I had a poker game that night and needed chips and a table. They had everything in stock and saved me time to look around. Great products and great service and I highly recommend this place to anybody </LastReviewIntro> </Rating> <Distance>1.33</Distance> − <Url> http://local.yahoo.com/info-34179399-bay-area-poker-chip-milpitas </Url> − <ClickUrl> http://local.yahoo.com/info-34179399-bay-area-poker-chip-milpitas </ClickUrl> − <MapUrl> http://maps.yahoo.com/maps_result?q1=1274+Piper+Dr+Milpitas+CA&gid1=34179399 </MapUrl> <BusinessUrl>http://bayareapokerchip.com/</BusinessUrl> <BusinessClickUrl>http://bayareapokerchip.com/</BusinessClickUrl> − <Categories> <Category id="96928631">Graphic Design</Category> </Categories> </Result> − <Result id="44540748"> <Title>Bay Area Poker Chip</Title> <Address>519 Montague Expy</Address> <City>Milpitas</City> <State>CA</State> <Phone>(408) 263-8611</Phone> <Latitude>37.409925</Latitude> <Longitude>-121.89489</Longitude> − <Rating> <AverageRating>NaN</AverageRating> <TotalRatings>0</TotalRatings> <TotalReviews>0</TotalReviews> <LastReviewDate/> <LastReviewIntro/> </Rating> <Distance>1.48</Distance> − <Url> http://local.yahoo.com/info-44540748-bay-area-poker-chip-milpitas </Url> − <ClickUrl> http://local.yahoo.com/info-44540748-bay-area-poker-chip-milpitas </ClickUrl> − <MapUrl> http://maps.yahoo.com/maps_result?q1=519+Montague+Expy+Milpitas+CA&gid1=44540748 </MapUrl> <BusinessUrl>http://www.bayareapokerchip.com/</BusinessUrl> <BusinessClickUrl>http://www.bayareapokerchip.com/</BusinessClickUrl> − <Categories> <Category id="96925976">Sporting Goods</Category> <Category id="96935378">Games</Category> </Categories> </Result> − <Result id="67710717"> <Title>Poker Da Vinci</Title> <Address>51 E Campbell Ave</Address> <City>Campbell</City> <State>CA</State> <Phone>(408) 866-4446</Phone> <Latitude>37.287157</Latitude> <Longitude>-121.94942</Longitude> − <Rating> <AverageRating>NaN</AverageRating> <TotalRatings>0</TotalRatings> <TotalReviews>0</TotalReviews> <LastReviewDate/> <LastReviewIntro/> </Rating> <Distance>10.40</Distance> − <Url> http://local.yahoo.com/info-67710717-poker-da-vinci-campbell </Url> − <ClickUrl> http://local.yahoo.com/info-67710717-poker-da-vinci-campbell </ClickUrl> − <MapUrl> http://maps.yahoo.com/maps_result?q1=51+E+Campbell+Ave+Campbell+CA&gid1=67710717 </MapUrl> <Categories/> </Result> − <Result id="21599986"> <Title>Bay 101 Banquet Facilities</Title> <Address>1801 Bering Dr</Address> <City>San Jose</City> <State>CA</State> <Phone>(408) 451-8888</Phone> <Latitude>37.373044</Latitude> <Longitude>-121.912125</Longitude> − <Rating> <AverageRating>4</AverageRating> <TotalRatings>2</TotalRatings> <TotalReviews>2</TotalReviews> <LastReviewDate>1200040214</LastReviewDate> − <LastReviewIntro> If youre looking for high limit action Bay 101 is the place to go in San Jose. You can regularly find limit games up to $80-$160 in their spacious high ceiling room. </LastReviewIntro> </Rating> <Distance>4.13</Distance> − <Url> http://local.yahoo.com/info-21599986-bay-101-banquet-facilities-san-jose </Url> − <ClickUrl> http://local.yahoo.com/info-21599986-bay-101-banquet-facilities-san-jose </ClickUrl> − <MapUrl> http://maps.yahoo.com/maps_result?q1=1801+Bering+Dr+San+Jose+CA&gid1=21599986 </MapUrl> <BusinessUrl>http://bay101.com/</BusinessUrl> <BusinessClickUrl>http://bay101.com/</BusinessClickUrl> − <Categories> <Category id="96929273">Casinos</Category> </Categories> </Result> − <Result id="21401964"> <Title>Thwart Poker Incorporated</Title> <Address>525 Lincoln Ave</Address> <City>Palo Alto</City> <State>CA</State> <Phone>(650) 329-9627</Phone> <Latitude>37.444049</Latitude> <Longitude>-122.151513</Longitude> − <Rating> <AverageRating>NaN</AverageRating> <TotalRatings>0</TotalRatings> <TotalReviews>0</TotalReviews> <LastReviewDate/> <LastReviewIntro/> </Rating> <Distance>14.09</Distance> − <Url> http://local.yahoo.com/info-21401964-thwart-poker-incorporated-palo-alto </Url> − <ClickUrl> http://local.yahoo.com/info-21401964-thwart-poker-incorporated-palo-alto </ClickUrl> − <MapUrl> http://maps.yahoo.com/maps_result?q1=525+Lincoln+Ave+Palo+Alto+CA&gid1=21401964 </MapUrl> − <Categories> <Category id="96926908">Internet Access Providers</Category> <Category id="96932773">Computer Business Solutions</Category> </Categories> </Result> − <Result id="21574436"> <Title>Blinky's Can't Say Lounge</Title> <Address>1031 Monroe St</Address> <City>Santa Clara</City> <State>CA</State> <Phone>(408) 985-7201</Phone> <Latitude>37.348893</Latitude> <Longitude>-121.94816</Longitude> − <Rating> <AverageRating>5</AverageRating> <TotalRatings>3</TotalRatings> <TotalReviews>3</TotalReviews> <LastReviewDate>1228667811</LastReviewDate> − <LastReviewIntro> Good drinks good prices good people. Who could ask for more..... </LastReviewIntro> </Rating> <Distance>6.39</Distance> − <Url> http://local.yahoo.com/info-21574436-blinky-s-can-t-say-lounge-santa-clara </Url> − <ClickUrl> http://local.yahoo.com/info-21574436-blinky-s-can-t-say-lounge-santa-clara </ClickUrl> − <MapUrl> http://maps.yahoo.com/maps_result?q1=1031+Monroe+St+Santa+Clara+CA&gid1=21574436 </MapUrl> − <Categories> <Category id="96926057">All Bars, Pubs, & Clubs</Category> <Category id="96926063">Bars & Pubs</Category> </Categories> </Result> − <Result id="21619987"> <Title>Barbara of Pauline's Cake Decorating Supplies</Title> <Address>1093 Malone Rd</Address> <City>San Jose</City> <State>CA</State> <Phone>(408) 978-9740</Phone> <Latitude>37.293702</Latitude> <Longitude>-121.889876</Longitude> − <Rating> <AverageRating>4.5</AverageRating> <TotalRatings>8</TotalRatings> <TotalReviews>8</TotalReviews> <LastReviewDate>1268173462</LastReviewDate> − <LastReviewIntro> I love this store. No matter what it is i am looking for weather it is some thing i remember from my child hood or some thing i saw in a magazine and i need it i know i can find it there. Yes they are a little rough around the edges but that is only because they are trying to get it across to you what will work and what will not. This is an old school store with people who know their stuff and are only trying to help you get the best end result possible. I am 46 years old and i took my class from Barbara when i first came out of high school and believe me she will not try to up sale you or tell you some thing is going to work if it will not. Go in expecting to be overwhelmed by stock and know you are going to get the best prices in town. Take the time to get to know the employees and the store and you will always go back to Paulines. I travel all the way from Livermore to get stuff i know i can only find there. Thanks for all your many years of being in business </LastReviewIntro> </Rating> <Distance>9.52</Distance> − <Url> http://local.yahoo.com/info-21619987-barbara-of-pauline-s-cake-decorating-supplies-san-jose </Url> − <ClickUrl> http://local.yahoo.com/info-21619987-barbara-of-pauline-s-cake-decorating-supplies-san-jose </ClickUrl> − <MapUrl> http://maps.yahoo.com/maps_result?q1=1093+Malone+Rd+San+Jose+CA&gid1=21619987 </MapUrl> − <Categories> <Category id="96928859">Wedding Supplies & Services</Category> </Categories> </Result> − <Result id="21602089"> <Title>Carey David Incorporated</Title> <Address>1624 Remuda Ln</Address> <City>San Jose</City> <State>CA</State> <Phone>(408) 453-7843</Phone> <Latitude>37.372385</Latitude> <Longitude>-121.908305</Longitude> − <Rating> <AverageRating>NaN</AverageRating> <TotalRatings>0</TotalRatings> <TotalReviews>0</TotalReviews> <LastReviewDate/> <LastReviewIntro/> </Rating> <Distance>4.13</Distance> − <Url> http://local.yahoo.com/info-21602089-carey-david-incorporated-san-jose </Url> − <ClickUrl> http://local.yahoo.com/info-21602089-carey-david-incorporated-san-jose </ClickUrl> − <MapUrl> http://maps.yahoo.com/maps_result?q1=1624+Remuda+Ln+San+Jose+CA&gid1=21602089 </MapUrl> <BusinessUrl>http://dc-enterprises.com/</BusinessUrl> <BusinessClickUrl>http://dc-enterprises.com/</BusinessClickUrl> − <Categories> <Category id="96928508">Clothing Wholesalers</Category> <Category id="96928509">Clothing Manufacturers</Category> <Category id="96931030">Apparel Manufacturing</Category> </Categories> </Result> − <Result id="30246475"> <Title>Royal Casino Parties</Title> <Address>943 Berryessa Rd, #6</Address> <City>San Jose</City> <State>CA</State> <Phone>(408) 213-0904</Phone> <Latitude>37.363563</Latitude> <Longitude>-121.886341</Longitude> − <Rating> <AverageRating>NaN</AverageRating> <TotalRatings>0</TotalRatings> <TotalReviews>0</TotalReviews> <LastReviewDate/> <LastReviewIntro/> </Rating> <Distance>4.71</Distance> − <Url> http://local.yahoo.com/info-30246475-royal-casino-parties-san-jose </Url> − <ClickUrl> http://local.yahoo.com/info-30246475-royal-casino-parties-san-jose </ClickUrl> − <MapUrl> http://maps.yahoo.com/maps_result?q1=943+Berryessa+Rd%2C+%236+San+Jose+CA&gid1=30246475 </MapUrl> <BusinessUrl>http://www.royalcasinoparties.com/</BusinessUrl> <BusinessClickUrl>http://www.royalcasinoparties.com/</BusinessClickUrl> − <Categories> <Category id="96925812">Entertainment Production</Category> <Category id="96930362">Gambling</Category> </Categories> </Result> − <Result id="25247620"> <Title>Bay Casino Gaming, Casino Party Rentals</Title> <Address/> <City>San Jose</City> <State>CA</State> <Phone>(408) 747-1977</Phone> <Latitude>37.338475</Latitude> <Longitude>-121.885794</Longitude> − <Rating> <AverageRating>NaN</AverageRating> <TotalRatings>0</TotalRatings> <TotalReviews>0</TotalReviews> <LastReviewDate/> <LastReviewIntro/> </Rating> <Distance>6.44</Distance> − <Url> http://local.yahoo.com/info-25247620-bay-casino-gaming-casino-party-rentals-san-jose </Url> − <ClickUrl> http://local.yahoo.com/info-25247620-bay-casino-gaming-casino-party-rentals-san-jose </ClickUrl> − <MapUrl> http://maps.yahoo.com/maps_result?q1=+San+Jose+CA&gid1=25247620 </MapUrl> <BusinessUrl>http://www.baycasinogaming.com/</BusinessUrl> <BusinessClickUrl>http://www.baycasinogaming.com/</BusinessClickUrl> − <Categories> <Category id="96925812">Entertainment Production</Category> <Category id="96925814">Party Rentals</Category> </Categories> </Result> </ResultSet> the second database found on the cloud
i try to get JSON data but how to insert and update them to another online database with the same table my php script to return json data <?php include_once('db.php'); $users = array(); $users_data = $db -> prepare('SELECT id, username FROM users'); $users_data -> execute(); while($fetched = $users_data->fetch()) { $users[$fetchedt['id']] = array ( 'id' => $fetched['id'], 'username' => $fetched['name'] ); } echo json_encode($leaders);
i get
{"1":{"id":1,"username":"jeremia"},"2":{"id":2,"username":"Ernest"}} Edited March 24 by mahenda Hello i need the php send code for this html code if anyone can help me? website url: http://dclxvi.co.uk/htmlform.htm <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="en-GB" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="description" content="A site for contacting a dj to play at an event"/> <meta name="keywords" content="DJ, Decks, AI-disco, AI Disco, Disco"/> <meta name="author" content="Ashley Sargent"/> <link rel="stylesheet" href="stylee.css" type="text/css" /> <title>DCLXVI: Booking</title> </head> <body> <div id="container"> <div id="header"> </div> <div id="navigation"> <div id="navigation"> <ul class="menu"> <div class="left"> <a href="index.html"><img src="imagess/homet.gif" onmouseover="this.src='imagess/homet1.gif'" onmouseout="this.src='imagess/homet.gif'"> <a href="services.html"><img src="imagess/services.jpg" onmouseover="this.src='imagess/services1.jpg'" onmouseout="this.src='imagess/services.jpg'"> <a href="about.html"><img src="imagess/about.jpg" onmouseover="this.src='imagess/about1.jpg'" onmouseout="this.src='imagess/about.jpg'"> <a href="contact.html"><img src="imagess/contact.jpg" onmouseover="this.src='imagess/contact1.jpg'" onmouseout="this.src='imagess/contact.jpg'"> <a href="faq.html"><img src="imagess/faq.jpg" onmouseover="this.src='imagess/faq1.jpg'" onmouseout="this.src='imagess/faq.jpg'"> <a href="gallery.html"><img src="imagess/gallery1.jpg" onmouseover="this.src='imagess/gallery2.jpg'" onmouseout="this.src='imagess/gallery1.jpg'"> <a href="login.php"><img src="imagess/login.jpg" onmouseover="this.src='imagess/login1.jpg'" onmouseout="this.src='imagess/login.jpg'"> <a href=""></a> </div> </div> <br><br><br> <form name="htmlform" method="post" action="html_form_send.php"> <table border="1" bordercolor="0000FF" cellspacing="2" cellpadding="5"> </tr> <U><b>Personal Information:</b></U><BR><BR> <tr> <td valign="top"> <label for="Title">Title *</label> </td> <td valign="top"> <select> <option><selected>--Please Select--</option> <option>Mr</option> <option>Mrs</option> <option>Miss</option> <option>Dr</option> <option>Other</option></select>Other:<INPUT type="text" SIZE="20"> <tr> <td valign="top"> <label for="first_name">First Name *</label> </td> <td valign="top"> <input type="text" name="first_name" maxlength="50" size="30"> </td> </tr> </select> <tr> <td valign="top""> <label for="last_name">Last Name *</label> </td> <td valign="top"> <input type="text" name="last_name" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top"> <label for="email">Email Address *</label> </td> <td valign="top"> <input type="text" name="email" maxlength="80" size="30"> </td> </tr> <tr> <td valign="top"> <label for="telephone">Telephone Number *</label> </td> <td valign="top"> <input type="text" name="telephone" maxlength="30" size="30"> </td> </tr> </tr> </table> <br><br> <table border="1" bordercolor="0000FF" cellspacing="2" cellpadding="5" width="460"> <u><b>Event Information:</b></u><br><br> <tr> <td valign="top"> <label for="occasion">Occasion</label> </td> <td valign="top"> <select> <option><selected>--Please Select--</option> <option>Birthday</option> <option>Wedding</option> <option>Anniversary</option> <option>Party</option> <option>Engagement</option> <option>Valentines</option> </select> <tr> <td valign="top"> <td valign="top"> <input type="checkbox" value="70's">70's<br> <input type="checkbox" value="80's">80's <input type="checkbox" value="90's">90's<br> <input type="checkbox" value="Cheese">Cheese <input type="checkbox" value="Mainstreem">Mainstreem R n B<br> <input type="checkbox" value="House">House <input type="checkbox" value="Dance">Dance<br> <input type="checkbox" value="Garage">Garage <input type="checkbox" value="hiphop">Hip-Hop<br> <input type="checkbox" value="Karaoke">Karaoke <input type="checkbox" value="Other">Other <INPUT type="text" SIZE="6"> </div> </td> </tr> </select> <tr> <td valign="top"> <label for="event_date">Event Date</label> </td> <td valign="top"> <input type="text" name="event_date" maxlength="50" size="30"> </td> </tr> <td valign="top"> <label for="length_of_party">Length of Party</label> </td> <td valign="top"> <select> <option><selected>--Please Select--</option> <option>1 Hour</option> <option>2 Hours</option> <option>3 Hours</option> <option>4 Hours</option> <option>5 Hours</option> <option>Other</option></select>Other:<INPUT type="text" SIZE="10"> </td> </tr> <tr> <td valign="top"> <label for="location">Location</label> </td> <td valign="top"> <input type="text" name="location" maxlength="30" size="30"> </td> </tr> <tr> <td valign="top"> <label for="comments">Comments</label> </td> <td valign="top"> <textarea name="comments" cols="29" rows="5"> Enter your comments here... </textarea> <center><input type="submit" value="Submit" /></center> </td> </tr> </table> I am trying the following code to send SMS. <?php $gatewayURL = 'http://localhost:9333/ozeki?'; $request = 'login=admin'; $request .= '&password=abc123'; $request .= '&action=sendMessage'; $request .= '&messageType=SMS:TEXT'; $request .= '&recepient='.urlencode('+9898989898'); $request .= '&messageData='.urlencode("Hello World"); $url = $gatewayURL . $request; //Open the URL to send the message file($url); ?> But I am getting the following error message. Warning: file(http://localhost:9333/ozeki?login=ad...ta=Hello+World) [function.file]: failed to open stream: Connection refused in /home/vpe/public_html/_demo2/sms/sms2.php on line 13 Please help to rectify my code. Thanks a lot in advance. i would like to send sms using AT Hayes command in php... is it possible? my client changed their mind, and wants a field in the database that toggles to 'printed' if they've printed. I had a simple javascript that generates a button: Code: [Select] <style type="text/css" media="print"> @page { size:8.5in 11in; margin: 1cm } .printbutton { visibility: hidden; display: none; } </style> <script> document.write("<input type='button' " + "onClick='window.print()' " + "class='printbutton' " + "value='Print This Page'/>"); </script> But I'm assuming I ought to do this with php - or would it be jquery? , so that when they click the button, I can do a query update to the database. But I can't find any tutorials on it. Searching for it, just brings up the php command, "print" grrr. I understand you need to use the mail() command but this just wont work for me, my webserver is with godaddy, and they sent me an email saying that i need to use a relay server to send my mail, how do i set this up or anything? Hello, I have been using the mail() command for a while now, but for some reason It has just stopped functioning all together. I have added an OR DIE rule to the end of it and had no response. To all intents and purposes that mail is being sent - there are no errors whatsoever - just the mail is not getting delivered. I cannot think of anything I've done or changed that would stop it from being delivered, I haven't even been near the function that does it in a while. Here is the code: Code: [Select] function sendMail($to,$ref) { $subject = 'Booking Confirmation'; $file = "receipts/$ref.htm"; $fh=fopen($file, "r"); $message = fread($fh, filesize($file)); fclose($fh); $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: Company <noreply@company.co.uk>' . "\r\n"; mail($to, $subject, $message, $headers); } I have taken out the public names involved, but otherwise thats the code. It has worked absolutely fine in the past, and even If I strip out all of the filehandling part of it, and just use a simple $from - $to - $message, it still seems not actually send the mail. It wouldnt be so bad If I at least had an error to go on, but I dont I am just simply not getting the mail. Please help! ~Chud37 |