shahrukh1
-
Posts
10 -
Joined
-
Last visited
Posts posted by shahrukh1
-
-
need to extract the hash value from this string
id="Qform__FormState" value="c49c31100c139a92a85a1dc37fb399c5"
proposed expression:
$expression = '#^([a-z0-9]{32})$#i';
does not work
tried this one as well
$expression = '#id=\"Qform__FormState\" value=\"^([a-z0-9]{32})$\"#i';
no luck either
-
still unable to get it working.
-
okay so I updated the script
<?php $url = 'https://secure.chess.com/login'; $postfields = "c1=USERNAME&loginpassword=PASSWORD&rememberme=checked"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //curl_setopt($ch, CURLOPT_USERPWD, $password); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $response = curl_exec($ch); echo $response; ?>
it brings me to the login page of the chess.com website, not logged into the account, I'm assuming it is not working?
sample credentials:
opticalpalace : phpfreaks
-
I need to login into this webpage in order to get the contents of a certain page that only members have access too.
I decided to use cURL to do this instead of creating a stream for file_get_contents()
I am pretty new to cURL, but here is my attempt at this situation.
<?php $url = 'http://secure.chess.com/login'; $postfields = "c1=USERNAME&loginpassword=PASSWORD"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //curl_setopt($ch, CURLOPT_USERPWD, $password); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $response = curl_exec($ch); echo $response; ?>
as you may see, the webpage is chess.com/login (login url)
I am pretty sure the form credentials are
Username (which is name="c1")
Password (which is name="loginpassword")
the problem is that it replies back with
"301 Moved Permanently error"
-
thankyou, fixed with
"#id=[0-9]*\"#i"
-
trying to obtain:
href="/echess/game?id=61279056"I do not know the length of the digits, but it is closed with a quotation. I do not know the starting digit.
I do know, it will only be a number of unknown length
expression attempted with:
$expression = "#href=\"/echess/game?id=[0-9]*\"#i";
results:
Failed
-
thank you it works.
-
no cigar
what is the use of % instead of #?
-
I've read this thread
http://forums.phpfreaks.com/topic/12377-common-expressions/
I've tried to match my patter to extract the date from this
On:</td> <td><strong>9/30/12</strong></td>
here is my expression
"#On:</td>\s*<td><strong>\s*<td><strong>(1-9){1,2}[\/](1-9){1,2}[\/](1-9){1,2}</strong></td></strong></td>#i"
it is not working for me, please help
Hash Key?
in Regex Help
Posted
no i just need that value tag from a webpage
there is a snippet from the webpage