Jump to content

Aureole

Members
  • Posts

    788
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Aureole's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. That's the port.........................................................
  2. I'm trying to connect to an IRC Server with PHP and I always get an error similar to this: Warning: fsockopen() [function.fsockopen]: unable to connect to irc.quakenet.org:6667 in /home/veraci7y/public_html/playground/connecttoirc.php on line 29 <?php $server_host = "irc.quakenet.org"; $server_port = 6667; $server_chan = "#help"; // Line 29: $server['SOCKET'] = fsockopen( $server_host, $server_port, $errno, $errstr, 2 ); ?>
  3. About the Google thing, it turns out I was searching *too* specifically. Here's what I have so far and it doesn't work, it just shows the sign in page. <?php $url = "http://login.live.com/login.srf?wa=wsignin1.0&rpsnv=10&ct=1206715726&rver=4.5.2135.0&wp=MBI&wreply=https:%2F%2Flive.xbox.com%2Fxweb%2Flive%2Fpassport%2FsetCookies.ashx%3Frru%3DhttpZ3AZ2FZ2FwwwZ2ExboxZ2EcomZ2FenZ2DUSZ2FdefaultZ2Ehtm&lc=1033&cb=B001033httpZ3AZ2FZ2FwwwZ2ExboxZ2EcomZ2FenZ2DUSZ2FdefaultZ2Ehtm&id=66262"; $c = curl_init(); curl_setopt( $c, CURLOPT_URL, $url ); curl_setopt( $c, CURLOPT_POST, 2 ); curl_setopt( $c, CURLOPT_POSTFIELDS, "i0116=emailaddresshere" ); curl_setopt( $c, CURLOPT_POSTFIELDS, "i0118=passwordhere" ); $result1 = curl_exec( $c ); curl_close( $c ); print $result; ?>
  4. I'm just going to go ahead and give this a bump, I still can't find any information via Google.
  5. I'm not too familiar with cURL or sockets and I can't find ANYTHING on the web that helps. If anyone has any example code laying around, or doesn't mind writing some then it would be most appreciated.
  6. Here's basically what I want to do: I will put my Windows Live ID email address and password into a PHP script and then: Sign in to Xbox.com with the email address and password, in the background. Once signed in, open the Messages page, in the background. Check for new messages. Show them. I will be able to work out how to check and show the messages on my own, it's the background stuff I need help with. I'm assuming I'll need to use sockets etc. but I can't find a tutorial or anything on Google on how to do something like this.
  7. Sorry, I checked google and I didn't find any results that helped. I tried both a domain and an IP Address. This is basically all you need, right? <?php $this->vars['db_host'] = 'veraci7y.net'; $this->vars['db_user'] = '...'; $this->vars['db_pass'] = '...'; $this->connection = mysql_connect( $this->vars['db_host'], $this->vars['db_user'], $this->vars['db_pass'] ) or die( 'Connection error: ' . mysql_error() ); ?>
  8. The error is basically the same: Connection error: Lost connection to MySQL server at 'reading initial communication packet', system error: 110
  9. I am getting the following error: Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 110 in /home/gamingre/public_html/alpha/sources/classes/class_database.php on line 26
  10. Thanks a lot, I shall give it a try now.
  11. I have 2 servers, I'd like to use one for the database, images and css and another for all of the php. How do I go about accessing another server's database?
  12. I changed the function as you stated and I have fixed the connection problem, silly error on my part... I created a new topic with my new problem, been as though this topic was basically to do with the connection problem. Here's a link to the topic It explains everything a lot better. Consider this topic solved.
  13. Ok, basically, I taught myself PHP by reading tutorials and taking apart other people's code, not sure if other people have done the same, but anyway... No doubt, a lot of the code I used to taught myself was old and/or outdated. When I'm approaching login, this is basically what I do. <?php $ln = md5( $_POST['login_name'] ); $pa = md5( $_POST['password'] ); $query = "SELECT * FROM `members` WHERE `login_name` = '{$ln}' AND `password` = '{$pa}'"; $result = mysql_query( $query ); if( $result ) { echo( 'Login successful.' ); } else { echo( 'Login unsuccessful.' ); } ?> Now that's all fine and dandy and it has always worked for me, but now I've started to use classes and functions it doesn't work out. <?php $ln = md5( $_POST['login_name'] ); $pa = md5( $_POST['password'] ); $db->select( '*', 'members', array( 'mem_lname' => $ln, 'mem_pass' => $pa ) ); $db->exec_query(); /* $exec_query performs mysql_query() on the query created with $db->select and returns it within $db->result Now the problem is, the following statement always evaluates to true */ if( $db->result ) { echo( 'Login successful.' ); } else { echo( 'Login unsuccessful.' ); } /* If I get rid of the above statement and do this: $db->fetch_assoc(); var_dump( $db->assoc ); ...it works as expected, so my query is well formed and is being executed echo( $db->result ); would produce a resource id, unless of course I enter incorrect details and $db->assoc contains all the data from the database, again, unless I enter incorrect details. */ ?> So what should I do to check if the login was successful, now that if( $db->result) doesn't work?
  14. I've always used num_rows for this... oh well, I'll try affectected_rows.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.