Search Results

Search found 1121 results on 45 pages for 'quotes'.

Page 15/45 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • random quote generator with php, ajax and mysql

    - by fusion
    i've tried using this code and this to make a random quote generator, but it doesn't display anything. my questions are: what is wrong with my code? in the above tut, the quote is generated on a button click, i'd like a random quote to be displayed every 30 mins automatically. how do i do this? //////////////////////// quote.html: <!DOCTYPE html> <script src="ajax.js" type="text/javascript"></script> <body> <!–create the div for the quotes land–> <div id="quote"><strong>this</strong></div> <div><a style="cursor:pointer" onclick="run_query();">Next quote …</a></div> </body> </html> ///////////////////// quote.php: <?php include 'config.php'; // 'text' is the name of your table that contains // the information you want to pull from $rowcount = mysql_query("select count(*) as rows from quotes"); // Gets the total number of items pulled from database. while ($row = mysql_fetch_assoc($rowcount)) { $max = $row["rows"]; } // Selects an item's index at random $rand = rand(1,$max)-1; $result = mysql_query("select * from quotes limit $rand, 1"); $row = mysql_fetch_array($result); $randomOutput = $row['storedText']; echo '<p>' . $randomOutput . '</p>'; //////////// ajax.js: var xmlHttp function run_query() { xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("This browser does not support HTTP Request"); return; } // end if var url="quote.php"; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } //end function function stateChanged(){ if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ document.getElementById("quote").innerHTML=xmlHttp.responseText; } //end if } //end function function GetXmlHttpObject() { var xmlHttp=null; try { // For these browsers: Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); }catch (e){ //For Internet Explorer try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } //end function

    Read the article

  • How to avoid translation tools from messing up HTML tags?

    - by janoChen
    I always use Google translate and paste back the the results in Vim. But for some reason Google translate also screws up the HTML tags around the content I want to translate. Is there a solution for this? For instance, the double quotes are translated to Chinese-cased double quotes: 'pictures_h2'=>“?????????? Strong and li tags are translated too (well I kinda expected that). P S : IS there any translator which respect HTML tags? or translation plugin for Vim?

    Read the article

  • Assign multiple css classes to a table element in Rails

    - by Eric K
    I'm trying to style a table row using both cycle and a helper, like shown: <tr class= <%= cycle("list-line-odd #{row_class(item)}", "list-line-even #{row_class(item)}")%> > However, when I do this, the resulting HTML is: <tr class = "list-line-odd" lowest-price> with the return from the helper method not enclosed in the quotes, and therefore not recognized. Here's the helper I'm using: def row_class(item) if item.highest_price > 0 and item.lowest_price > 0 and item.highest_price != item.lowest_price if item.current_price >= item.highest_price "highest-price" elsif item.current_price <= item.lowest_price "lowest-price" end end end I must be missing something obvious, but I just can't figure out how to wrap both the result of cycle and the helper method return in the same set of quotes. Any help would be greatly appreciated!

    Read the article

  • Help Fix a bug - Unexpected T_STRING

    - by thecoshman
    So I have just rebuilt my server, just on local network. Stick my site back on it, try to run the code, and I get a anice T_STRING error. This is all very strange, as I have not changed the code :S <?php $window_ID = -1; if(isset($_POST["window_ID"]) AND $_POST["window_ID"] != null){ $window_ID = trim($_POST["window_ID"]); } ?> This is the start of the file, apter this rather loverly snipit of PHP the rest is just XMl, yet on line 6 appertnlty there is an unexpected T_STRING, which is strange considering all that is on that line is the ?>, then the XML starts up... Any one got any ideas what has gone wrong here? Any chance it ould be magic quotes? I had turned it of before, but I want to now update my code to check for the magic quotes and avoid its stupid actions.

    Read the article

  • JQuery+Java setting field value with val() + single quote

    - by Fabio K
    I have a problem setting the value of a textarea element with jquery's val(). Basically, I have a JSP file which receives a string parameter called 'text'. Java code: String text = (String) request.getParameter('text'); Now I want my textarea element to receive this text: Javascript code: $('#textarea_id').val('<%=text%>'); It works when my text doesnt contain quotes single quotes (and possibly other chars). For example, for text = test' this error happens: Uncaught SyntaxError: Unexpected token ILLEGAL $('#textarea_id').val('test''); I hope you guys understand. I need a way to encode this value... i tried using escape so the quote is replaced by %27, but after unescaping its replaced again and the error happens. Thanks!

    Read the article

  • How do I conditionally assign ruby variables to javascript variables?

    - by Tony
    I have a website where I need a javascript version of the "current user" object along with the ruby version. I have been assigning these variables doing something like this... Application Controller: def get_user begin @current_user = User.find(session[:user_id]) if session[:user_id] @current_user_json = @current_user.to_json rescue session.delete(:user_id) @current_user = nil @current_user_json = {} end end Web Page: var current_user = null; current_user_json = '<%= @current_user_json %>'; if(current_user_json != ''){ current_user = current_user_json.user; } Even when there is a current user, I get the current user is undefined. Probably because I am putting the current_user_json assignment around single quotes. However, if I don't put it around single quotes, I'll always get a javascript error when no user is logged in because the syntax is invalid - current_user_json = ; I think I am just looking at this completely wrong and there must be a better way. Given that this is probably a common thing to do, I wanted to get other people's opinion on how to create an object in javascript that is a duplicate of the ruby object.

    Read the article

  • How to set PATH to another variable value with spaces in Windows batch file

    - by Evgeny
    I've got a Windows batch script issue that I'm bashing my head against (no pun intended). The problematic script looks like this: if defined _OLD_VIRTUAL_PATH ( set PATH=%_OLD_VIRTUAL_PATH% ) When I run it and _OLD_VIRTUAL_PATH is set I get: \Microsoft was unexpected at this time. _OLD_VIRTUAL_PATH is a variable that was originally set from PATH and it contains spaces - I'm pretty sure that's the problem. But what's the solution? It runs successfully if I enclose it in quotes, but I don't think the entire value of the PATH variable is supposed to be in quotes.

    Read the article

  • Call function based off of a string in Lisp

    - by powerj1984
    I am passing in command line arguments to my Lisp program and they are formatted like this when they hit my main function: ("1 1 1" "dot" "2 2 2") I have a dot function and would like to call it directly from the argument, but this isn't possible because something like (funcall (second args)...) receives "dot" and not dot as the function name. I tried variations of this function: (defun remove-quotes (s) (setf (aref s 0) '"")) to no avail, before realizing that the quotes were not really a part of the string. Is there a simple way to do this, or should I just check each string and then call the appropriate function? Thanks!

    Read the article

  • extracting string occurrence in c

    - by David78
    I have a string from a text file that look something like this: long_str = "returns between paragraphs 20102/34.23" - 9203 1232 "test" "basic HTML" Note: Quotes are part of the string. int match(char *long_str){ char * str; if ((str = strchr(long_str, '"')) != NULL) str++; // last " ? else return 1; return 0; } Using strstr I'm trying to get the whole substring between the last two quotes: "basic HTML". I'm just not quite sure what would be a good and efficient way of getting that match. I'm open to any other ideas on how to approach this. Thanks

    Read the article

  • Split SQL statements

    - by eaZy
    Hello, I am writing a backend application which needs to be able to send multiple SQL commands to a MySQL server. MySQL = 5.x support multiple statements, but unfortunately we are interfacing with MySQL 4.x. I am trying to find a way (hint: regex) to split SQL statements by their semicolon, but it should ignore semicolons in single and double quotes strings. http://www.dev-explorer.com/articles/multiple-mysql-queries has a very nice regex to do that, but doesn't support double quotes. I'd be happy to hear your suggestions.

    Read the article

  • A little javascript help needed here (easy).

    - by Camran
    function addOption(selectbox, val, txt){ ...... } addOption(list, "Cars", "Cars"); I need to add this in front of the text of the function: &nbsp;&nbsp;&nbsp; So that there is space coming in before the option text...Never mind what it is for, it is just confusing... I just don't know how to insert it into the js code. If I do it like this: addOption(list, "Cars", "&nbsp;&nbsp;&nbsp;Cars"); Then the &nbsp;&nbsp;&nbsp; comes into the text, so it gets displayed for the users. However I need it to be interpreted as "space"... If you don't understand let me know... How can I do this? Quotes, double quotes etc? Thanks

    Read the article

  • mysql_real_escape_string & slashes (again, oh yes)

    - by Fizzadar
    Righto, firstly magic quotes & runtime are disabled correctly in php.ini, and confirmed by phpinfo(). PHP version: 5.3.4 MySQL version: 5.1.52 I'm only use mysql_real_escape_string on the data, after htmlspecialchars and a trim, that's all the data cleaning on the variable. Yet, when I submit a single quote, the slash remains in the database. When running mysql_query I'm using "' . $var . '", although in the past this hasn't changed anything (could be due to the double quotes?). Any ideas? and please don't tell me about PDO/prepared statements, I'm aware of them and I have my reasons for doing it this way. Thanks!

    Read the article

  • How can I get the file extensions from relative links in HTML text using Perl?

    - by Structure
    For example, scanning the contents of an HTML page with a Perl regular expression, I want to match all file extensions but not TLD's in domain names. To do this I am making the assumption that all file extensions must be within double quotes. I came up with the following, and it is working, however, I am failing to figure out a way to exclude the TLDs in the domains. This will return "com", "net", etc. m/"[^<>]+\.([0-9A-Za-z]*)"/g Is it possible to negate the match if there is more than one period between the quotes that are separated by text? (ie: match foo.bar.com but not ./ or ../) Edit I am using $1 to return the value within parentheses.

    Read the article

  • SEO - Delimiter character for page title

    - by cept0
    I have noticed a few oddities recently with the titles of web pages in SERPs. However, it seems there are several main conventions: Contact Page - Joe Schmoe's Awesome Site // &#045; Hyphen Contact Page — Joe Schmoe's Awesome Site // &mdash; Em dash Contact Page | Joe Schmoe's Awesome Site // &#x007C; Vertical bar Contact Page « Joe Schmoe's Awesome Site // &laquo; Left double angle quotes Is there any reason to use one over the other?

    Read the article

  • Why does add-apt-repository fail to add source repositories?

    - by Lorin Hochstein
    add-apt-repository throws an error if I try to add a source repository: This works: sudo add-apt-repository 'deb http://dl.ajaxplorer.info/repos/apt squeeze main' This fails with an error: sudo add-apt-repository 'deb-src http://dl.ajaxplorer.info/repos/apt squeeze main' Error: 'deb-src http://dl.ajaxplorer.info/repos/apt squeeze main' invalid Leaving off the quotes doesn't help: sudo add-apt-repository deb-src http://dl.ajaxplorer.info/repos/apt squeeze main Error: need a repository as argument

    Read the article

  • Oracle Keynote Panel at AIIM - The Movie

    - by [email protected]
    I've uploaded the video of the Oracle keynote panel at AIIM. It's broken into a number of segments, and I've put some of the quotes in the comments area so you can follow the topics as you decide which one to view. You can see the video here. A big thanks to our panelists for their time and insights - Cindy Bixler of Embry Riddle Aeronautical Univerisity, Tom Showalter of JP Morgan Chase, Irfan Motiwala of Moodys Investments, and Monica Crocker of Land O' Lakes, and a special thanks to our moderator, Robert Shimp of Oracle.

    Read the article

  • Presentations & Training material OFM Summer Camps & Impressions & Feedback

    - by JuergenKress
    Thanks to all attendees who invested their time and utilized the opportunity to attend the Summer Camps! Due to high demand of our most of the trainings, we had a long waiting list with more numbers of partners who are keen to attend it. We would like to give our special thanks to all trainers, who delivered excellent workshops! Most of the presentations and course material have been posted on our SOA Community Workspace and WebLogic Community Workspace. You can access the content only if you are a registered community member. To register for the SOA Community please click here. You can register for the WebLogic Community here. To find out the first impressions of the event please visit our Facebook pages: www.facebook.com/WebLogicCommunity & www.facebook.com/soacommunity or Picasa Album Thanks for the excellent blog posts from AMIS Technology Blog & Middleware by Link Consulting. Let us know if you published a twitter blog on @soacommunity & @wlscommunity. We will be pleased to publish it in our Newsletters. WebLogic Course Quotes “Oracle trainings are the best” - Pedro Neto Novobas “Excellent training, well organized” - Pedro Antunh, Capgemini “This course dives you into Oracle WebLogic giving you a quick start on benefiting from Fusion Apps” - Leonardo Fernandes, Outsystems Additional Quotes “Thanks a lot again for organizing such a great and informative Summer Camp. Both training and networking were organized very professionally. I have gained tons of very useful Info, which will definitely help to increase quality of our future projects.” - Daniel Fasko fss-group.com “I didn’t get the chance yesterday to thank you for a most enjoyable and thoroughly educational time I had in Munich over the last few days.” - Jeroen Bakker Ordina “Just to congratulate you on a great event, not only today but also in the previous days of training. As we know, a very good organization and, as a native Portuguese that knows Lisbon very good, a nice choice of places to visit. Looking forward to come again next year.” Pedro Miguel Neto, Novobase. WebLogic Partner Community For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center. Blog Twitter LinkedIn Mix Forum Wiki Technorati Tags: OFM Summer Camps,eduction,training,WebLogic,WebLogic Community,Oracle,OPN,Jürgen Kress

    Read the article

  • Getting started with StreamInsight

    A quick-start to SQL Server StreamInsight and Complex Event Processing with a step-by-step example on stock quotes. Too many SQL Servers to keep up with?Download a free trial of SQL Response to monitor your SQL Servers in just one intuitive interface."The monitoringin SQL Response is excellent." Mike Towery.

    Read the article

  • How to Add a Taskbar to the Desktop in Ubuntu 14.04

    - by Lori Kaufman
    If you’ve switched to Ubuntu from Windows, it may take some time to get used to the new and different interface. However, you can easily incorporate a familiar Windows feature, the Taskbar, into Ubuntu to make the transition easier. A tool called Tint2 provides a bar at the bottom of the Ubuntu Desktop that resembles the Windows Taskbar. We will show you how to install it and make it start every time you log into Ubuntu. NOTE: When we say to type something in this article and there are quotes around the text, DO NOT type the quotes, unless we specify otherwise. Press Ctrl + Alt + T to open a Terminal window. To install Tint2, type the following line at the prompt and press Enter. sudo apt-get install tint2 Type your password at the prompt and press Enter. The progress of the installation displays and then a message displays saying how much disk space will be used. When asked if you want to continue, type a “y” and press Enter. When the installation has finished, close the Terminal window by typing “exit” at the prompt and pressing Enter. Click the Search button at the top of the Unity bar. Start typing “startup applications” in the Search box. Items that match what you type start displaying below the Search box. When the Startup Applications tool displays, click the icon to open it. On the Startup Applications Preferences window, click Add. On the Add Startup Program dialog box, enter a name for the startup application. This name displays in the list on the Startup Applications Preferences window. Type “tint2” in the Command edit box, enter a description in the Comment edit box, if desired, and click Add. Tint2 is added as a startup program and will start every time you log into Ubuntu. Click Close to close the Startup Applications Preferences window. Log out and log back in to make the Taskbar available on the desktop. You do not need to reboot the computer for this change to take effect. Now, when you minimize a program, an icon for it displays on the Taskbar at the bottom of the screen, just like the Taskbar in Windows. If you decide that you don’t want the Taskbar to display every time you log into Ubuntu, you can uncheck the Tint2 startup program on the Startup Applications Preferences window. You don’t need to delete it from the list.

    Read the article

  • Reflector is no longer going to be free - What do you think?

    - by simonsabin
    Redgate recently announced that the next version of reflector was no longer going to be free ( http://www.red-gate.com/products/dotnet-development/reflector/announcement ). Instead you will be changed $35 . Here is the FAQ about the decision http://www.red-gate.com/products/dotnet-development/reflector/announcement-faq As a side note it drives me nuts when a UK company quotes dollars on their website. Especially when I am in the UK and I use pounds. The more I think about this the more I don’t like...(read more)

    Read the article

  • Announcement: ZFS Backup Appliance

    - by uwes
    Announcing Product Software Changes for Sun ZFS Backup Appliance Effective December 4th, 2012, Replication and Cloning software licenses are no longer mandatory purchases with Sun ZFS Backup Appliance.   Replication and Cloning are still available as optional additions on new Sun ZFS Backup Appliance quotes, or as additions to existing systems. For More Product Information Go To External: ZFS Storage Appliance Oracle.com page External: ZFS Storage Appliance Oracle Technical Network.com page External: Software download support.oracle.com page

    Read the article

  • Unzip individual files from multiple zip files and extract those individual files to home directory

    - by James P.
    I would like to unzip individual files. These files have a .txt extension. These files also live within multiple zipped files. Here is the command I'm trying to use. unzip -jn /path/to/zipped/files/zipArchiveFile2011\*.zip /path/to/specific/individual/files/myfiles2011*.txt -d /path/to/home/directory/for/extract/ From my understanding, the -j option excludes directories and will extract only the txt files The -n option will not overwrite a file if it has already been extracted. I've also learned that the forward slash in /path/to/zipped/files/zipArchiveFile2011\*.zip is necessary to escape the wildcard (*) character. Here is sample of error messages I'm coming accross: Archive: /path/to/zipped/files/zipArchiveFile20110808.zip caution: filename not matched: /path/to/specific/individual/files/myfiles20110807.txt caution: filename not matched: /path/to/specific/individual/files/myfiles20110808.txt Archive: /path/to/zipped/files/zipArchiveFile20110809.zip caution: filename not matched: /path/to/specific/individual/files/myfiles20110810.txt caution: filename not matched: /path/to/specific/individual/files/myfiles20110809.txt I feel that I'm missing something very simple. I've tried using single quotes (') and double quotes (") around directory paths. But no luck.

    Read the article

  • If spaces in filenames are possible, why do some of us still avoid using them?

    - by Chris W. Rea
    Somebody I know expressed irritation today regarding those of us who tend not to use spaces in our filenames, e.g. NamingThingsLikeThis.txt -- despite most modern operating systems supporting spaces in filenames. Non-technical people must look at filenames created by geeks and wonder where we learned English. So, what are the reasons that spaces in filenames are avoided or discouraged? The most obvious reason I could think of, and why I typically avoid it, are the extra quotes required on the command line when dealing with such files. Are there any other significant reasons, other than the practice being a vestigial preference? UPDATE: Thanks for all your answers! I'm surprised how popular this was. So, here's a summary: Six Reasons Why Geeks Prefer Filenames Without Spaces In Them It's irritating to put quotes around them when referenced on the command line (or elsewhere.) Some older operating systems didn't used to support them and us old dogs are used to that. Some tools still don't support spaces in filenames at all or very well. (But they should.) It's irritating to escape spaces when used where spaces must be escaped, such as URLs. Certain unenlightened services (e.g. file hosting, webmail) remove or replace spaces anyway! Names without spaces can be shorter, which is sometimes desirable as paths are limited.

    Read the article

  • Export NFS path containing "-" (dash)

    - by qdot
    I'm in a bit of a pinch with NFS exports file. Specifically, I can't find a way to export a directory containing "-" in the path name. Manual (exports(5)) states: Also, each line may have one or more specifications for default options after the path name, in the form of a dash ("-") followed by an option list. The option list is used for all subsequent exports on that line only. It then states: If an export name contains spaces it should be quoted using double quotes. You can also specify spaces or other unusual character in the export name using a backslash followed by the character code as three octal digits. Unfortunately, that is not the case. Specifically, if the pathname contains "-", either verbatim, or with \055 or is enclosed in double quotes, it still refers to the name without "-" Any ideas? I have a large number of directories, all of the form /vol/buildsystem-s3c2440 /vol/buildsystem-tao3530 and I'd prefer to have them all available as nfs exports. Short of replacing the "-" with "_" everywhere in the scripts, can it be done with "-" ?

    Read the article

  • Postfix won't pipe to PHP file through aliases file

    - by jfreak53
    I'm trying to pipe from postfix to a command. According to Postfix logs it worked, but when I check the command it didn't. This is a fresh postfix install. This is my alias file: # See man 5 aliases for format postmaster: root support: "| /usr/bin/php -q /var/www/pipe/pipe.php" I run sendmail [email protected] then type it and then on a separate line type . and it goes. I check the postfix log /var/log/mail.log and this is what it states: Nov 2 15:32:33 server3 postfix/local[13284]: 42C429E0B5: to=<[email protected]>, relay=local, delay=156, delays=156/0.01/0/0.05, dsn=2.0.0, status=sent (delivered to command: /usr/bin/php -q /var/www/pipe/pipe.php) So according to that it worked, but it doesn't. If I run echo 'text' | /usr/bin/php -q /var/www/pipe/pipe.php it does work just fine. Any ideas what I did wrong? I know piping is working, I originally checked it by running that command above WITHOUT the quotes, so just support: | /usr/bin/php -q /var/www/pipe/pipe.php What it did there was append my email header and all to the file pipe.php. So I know postfix was piping it, but when I put in the quotes it says it's going but it's not according to my script.

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >