Search Results

Search found 21356 results on 855 pages for 'check digit'.

Page 25/855 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • PHP: How to check for response code?

    - by Tom
    Hi, I'm a relative PHP newbie implementing a PayPal IPN listener and all seems to be working fine, except I dont really know how to check for a response code. I've tried something ugly with cURL but it doesn't work at all (I'm not understanding cURL). I've tried this piece of code that I grabbed from somewhere on the net: $fp = fsockopen('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30); $response_headers = get_headers($fp); $response_code = (int)substr($headers[0], 9, 3); ... but it's not working (returns $response_code = 0). So right now, I'm debugging my IPN code without checking for a Response 200. Can anyone more experienced advise me on what's the proper/simple way to check this? Thanks

    Read the article

  • Using Jquery to check if a URL is valid

    - by user102533
    A long running background process creates a text file to indicate the completion of the process. From the frontend, I'd need to check every few seconds if the text file has been created or not. I am doing this check from However the file is created in http://DomainB.com/Mytext.txt Can someone help me write a jquery script that checks for a file across domain? PS: Currently, I am doing a ajax postback that executes a WebMethod in ASP.NET that creates HttpWebRequest. This works functionally, but I have major performance problems. So, I need a light weight way of finding if a URL is valid or not.

    Read the article

  • PHP Check if <ul> has ended IF it exists

    - by Krewe
    I have my blog generate a preview by taking the first 300 characters and cut off the last whole word. My problem is, when I have a list near the top of the blog it is sometimes included in the preview, however the end list tag usually never is. So how can I check the $preview variable for a starting list tag, and if it is found, check for an ending tag and if it's not there add one. All the code for my preview. $preview = wordwrap($content, 300); $preview = explode("\n", $preview); $preview = $preview[0] . "...";

    Read the article

  • mysql - check if data exists across multiple tables

    - by Dd Daym
    I am currently running this query inside MySQL to check if the specified values exists within the table associated with them. SELECT COUNT(artist.artist_id), COUNT(album.album_id), COUNT(tracks.track_id) FROM artist, album, tracks WHERE artist.artist_id = 320295 OR album.album_id = 1234 OR tracks.track_id = 809 The result I get from running this query is all 1, meaning that all the statements after the WHERE clause is true. To further check the query's reliability, I changed the tracks.track_ = 809 to 802, which I know does not match. However the results displayed are still all 1, meaning that they were all successfully matched even when I purposefully inserted a value which would not have matched. How do I get it to show 1 for a match and 0 for no matches within the same query? EDIT: I have inserted an image of the query running

    Read the article

  • VB.NET Use WebRequest to check if URI is valid

    - by Robbo
    Looking for the best way to determine if a URI exists in VB.NET without downloading the actual content. System.IO.FileExists/My.Computer.FileSystem.FileExists can be used locally to determine if a file exists, is there an equivalent for the Web? Currently I am using a HttpWebRequest to check URI existance using the ResponseStream. This populates the stream if the target does exist and throws an exception if it doesn't. The function is being expanded to also check for PDF files (typically 5MB +), images, etc and it will be a waste of time/bandwidth to actually populate the content into a stream. In the case of "Success" (the target does exist) I do not wish to download the file or page, simply to end up with a Boolean which indicates the whether something exists at the end of this URI.

    Read the article

  • Need to create regular expression in Javascript to check the valid conditional string

    - by user1796078
    I want to create the regular expression in javascript which will check the valid conditional string like -1 OR (1 AND 2) AND 1 -1 OR (1 AND 2) -1 OR 2 -1 OR 1 OR 1 -1 AND 1 AND 1 The string should not contain 'AND' and 'OR'. For example - 1 OR 2 AND 3 is invalid. -It should be (1 OR 2) AND 3 or 1 or (2 AND 3). I tried the following Regex. It works for most of the conditions but it is failing to check the above condition. /^(\s*\(\d+\s(AND|OR)\s\d+\)|\s*\d+)((\s*(AND|OR)\s*)(\(\d+\s(AND|OR)\s\d+\)|\s*\d+))*$/ Can anyone please help me to sort out the above problem.

    Read the article

  • TFS Check-in Unavailable

    - by pm_2
    I have a C# project that is booked into TFS. However, for some reason one of the forms within the project has not booked in. I can’t work out how to force this to book in, as right-clicking on the source file doesn’t give me the option to check-in. All the other files in the project are booked in, and I can see them using the Source Control Explorer, however, this file isn’t in there. Can anyone tell me how this could have happened, and how to force this file to check-in?

    Read the article

  • Python: Check if all dictionaries in list are empty

    - by Brant
    I have a list of dictionaries. I need to check if all the dictionaries in that list are empty. I am looking for a simple statement that will do it in one line. Is there a single line way to do the following (not including the print)? l = [{},{},{}] # this list is generated elsewhere... all_empty = True for i in l: if i: all_empty = False print all_empty Somewhat new to python... I don't know if there is a shorthand built-in way to check this. Thanks in advance.

    Read the article

  • Why does the check for an interface fail?

    - by chobo
    I have a class that implements an interface. In another area of the code I check if that class instance contains that interface, but it doesn't work. The check to see if the class contains the interface always fails (false) when it should be true. Below is a simple representation of what I am trying to accomplish. Example public interface IModel { bool validate(); } public class SomeModel : IModel { public SomeModel { } public bool Validate() { return true; } } // Dummy method public void Run() { SomeModel model = new SomeModel(); if (model is IModel) { string message = "It worked"; } else { string message = "It failed"; } }

    Read the article

  • PHP radio button check if null

    - by Dallox
    So in class we get this school task where we need to check if one of the fields in unfilled and display an error. No we did this but for some strange reason it doesnt display a error when a radio button is unchecked. (textfield null check works fine) I've tried with a friend many possabilities but they all doesnt seem to work. We have been stuck at this task for 2 hours. Now we have tried making seperate if's but that doesnt seem to work too. These are the important parts: <p> <input type="hidden" name="taal" value="false"> Choose a language <input type="radio" name="taal" value="N"> Dutch <input type="radio" name="taal" value="E"> English <input type="radio" name="taal" value="S"> Spanish if (@$_POST['taal'] == null){ echo "No Language gotten"; return; }

    Read the article

  • Whether to check for null

    - by coffeeaddict
    I know that you should always check incoming params to a method for null. But what if I have this scenario with a try/catch referring to a local variable. Do I really need to check for null below? Because it's gonna catch it anyway if it's null and the next line of code tries to use the refundResponse variable: public string DoRefund(...) { try { ...... string refundTransactionID = string.Empty; ...... RefundTransactionResponseType refundResponse = transaction.DoRefund(...); if (refundResponse != null) refundTransactionID = refundResponse.RefundTransactionID; ..... } catch (Exception ex) { LogError(ex); return ex.ToString(); } }

    Read the article

  • MySQL Check if table exists error

    - by Max van Heiningen
    I'm trying to check if a table already exists, however I can't get this working. IF EXISTS (SELECT 1 FROM sysobjects WHERE xtype='u' AND name='tablename') SELECT 'table already exists.' ELSE BEGIN CREATE TABLE Week_( id INT(10)AUTO_INCREMENT PRIMARY KEY (id), ... ...) END; My error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS (SELECT 1 FROM sysobjects WHERE xtype='u' AND name' at line 1 Can someone help me with this? Thanks in advance

    Read the article

  • How to check if Contact has Image?

    - by Pentium10
    I am assigning to an ImageView contacts images using this code: mPhotoView = (ImageView) findViewById(R.id.photo); mPhotoView.setImageURI(objItem.getPhotoUri()); If the contact has no image, this does nothing, and no error is raised. When there is no image, I want to add a default image. So I need to check either if the image was added to the view, or check that the URI holds some image data How do I achieve that? Than I will set default image by this: mPhotoView.setImageResource(R.drawable.ic_contact_picture_2);

    Read the article

  • Check if class has been instantiated

    - by Holman716
    In my current program I have a main window and a secondary window that pops up when a button is pressed. If the secondary window is currently shown but doesn't have focus the button will instead bring it to focus. At this time I am creating a new instance of the secondary window as the main window loads and simply checking its status with SubWindow.IsDisposed and SubWindow.CanFocus I have found that if I do not create a new instance at the beginning SubWindow.IsDisposed throws an exception. As long as I'd previously created an instance of SubWindow the check runs fine. My question- The current version works fine but is there a better way of doing this? It is not a huge concern, but it feels like it'd be better to be able to check for existence without having to guarantee that it has existed at least once before.

    Read the article

  • Check if user in a database is banned JDBC

    - by user2297666
    Using an oracle database, I need to perform a check to see if a user in my 'users' table is banned or not. The user is banned if his column 'banned' has a value of '1', '0' if he is not. I have the following working code here: public boolean banUser(String username) {//TODO check if user is banned already try { pstmnt = conn.prepareStatement("UPDATE users SET banned = 1 WHERE username = ?"); pstmnt.setString(1, username); pstmnt.execute(); logger.info("Banned User : " + username); return true; } catch ( SQLException e ) { e.getMessage(); } return false; } I'm not sure how to perform an if statement on top of a prepared statement. Any ideas?

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >