Note that there are some explanatory texts on larger screens.

plurals
  1. POTrying to use preg_match on extracted html page but this is perplexing me
    primarykey
    data
    text
    <p>I've been trying the below script (within a larger app I'm working on) for hours now and I just can't understand what the problem is, no matter what I get "Notice: Undefined offset: 1" meaning that its having some problem putting the result into an array from the preg_match... I did a process that was nearly identical to a similar page earlier and it worked fine.. I would greatly appreciate any advice as I just don't know what to do at this point as I've already spent hours trying to troubleshoot this, I don't have tons of regex experience but I have used it a fair amount and I just can't figure out what could be preventing this from working correctly.</p> <pre><code> &lt;blink&gt; &lt;?PHP $email_saved_page = ' &lt;meta name="viewport" content="width=device-width"/&gt; &lt;title&gt;Sign in to Hushmail Mobile&lt;/title&gt; &lt;style type="text/css"&gt; div#logo{padding:0.3em;} /* */ body{font-family:Arial;font-size:0.8em;margin:0em;} h2{padding:0.3em;color:#fff;font-weight:bold;background- color:#006699;font- size:1.1em;margin:0em;padding-left:0.3em;} h2 a{color:#fff;text-decoration:none;padding:0.3em;padding-left:0em;width:100%;} /* */ div.content{padding:0.4em;} div.menu{padding:0.3em;padding-left:0em;} /* */ div.user{background-color: #D7E4F0;padding:0.5em;margin-bottom:0.5em;} /* */ div.noticeContainer{padding-top:0.1em;} div.success{background-color:#54b067;} div.error{background-color:#aa4444;} div.info{background-color:#ff9900;} div.notice{padding:0.5em;color:#fff;font-weight:bold;} div.notice a{color:#fff;text-decoration:none;} /* */ div.search_results{margin-bottom:1em;} div.search_results h4{margin-bottom:0em;} /* */ div.listItem{border-bottom:dotted 1px #ccc;padding:0.5em;padding-left:0em;padding- right:0em;} div.listItem a.subject{font-size:1.2em;} div.listItem div.unread{font-weight:bold;} span.date{color:green;} /* */ div.headers{padding-top:1em;padding-bottom:1em;} div.headers label{font-weight:bold;} div.messageBodyContainer{padding-top:1em;padding-bottom:1em;} div.message{border-left:solid 3px #eee;padding-left:0.5em;padding-right:0.5em;} div.messageTruncated{background-color:#eee;padding:0.5em;} /* */ .background{background-color:#f0f0f0;padding:0.3em;} /* */ form#compose label.block{display:block;} /* */ .copy {padding-top: 1em;color: #aaa;} &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="logo"&gt; &lt;"/authentication?next_webapp_name=hushmail5&amp;amp;next_webapp_url_name=m&amp;skin=mobile"&gt; branding/hushmailcom/image/logo_small" border="0"/&gt;&lt;/a&gt; &lt;/div&gt; &lt;h2&gt;Sign in&lt;/h2&gt; &lt;div class="content"&gt; &lt;div class="noticeContainer" id="authenticationform_hush_username" style="display: none;padding: ;width: "&gt; &lt;/div&gt; &lt;div class="noticeContainer" id="authenticationform_hush_passphrase" style="display: none;padding: ;width: "&gt; &lt;/div&gt; &lt;div class="noticeContainer" id="authenticationform_hush_remember_me" style="display: none;padding: ;width: "&gt; &lt;/div&gt; &lt;form name="authenticationform" id="authenticationform" action="/authentication/login?skin=mobile&amp;next_webapp_name=hushmail5&amp; amp;next_webapp_url_name=m" method="post"&gt; &lt;input type="hidden" name="form_token" value="a476281f4d85"/&gt; &lt;input type="hidden" name="next_webapp_page" value="folder/INBOX/1"/&gt; &lt;p&gt;&lt;label for="hush_username"&gt;Email address:&lt;/label&gt;&lt;br/&gt; &lt;input type="email" name="hush_username" id="hush_username" value="benjuuuhvvihushmailcom"/&gt;&lt;/p&gt; &lt;p&gt;&lt;label for="hush_passphrase"&gt;Passphrase:&lt;/label&gt;&lt;br/&gt; &lt;input type="password" name="hush_passphrase" id="hush_passphrase" maxlength="1000" value=""/&gt;&lt;/p&gt; &lt;p&gt;&lt;input type="checkbox" name="hush_remember_me" id="hush_remember_me" value="on" /&gt;&lt;label for="hush_remember_me"&gt;Stay signed in when I close my browser&lt;/label&gt;&lt;/p&gt; &lt;p&gt;&lt;input type="submit" value="Sign In"/&gt;&lt;/p&gt; &lt;input type="hidden" name="hush_customerid" value="0000000000000000"/&gt; &lt;/form&gt; &lt;p&gt;&lt;a href="/m/about" title="About"&gt;About&lt;/a&gt;&lt;/p&gt; &lt;p&gt;To learn more about Hushmail, please visit &lt;wwwhushmailcom/" title="Hushmail - Free Email with Privacy" &gt;wushmailc/&lt;/a&gt; on your computer.&lt;/p&gt; &lt;/div&gt; &lt;!-- --&gt; &lt;div class="content copy"&gt; &amp;copy; 2008-2010 Hush Communications Ltd. &lt;/div&gt; '; $preg_string = '%&lt;label&gt;From:&lt;/label&gt;(.*)&lt;br&gt;%' ; preg_match($preg_string, $email_saved_page, $res); $email_from = $res[1]; echo $email_from ; ?&gt; &lt;/blink&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload