Search Results

Search found 21430 results on 858 pages for 'message digest'.

Page 117/858 | < Previous Page | 113 114 115 116 117 118 119 120 121 122 123 124  | Next Page >

  • Get email address from OpenID provider (Janrain openid library)

    - by Moak
    When signing in to stackoverflow with google I get this message Stackoverflow.com is asking for some information from your Google Account [email protected] • Email address: [email protected] However on my site I can log in with openid but I can't ask for the email address. I get this message You are signing in to example.com with your Google Account [email protected] Also I'm finding it hard to know at what step I need to ask for it, here's some code where I think that step should be built into. /** * Authenticates the given OpenId identity. * Defined by Zend_Auth_Adapter_Interface. * * @throws Zend_Auth_Adapter_Exception If answering the authentication query is impossible * @return Zend_Auth_Result */ public function authenticate() { $id = $this->_id; $consumer = new Auth_OpenID_Consumer($this->_storage); if (!empty($id)) { $authRequest = $consumer->begin($id); if (is_null($authRequest)) { return new Zend_Auth_Result( Zend_Auth_Result::FAILURE, $id, array("Authentication failed", 'Unknown error')); } if (Auth_OpenID::isFailure($authRequest)) { return new Zend_Auth_Result( Zend_Auth_Result::FAILURE, $id, array("Authentication failed", "Could not redirect to server: " . $authRequest->message)); } $redirectUrl = $authRequest->redirectUrl($this->_root, $this->_returnTo); if (Auth_OpenID::isFailure($redirectUrl)) { return new Zend_Auth_Result( Zend_Auth_Result::FAILURE, $id, array("Authentication failed", $redirectUrl->message)); } Zend_OpenId::redirect($redirectUrl); } else { $response = $consumer->complete(Zend_OpenId::selfUrl()); switch($response->status) { case Auth_OpenID_CANCEL: case Auth_OpenID_FAILURE: return new Zend_Auth_Result( Zend_Auth_Result::FAILURE, null, array("Authentication failed. " . @$response->message)); break; case Auth_OpenID_SUCCESS: return $this->_constructSuccessfulResult($response); break; } } } It seems like such an obvious thing but I'm having a hard time googling and combing through the code just to find this. Thanks!

    Read the article

  • realtime visitors with nodejs & redis & socket.io & php

    - by orhan bengisu
    I am new to these tecnologies. I want to get realtime visitor for each products for my site. I mean a notify like "X users seeing this product". Whenever an user connects to a product counter will be increased for this product and when disconnects counter will be decreased just for this product. I tried to search a lots of documents but i got confused. I am using Predis Library for PHP. What i have done may totaly be wrong. I am not sure Where to put createClient , When to subscribe & When to unsubscribe. What I have done yet: On product detail page: $key = "product_views_".$product_id; $counter = $redis->incr($key); $redis->publish("productCounter", json_encode(array("product_id"=> "1000", "counter"=> $counter ))); In app.js var app = require('express')() , server = require('http').createServer(app) , socket = require('socket.io').listen(server,{ log: false }) , url = require('url') , http= require('http') , qs = require('querystring') ,redis = require("redis"); var connected_socket = 0; server.listen(8080); var productCounter = redis.createClient(); productCounter.subscribe("productCounter"); productCounter.on("message", function(channel, message){ console.log("%s, the message : %s", channel, message); io.sockets.emit(channel,message); } productCounter.on("unsubscribe", function(){ //I think to decrease counter here, Shold I? and How? } io.sockets.on('connection', function (socket) { connected_socket++; socket_id = socket.id; console.log("["+socket_id+"] connected"); socket.on('disconnect', function (socket) { connected_socket--; console.log("Client disconnected"); productCounter.unsubscribe("productCounter"); }); }) Thanks a lot for your answers!

    Read the article

  • How do I find multiple matches with one regular expression?

    - by christian studer
    I've got the following string: response: id="1" message="whatever" attribute="none" world="hello" The order of the attributes is random. There might be any number of other attributes. Is there a way to get the id, message and world attribute in one regular expression instead of applying the following three one after another? / message="(.*?)"/ / world="(.*?)"/ / id="(.*?)"/

    Read the article

  • Preg_match differences?

    - by sky
    Hi, i want to ask, what is the meaning or difference between these two line? if( preg_match_all('/\#([?-?À-ÿ?-??-?a-z0-9\-_]{1,50})/iu', $message, $matches, PREG_PATTERN_ORDER) ) { if( preg_match_all('/\#([?-?a-z0-9\-_\x{4e00}-\x{9fa5}]{1,50})/iu', $message, $matches, PREG_PATTERN_ORDER) ) { and what does the number 3 mean in this line? (Arrow pointing) if( preg_match_all('/\@([a-zA-Z0-9\-_\x{4e00}-\x{9fa5}]{->3,30})/u', $message, $matches, PREG_PATTERN_ORDER) ) { Thanks!

    Read the article

  • Facebook graph API post to user's wall

    - by Lance
    I'm using the FB graph api to post content to the user's wall. I orginally tried using this method: $wall_post = array(array('message' => 'predicted the', 'name' => 'predicted the'), array('message' => $winning_team, 'name' => $winning_team, 'link' => 'http://www.sportannica.com/teams.php?team='.$winning_team.'&amp;year=2012'), array('message' => 'to beat the', 'name' => 'to beat the',), array('message' => $losing_team, 'name' => $losing_team, 'link' => 'http://www.sportannica.com/teams.php?team='.$losing_team.'&amp;year=2012'), array('message' => 'on '.$game_date.'', 'name' => 'on '.$game_date.''), array('picture' => 'http://www.sportannica.com/img/team_icons/current_season_logos/large/'.$winning_team.'.png')); $res = $facebook->api('/me/feed/', 'post', '$wall_post'); But, much to my surprise, you can't post multiple links to a users wall. So, now I'm using the graph api to post content to a user's wall much like the way spotify does. So, now I've figured out that I need to create custom actions and objects with the open graph dashboard. So, I've created the "predict" action and gave it permission to edit the object "game." So, now I have the code: $facebook = new Facebook(array( 'appId' => 'appID', 'secret' => 'SECRET', 'cookie' => true )); $access_token = $facebook->getAccessToken(); $user = $facebook->getUser(); if($user != 0) { curl -F 'access_token='$.access_token.'' \ -F 'away_team=New York Yankees' \ -F 'home_team=New York Mets' \ -F 'match=http://samples.ogp.me/413385652011237' \ 'https://graph.facebook.com/me/predict-edit-add:predict' } I keep getting an error reading: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING Any ideas?

    Read the article

  • How to make SOAP WSDL request in Objective-C ?

    - by Biranchi
    Hi all, I have a WSDL script which has the following format <definitions name="ProcessData" targetNamespace="urn:ProcessData"> <message name="CreateAccount"> <part name="firstName" type="xsd:string"/> <part name="lastName" type="xsd:string"/> <part name="password" type="xsd:string"/> <part name="emailAddress" type="xsd:string"/> <part name="sendEmail" type="xsd:string"/> <part name="key" type="xsd:string"/> </message> <message name="CreateAccountResponse"> <part name="result" type="xsd:string"/> </message> <definitions> How to make SOAP WSDL request in Objective-C and get the resonse ? Thanks

    Read the article

  • Can't resolve CalledFromWrongThreadException with Handler

    - by michel
    I will try to keep it simple: In my main activity I make a handler: public class ARViewer extends ARDisplayActivity { public final MHandler mHandler = new MHandler(this); public void onCreate(Bundle savedInstanceState) { ... The class MHandler: public final class MHandler extends Handler{ //main activity private ARViewer arnv; public MHandler(ARViewer arnv){ this.arnv = arnv; } @Override public void handleMessage(Message msg) { ... case H_RR : arnv.setContentView(R.layout.routeplanner); break; ... super.handleMessage(msg); } } But if I call the handleMessage method from a callback function in a other Class, definitely from a other thread, I still get the exception message: CalledFromWrongThreadException (Only the original thread that created a view hierarchy can touch its views) : public void rFound(Route route) { Message msg = new Message(); msg.what = MHandler.H_RR; ARViewer.arnv.mHandler.handleMessage(msg); }

    Read the article

  • Enabling/Disabling Aero from a Windows Service

    - by rgould
    I have some code to enable/disable the Windows Aero service in Vista, and I would like to run it in a Windows Service. The code works in a standalone application, but when I run it from a Service, nothing happens. No errors or exceptions are thrown. I realise that running code in a service is a different scope than running code in an application, but in this case, how would I enable/disable Aero from the service? Is this even possible? Here is the code I am working with: public static readonly uint DWM_EC_DISABLECOMPOSITION = 0; public static readonly uint DWM_EC_ENABLECOMPOSITION = 1; [DllImport("dwmapi.dll", EntryPoint="DwmEnableComposition")] protected static extern uint Win32DwmEnableComposition(uint uCompositionAction); public static bool EnableAero() { Win32DwmEnableComposition(DWM_EC_ENABLECOMPOSITION); } Edit: It turns out that the DwmEnableComposition call is returning HRESULT 0x80070018, or ERROR_BAD_LENGTH. Seems like a strange error, since the code works when not running as a service. I also tried changing the entire thing to the following code, but got the same result. It sets the window station and desktop, and it seems to be correct, but the call to DwmEnableComposition results in the same error. I've not included the PInvoke declarations for brevity. protected override void OnStop() { IntPtr winStation = OpenWindowStation("winsta0", true, 0x10000000 /* GENERIC_ALL */); if (winStation == null || winStation.ToInt32() == 0) { String err = new Win32Exception(Marshal.GetLastWin32Error()).Message; } if (!SetProcessWindowStation(winStation)) { String err = new Win32Exception(Marshal.GetLastWin32Error()).Message; } uint thread = GetCurrentThreadId(); IntPtr hdesk = OpenInputDesktop(0, false, 0x10000000 /* GENERIC_ALL */); if (hdesk == null || hdesk.ToInt32() == 0) { String err = new Win32Exception(Marshal.GetLastWin32Error()).Message; } if (!SetThreadDesktop(hdesk)) { String err = new Win32Exception(Marshal.GetLastWin32Error()).Message; } uint result = Win32DwmEnableComposition(DWM_EC_DISABLECOMPOSITION); if (result != 0) { String err = new Win32Exception(Marshal.GetLastWin32Error()).Message; } }

    Read the article

  • Troubleshoot MySQL query

    - by Victor
    I need help with this code, it doesent insert the values to my database. Probably a simple problem but it's late here in Sweden so i would appriciate if someone could have a look at this and tell me what's wrong: include "../../inc/mysql_config.php"; $to = mysql_real_escape_string($_POST['to']); $message = mysql_real_escape_string($_POST['message']); mysql_query("INSERT INTO messages (to, message) VALUES ('".$to."', '".$message."')"); Every variable have an value, double checked that and the mysql_config.php is working.

    Read the article

  • PEAR mail not sending to .eu email addresses

    - by andy-score
    I have a PEAR mailing script that is used to send newsletters from a clients website. I've used the same code before to produce another newsletter system and it has worked well and been used to send emails to various addresses, however our latest client has email addresses ending .eu and this seems to cause a problem. When the newsletter is sent from the site to the various subscribers, including gmail, hotmail, yahoo and our own company emails, the emails are received correctly by all but the clients email addresses, the ones ending in .eu. As there is nothing different between their mailing system and our own, which is run from the same hosting company, I have to conclude that it is something to do with the domain name. The emails are being sent to the addresses from the system, as I have a log file storing the email addresses when the mail out function is called, but the newsletter never appears in the inbox. I have created a new email account for the domain and that too isn't receiving the emails. It's not going into a spam folder as the webmail system marks spam by adding SPAM into the subject. I've tried to log if there are any errors using the following foreach($subscribers as $recipient) { $send_newsletter = $mail->send($recipient, $headers, $body); // LOG INFO $message = $recipient; if($send_newsletter) { $message .= ' SENT'; } elseif(PEAR::isError($send_newsletter)) { $message .= ' ERROR: '.$send_newsletter->getMessage(); } $message .= ' | '; fwrite($log_file,$message); } However this simple returns SENT for all recipients, so in theory there isn't anything wrong with the mailing function. I don't know a great deal about PEAR or the mailing function so I may be missing something important, but I'd have thought seeing the last thing to happen is sending the email out, and that seems to work, then it should reach the clients inbox. Is this something to do with the PEAR mailing function not liking .eu addresses or is it more likely to be something wrong in my code or with their domain? Any help is greatly appreciated as the client and myself are getting both confused and frustrated by the whole thing. Cheers

    Read the article

  • How can I pass managed objects from one AppDomain to another?

    - by Dennis P
    I have two assemblies that I'm trying to link together. One is a sort of background process that's built with WinForms and will be designed to run as a Windows Service. I have a second project that will act as a UI for the background process whenever a user launches it. I've never tried attempting something like this with managed code before, so I've started trying to use windows messages to communicate between the two processes. I'm struggling when it comes to passing more than just IntPtrs back and forth, however. Here's the code from a control in my UI project that registers itself with the background process: public void Init() { IntPtr hwnd = IntPtr.Zero; Process[] ps = Process.GetProcessesByName("BGServiceApp"); Process mainProcess = null; if(ps == null || ps.GetLength(0) == 0) { mainProcess = LaunchApp(); } else { mainProcess = ps[0]; } SendMessage(mainProcess.MainWindowHandle, INIT_CONNECTION, this.Handle, IntPtr.Zero); } protected override void WndProc(ref Message m) { if(m.Msg == INIT_CONFIRMED && InitComplete != null) { string message = Marshal.PtrToStringAuto(m.WParam); Marshal.FreeHGlobal(m.WParam); InitComplete(message, EventArgs.Empty); } base.WndProc(ref m); } This is the code from the background process that's supposed to receive a request from the UI process to register for status updates and send a confirmation message. protected override void WndProc(ref Message m) { if(m.Msg == INIT_CONNECTION) { RegisterUIDispatcher(m.WParam); Respond(m.WParam); } if(m.Msg == UNINIT_CONNECTION) { UnregisterUIDispatcher(m.WParam); if(m_RegisteredDispatchers.Count == 0) { this.Close(); } } base.WndProc(ref m); } private void Respond(IntPtr caller) { string test = "Registration confirmed!"; IntPtr ptr = Marshal.StringToHGlobalAuto(test); SendMessage(caller, INIT_CONFIRMED, ptr, IntPtr.Zero); } } The UI process receives the INIT_CONFIRMED message from my background process, but when I try to marshal the IntPtr back into a string, I get an empty string. Is the area of heap I'm using out of scope to the other process or am I missing some security attribute maybe? Is there a better and cleaner way to go about something like this using an event driven model?

    Read the article

  • users see my SMS messages as coming from '1010100001'

    - by John Leonard
    In my application, I ask the user to enter their cell and select their provider. I append the provider's email and create the message and fire via php.mail() The problem is that no matter what the header info is, the message comes from '1010100001' on some phones (like AT&T and the iPhone). When testing on my Verizon phone, I get the proper email address as the sender. Any idea how I can send a clearer message?

    Read the article

  • Grails , how do I get an object NOT to save

    - by user350325
    Hello I am new to grails and trying to create a form which allows a user to change the email address associated with his/her account for a site I am creating. It asks for the user for their current password and also for the new email address they want to use. If the user enters the wrong password or an invalid email address then it should reject them with an appropriate error message. Now the email validation can be done through constraints in grails, but the password change has to match their current password. I have implemented this check as a method on a service class. See code below: def saveEmail = { def client = ClientUser.get(session.clientUserID) client.email = params.email if(clientUserService.checkPassword(session.clientUserID , params.password) ==false) { flash.message = "Incorrect Password" client.discard() redirect(action:'changeEmail') } else if(!client.validate()) { flash.message = "Invalid Email Address" redirect(action:'changeEmail') } else { client.save(); session.clientUserID = null; flash.message = "Your email address has been changed, please login again" redirect(controller: 'clientLogin' , action:'index') } } Now what I noticed that was odd was that if I entered an invalid email then it would not save the changes (as expected) BUT if I entered the wrong password and a valid email then it would save the changes and even write them back into the database even though it would give the correct "invalid password" error message. I was puzzled so set break points in all the if/else if/else blocks and found that it was hitting the first if statement as expected and not hitting the others , so it would never come accross a call to the save() method, yet it was saved anyway. After a little research I came accross documentation for the discard() method which you can see used in the code above. So I added this but still no avail. I even tried using discard then reloading the client object from the DB again but still no dice. This is very frustrating and I would be grateful for any help, since I think that this should surely not be a complicated requirement!

    Read the article

  • Resolve php "deadlock"

    - by Matt
    Hey all, I'm currently running into a situation that I guess would be called deadlock. I'm implementing a message service that calls various object methods.. it's quite similar to observer pattern.. Here's whats going on: Dispatcher.php Dispatcher.php <? class Dispatcher { ... public function message($name, $method) { // Find the object based on the name $object = $this->findObjectByName($name); // Slight psuedocode.. for ease of example if($this->not_initialized($object)) $object = new $object(); // This is where it locks up. } return $object->$method(); ... } class A { function __construct() { $Dispatcher->message("B", "getName"); } public function getName() { return "Class A"; } } class B { function __construct() { // Assume $Dispatcher is the classes $Dispatcher->message("A", "getName"); } public function getName() { return "Class B"; } } ?> It locks up when neither object is initialized. It just goes back and forth from message each other and no one can be initialized. Any help would be immensely helpful.. Thanks! Matt Mueller

    Read the article

  • Multiple Broadcast Messages with Less Data or Less Broadcast Messages with More Data?

    - by niko
    Hi, I am developing an application which is communicating with the server. Tha application can perform log-in and get different parameters from server. The application consists of a RESTful client (custom class for making requests), Communication Service (the service which runs in the background) and the main activity. For now I created multiple broadcast messages and multiple broadcast receivers in the main activity so when the application performs login operation a receiver (loginBroadcastReceiver) in the main activity receives a message and when another parameter is received from the server different message is broadcasted and another receiver handles the message. This way however the application performance is poor but I am not sure whether it is due to multiple broadcast receivers. Does anyone know what is the best way to exchange data between service and main activity - is it better to create a single broadcast receiver and retrieve all parameters from message or is it better to initialize multiple broadcast receivers for multiple parameters? I would appreciate if you could provide any useful resource about the topic because I'm writing the thesis and it would be good if the solution could be explained.

    Read the article

  • Window Wrapper Class C++ (G++)

    - by Ell
    Hi all, I am attempting to learn about creating windows in c++, I have looked at an article about creating a wrapper class but I don't really understand it. So far I know that you can't have a class method WndProc (I dont know why) but honestly, that is all. Can somebody give an explanation, also explaining the reinterpret_cast? Here is the article. LRESULT CALLBACK Window::MsgRouter(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { Window *wnd = 0; if(message == WM_NCCREATE) { // retrieve Window instance from window creation data and associate wnd = reinterpret_cast<Window *>((LPCREATESTRUCT)lparam)->lpCreateParams; ::SetWindowLong(hwnd, GWL_USERDATA, reinterpret_cast<long>(wnd)); // save window handle wnd->SetHWND(hwnd); } else // retrieve associated Window instance wnd = reinterpret_cast<Window *>(::GetWindowLong(hwnd, GWL_USERDATA)); // call the windows message handler wnd->WndProc(message, wparam, lparam); } Thanks in advance, ell.

    Read the article

  • Resolve php endless recursion issue

    - by Matt
    Hey all, I'm currently running into an endless recursion situation. I'm implementing a message service that calls various object methods.. it's quite similar to observer pattern.. Here's whats going on: Dispatcher.php class Dispatcher { ... public function message($name, $method) { // Find the object based on the name $object = $this->findObjectByName($name); // Slight psuedocode.. for ease of example if($this->not_initialized($object)) $object = new $object(); // This is where it locks up. } return $object->$method(); ... } class A { function __construct() { $Dispatcher->message("B", "getName"); } public function getName() { return "Class A"; } } class B { function __construct() { // Assume $Dispatcher is the classes $Dispatcher->message("A", "getName"); } public function getName() { return "Class B"; } } It locks up when neither object is initialized. It just goes back and forth from message each other and no one can be initialized. I'm looking for some kind of queue implementation that will make messages wait for each other.. One where the return values still get set. I'm looking to have as little boilerplate code in class A and class B as possible Any help would be immensely helpful.. Thanks! Matt Mueller

    Read the article

  • How to check if ping responded or not in a batch file

    - by Ismail
    I want to continuously ping a server and see a message box when ever it responds i.e. server is currently down. I want to do it through batch file. I can show a message box as said here http://stackoverflow.com/questions/774175/how-can-i-open-a-message-box-in-a-windows-batch-file/774253#774253 and can ping continuously by ping <servername> -t But how do I check if it responded or not?

    Read the article

  • MySQL & PHP Use of Undefined Constant

    - by Nik
    Alright, PHP is throwing this error (only in the logs): Error PHP Notice: Use of undefined constant department - assumed 'department' (line 5) PHP Notice: Use of undefined constant name - assumed 'name' (line 6) PHP Notice: Use of undefined constant email - assumed 'email' (line 7) PHP Notice: Use of undefined constant message - assumed 'message' (line 8) Lines 4-7 $department = mysql_real_escape_string($_POST[department]); $name = mysql_real_escape_string($_POST[name]); $email = mysql_real_escape_string($_POST[email]); $message = mysql_real_escape_string($_POST[message]); I think it has something to do with defining constants before defining them (how is this possible).

    Read the article

  • Compiling and executing through commandLine shows NoClassDefFoundError when trying to find Java pack

    - by eruina
    I have a client/server program that attempts to send and receive an object. There are three packages: server, client and shared shared contains only the Message class I put Message.java from shared package into the same folder as calcclient package source files and calcserver package source files. I compile using the line: javac -classpath .; Message.java They can compile. Then I change directory up one level and ran with: java -classpath .; .Main When I use Netbeans to run, the entire program works as per normal. But not if I run from command line. If its executed through command line, the program will work until it needs to use the Message object. Then it will show a NoClassDefFoundError Am I putting the right files at the right places? How do I get the program to find shared package through command line?

    Read the article

  • Design Pattern for Server Emulator

    - by adisembiring
    I wanna build server socket emulator, but I want implement some design pattern there. I will described my case study that I have simplified like these: My Server Socket will always listen client socket. While some request message come from the client socket, the server emulator will response the client through the socket. the response is response code. '00' will describe request message processed successfully, and another response code expect '00' will describe there are some error while processing the message request. IN the server there are some UI, this UI contain check response parameter such as. response code timeout interval While the server want to response the client message, the response code taken from input parameter response form UI check the timeout interval, it will create sleep thread and the interval taken from timeout interval input from UI. I have implement the function, but I create it in one class. I feel it so sucks. Can you suggest me what class / interface that I must create to refactor my code.

    Read the article

  • String Length Evaluating Incorrectly

    - by Justin R.
    My coworker and I are debugging an issue in a WCF service he's working on where a string's length isn't being evaluated correctly. He is running this method to unit test a method in his WCF service: // Unit test method public void RemoveAppGroupTest() { string addGroup = "TestGroup"; string status = string.Empty; string message = string.Empty; appActiveDirectoryServicesClient.RemoveAppGroup("AOD", addGroup, ref status, ref message); } // Inside the WCF service [OperationBehavior(Impersonation = ImpersonationOption.Required)] public void RemoveAppGroup(string AppName, string GroupName, ref string Status, ref string Message) { string accessOnDemandDomain = "MyDomain"; RemoveAppGroupFromDomain(AppName, accessOnDemandDomain, GroupName, ref Status, ref Message); } public AppActiveDirectoryDomain(string AppName, string DomainName) { if (string.IsNullOrEmpty(AppName)) { throw new ArgumentNullException("AppName", "You must specify an application name"); } } We tried to step into the .NET source code to see what value string.IsNullOrEmpty was receiving, but the IDE printed this message when we attempted to evaluate the variable: 'Cannot obtain value of local or argument 'value' as it is not available at this instruction pointer, possibly because it has been optimized away.' (None of the projects involved have optimizations enabled). So, we decided to try explicitly setting the value of the variable inside the method itself, immediately before the length check -- but that didn't help. // Lets try this again. public AppActiveDirectoryDomain(string AppName, string DomainName) { // Explicitly set the value for testing purposes. AppName = "AOD"; if (AppName == null) { throw new ArgumentNullException("AppName", "You must specify an application name"); } if (AppName.Length == 0) { // This exception gets thrown, even though it obviously isn't a zero length string. throw new ArgumentNullException("AppName", "You must specify an application name"); } } We're really pulling our hair out on this one. Has anyone else experienced behavior like this? Any tips on debugging it?

    Read the article

  • Sending HTML email from PHP

    - by KevinM
    I am trying to send a simple HTML e-mail from PHP. The code below simply results in a blank e-mail in GMail. It also has an empty attachment called 'noname', which is not at all what I want; though that might just be a symptom of it not working. The code I am using is: <?php //define the receiver of the email $to = '[email protected]'; //define the subject of the email $subject = 'Test HTML email'; //create a boundary string. It must be unique //so we use the MD5 algorithm to generate a random hash $random_hash = md5(date('r', time())); //define the headers we want passed. Note that they are separated with \r\n $headers = "From: [email protected]\r\nReply-To: [email protected]"; //add boundary string and mime type specification $headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\""; //define the body of the message. ob_start(); //Turn on output buffering ?> --PHP-alt-<?php echo $random_hash; ?> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hello World!!! This is simple text email message. --PHP-alt-<?php echo $random_hash; ?> MIME-Version: 1.0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit <h2>Hello World!</h2> <p>This is something with <b>HTML</b>formatting.</p> --PHP-alt-<?php echo $random_hash; ?>-- <? //copy current buffer contents into $message variable and delete current output buffer $message = ob_get_clean(); //send the email $mail_sent = @mail( $to, $subject, $message, $headers ); //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" echo $mail_sent ? "Mail sent" : "Mail failed";

    Read the article

  • OnSubmit does work right in the Validation plugin in jQuery

    - by novellino
    Hello, I an quite new to jQuery and I have a problem while trying to create a form. I am using the Validation plugin for validate the email (one the form's field). When I click the Submit button I want to call my own function because I want to save the data in an XML file. This is my button: (as I understood the plugin uses "submit" for understand the button) <input type="submit" name="submit" class="submit" id="submit_btn" value="Send"/> and here is the script for the validation: <script type="text/javascript"> $(document).ready(function() { //this is my form $("#contactForm").validate(); /*save the valid data in the xml*/ $(".submit").click(function() { var email = $("input#email").val(); var subject = $("input#subject").val(); var message = $("textarea#message").val(); if (email == "" || !$("#contactForm").valid()) { return false; } var dataString = 'email='+ email + '&subject=' + subject + '&message=' + message; //alert("DATA: " +dataString); $.ajax({ type: "POST", url: "SaveData.jsp", data: dataString, success: function(data){} }); return false; }); }); In general it works ok but I have two basic problems. When I click the button in the beginning having all the form empty, I get no message for the field required. Also when the data are valid and I am doing the submit, the form does not become clear after the submit. If I deleted this script code, these actions are working properly but I can not save the data! Does anyone know what is wrong? Thanks a lot!

    Read the article

< Previous Page | 113 114 115 116 117 118 119 120 121 122 123 124  | Next Page >