Search Results

Search found 39 results on 2 pages for 'gambooka'.

Page 1/2 | 1 2  | Next Page >

  • How do I extract HTML content using Regex in PHP

    - by gAMBOOKa
    I know, i know... regex is not the best way to extract HTML text. But I need to extract article text from a lot of pages, I can store regexes in the database for each website. I'm not sure how XML parsers would work with multiple websites. You'd need a separate function for each website. In any case, I don't know much about regexes, so bear with me. I've got an HTML page in a format similar to this <html> <head>...</head> <body> <div class=nav>...</div><p id="someshit" /> <div class=body>....</div> <div class=footer>...</div> </body> I need to extract the contents of the body class container. I tried this. $pattern = "/<div class=\"body\">\(.*?\)<\/div>/sui" $text = $htmlPageAsIs; if (preg_match($pattern, $text, $matches)) echo "MATCHED!"; else echo "Sorry gambooka, but your text is in another castle."; What am I doing wrong? My text ends up in another castle.

    Read the article

  • Cache Refresh in Chrome

    - by gAMBOOKa
    I dunno what exactly it's called, by cache refresh I mean, refresh the page after clearing its cache. I don't want to clear the entire browser cache. I prefer Chrome's Dev panel against firebug... don't ask me why. But I can't seem to cache refresh my pages. In FF, I know it to be Shift+Refresh. In chrome, I've tried Ctrl+R, Ctrl+Refresh, Alt+Refresh, Shift+Refresh but none of them work. EDIT: I got a Notable Question Badge for the lamest question I've ever asked. FML.

    Read the article

  • Mounting ubuntu's root.disk in Windows 7

    - by gAMBOOKa
    I've got Ubuntu 9.10 installed in an NTFS partition. After an update, I started getting kernel panics, so I need to reinstall it. But before I do that, I need to retrieve and backup my home directory. I believe Ubuntu's file system is packaged in the root.disk image. So how do I mount it in Windows?

    Read the article

  • Securing against DDoS

    - by gAMBOOKa
    My client would like to have his eCommerce (custom-made) site secured from DDoS attacks. What strategies can I implement? There are multiple forms in the purchasing flow --- searching, drilling-down to the product, user information and payment and I want to avoid captchas.

    Read the article

  • Network tools not working with a 3G connection

    - by gAMBOOKa
    Some of my network tools stopped working after I switched to a 3G connection from a DSL one. Cain and Abel's sniffer, Metasploit, even the NMAP scanner. I'm using Windows 7. The 3G device in question is the Huawei E180. Here's the error I get when running NMAP WARNING: Using raw sockets because ppp2 is not an ethernet device. This probably won't work on Windows. pcap_open_live(ppp2, 100, 0, 2) FAILED. Reported error: Error opening adapter: The system cannot find the device specified. (20). Will wait 5 seconds then retry. pcap_open_live(ppp2, 100, 0, 2) FAILED. Reported error: Error opening adapter: The system cannot find the device specified. (20). Will wait 25 seconds then retry. Call to pcap_open_live(ppp2, 100, 0, 2) failed three times. Reported error: Error opening adapter: The system cannot find the device specified. (20) Metasploit's refused connection to my websites too.

    Read the article

  • Wiki software for business plans. Which one?

    - by gAMBOOKa
    I need to recommend a wiki software for use by our higher management. They're spread out globally and would like various collaborative tools to discuss, edit, manage these business plans. Lotsa business plans, most get rejected but for some reason, they enjoy doing it. Also, did I mention higher management? As in, not very technically competent. What would you recommend?

    Read the article

  • MySQL wants a password but it's empty

    - by gAMBOOKa
    mysql -uroot ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) mysql -uroot -p Enter password: <-- leave blank, hit enter without entering anything mysql> <-- i am logged in NOTE: This is a new mysql instance installation So if the password is blank, why won't it log me in without a -p flag? For a little clarification. I am running into this issue when attempting to change the password using a script: We're using a bash script to do that. mysqladmin -u root password abc wouldn't work (access denied) mysqladmin -u root -p password abc cannot be used because it prompts for a password and we need to automate this. mysqladmin -u root -p'' password abc is not working either

    Read the article

  • What is the most secure way to allow a user read access to a log file?

    - by gAMBOOKa
    My application requires read access to /var/log/messages, which belongs to user and group root. What is the minimal exposure level required on /var/log/messages so my application can read it? Presently, my plan is to change the group ownership of /var/log/messages to a new group, and add root and my application user to it, but this would also give the application write privileges to /var/log/messages. OS: Centos 5.5

    Read the article

  • Cache Refresh in Chrome

    - by gAMBOOKa
    I dunno what exactly it's called, by cache refresh I mean, refresh the page after clearing its cache. I don't want to clear the entire browser cache. I prefer Chrome's Dev panel against firebug... don't ask me why. But I can't seem to cache refresh my pages. In FF, I know it to be Shift+Refresh. In chrome, I've tried Ctrl+R, Ctrl+Refresh, Alt+Refresh, Shift+Refresh but none of them work. EDIT: I got a Notable Question Badge for the lamest question I've ever asked. FML.

    Read the article

  • Double Timezone offset

    - by gAMBOOKa
    I have a timezone name and I want the name of the timezone double its offset. For instance, Asia/Dubai is +4, I want to double that to +8... and have it resolved to Asia/HonkKong Language: PHP Here's a sample of what it would look like: $timezone = "Asia/Dubai" $offset = $timezone->getOffset(); $offset *= 2; $timezone = $offset->getTimeZone(); Output: Asia/HonkKong

    Read the article

  • Quercus on Google App Engine: Class not loading

    - by gAMBOOKa
    Fatal Error: no matching class connection index.php <?php import database.connection; $connection = connection::get()->getPersistenceManager(); // ***ERROR HERE*** ?> connection.java package database; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManagerFactory; public final class connection { private static final PersistenceManagerFactory pmfInstance = JDOHelper.getPersistenceManagerFactory("transactions-optional"); private connection() {} public static PersistenceManagerFactory get() { return pmfInstance; } } Quercus is otherwise configured fine, PHP implementation works smoothly on GAE. But when I try to initialize classes, PHP can't find them. What am I doing wrong?

    Read the article

  • MySQL escape string help

    - by gAMBOOKa
    I have a pretty large insert statement something like INSERT INTO multimedia (filename, regex, flag) VALUES (('adsfavr.jpg', '<div id="title">', 0), (...), (...)); How do I prepare the query for MySQL.It's too long to do it manually. It includes double quotes so I can't use the php function mysql_real_escape_string()

    Read the article

  • Reverse Timezone offset

    - by gAMBOOKa
    I have a timezone name and I want the name of the timezone double its offset. For instance, Asia/Dubai is -4, I want to reverse that to -4... and have it resolved to EDT Language: PHP Here's a sample of what it would look like: $timezone = "Asia/Dubai" $offset = $timezone->getOffset(); $offset += 2*$offset; $timezone = $offset->getTimeZone(); Output: EDT

    Read the article

  • Ignore duplicates in regex pattern

    - by gAMBOOKa
    I have a regex pattern that searches for words in a text file. How do I ignore duplicates? For instance, take a look at this code $pattern = '/(lorem|ipsum|daboom|pahwal|ababaga)/i'; $num_found = preg_match_all( $pattern, $string, $matches ); echo "$num_found match(es) found!"; echo "Matched words: " . implode( ',', $matches[0] ); If I have more than one say lorem in the article, the output will be something like this 5 matches found! Matched words: daboom,lorem,lorem,lorem,lorem I want the pattern to only find the first occurrence, and ignore the rest, so the output should be: 2 matches found! Matched words: daboom,lorem

    Read the article

  • Form not sending full data

    - by gAMBOOKa
    I have a form with over 50 input fields. The input fields are divided into 5 jquery jabs within the form container. Here's a sample of what it looks like: <form action="admin/save" method="post" enctype="multipart/form-data"> <input type="hidden" name="type" value="department" /> <input type="hidden" name="id" value="21" /> <div id="tabs"> <ul> <li><a href="#tab-1">Tab 1</a><li> <li><a href="#tab-2">Tab 2</a><li> <li><a href="#tab-3">Tab 3</a><li> </ul> <div id="tab-1"> <label>Name</label> <input type="text" name="user-name" /> </div> <div id="tab-2"> <label>Address</label> <input type="text" name="user-address" /> </div> <div id="tab-3"> <label>Phone</label> <input type="text" name="user-phone" /> </div> </div> <input type="submit" value="Send" /> </form> I'm using PHP's Kohana framework, so admin maps to a controller, and save maps to the method action_save. When I output the $_POST variables in action_save, only 'type' and 'id' show up, all the other fields don't seem to submit their data. What could I be doing wrong?

    Read the article

  • What's holding up my PHP script?

    - by gAMBOOKa
    We've got a PHP crawler running on our web server. When the crawler is running, there are no cpu, memory or network bandwidth spikes. Everything is normal. But our website (also PHP), hosted on the same server, stops responding. Basically the crawler blocks any other php script from running. What could be the problem? EDIT: ** fsockopen is being used to download files to crawler! **

    Read the article

  • Help! I got a runaway PHP script. My server is down.

    - by gAMBOOKa
    I got a PHP script that is looping and will continue to do so for about another hour. How do I stop it. The script explicitly overrides the time out and the memory buffer. It's on a shared hosting server with cPanel installed. The entire website is down until the script completes. I had added a usleep(100000) statement, but it doesn't appear to work.

    Read the article

1 2  | Next Page >