Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Would this work for AutoVIP?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="DiverseLulz" data-source="post: 65216" data-attributes="member: 7445"><p>I found this on os & as the title says Would this work? I have the buy button above it But that doesn't need to be included</p><p>[CODE]<?php</p><p>define('USERNAME_REQUIRED', TRUE);</p><p>define('ACCOUNT_REQUIRED', TRUE);</p><p>include('global.php');</p><p>define("THIS_SCRIPT", 'buy');</p><p>if(isset($_GET['u']))</p><p>{</p><p>$username = $core->EscapeString($_GET['u']);</p><p>}</p><p>else</p><p>{</p><p>$username = $core->EscapeString($_SESSION['username']);</p><p>}</p><p> </p><p> </p><p>function write2LogFile( $message, $file = "mylog.txt" ) { $file = fopen($file, "a"); fputs($file, "[".date('d-m-Y')."] ".$message."\n"); fclose($file); }</p><p>$req = 'cmd=_notify-validate';</p><p>foreach ($_POST as $key => $value)</p><p>{</p><p> $value = urlencode(stripslashes($value));</p><p> $req .= "&$key=$value";</p><p>}</p><p>$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";</p><p>$header .= "Content-Type: application/x-www-form-urlencoded\r\n";</p><p>$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";</p><p>$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30);</p><p>if (!$fp) {</p><p> write2LogFile( "ERROR Can not connect to paypal!" );</p><p>}</p><p>else</p><p>{</p><p> fputs ($fp, $header . $req);</p><p> while (!feof($fp))</p><p> {</p><p> $res = fgets ($fp, 1024);</p><p> if (strcmp ($res, "VERIFIED") == 0)</p><p> {</p><p> $payment_status = $_POST['payment_status'];</p><p> $transaction_id = $_POST['txn_id'];</p><p> $payer_email = $_POST['payer_email'];</p><p> $custom_field = $_POST['custom'];</p><p> </p><p> if ( $payment_status == 'Completed' )</p><p> { </p><p> // Make the user VIP</p><p>mysql_query("UPDATE users SET rank = '2' WHERE username='$username'");</p><p> }</p><p> </p><p>{ </p><p> // Make the user VIP</p><p>mysql_query("UPDATE users SET vip = '1' WHERE username='$username'");</p><p> }</p><p> </p><p> else if ( $payment_status == 'Canceled_Reversal' )</p><p> {</p><p> // Ban the account</p><p>mysql_query("INSERT INTO bans (bantype, value, reason, expire, added_by, appeal_state)</p><p>VALUES ('user', '$username', 'Disputing/Claiming the payment', 'system', '1')");</p><p> </p><p> }</p><p> }</p><p> }</p><p> fclose ($fp);</p><p>}</p><p>?></p><p>[/CODE]</p><p>One of the replies states this </p><p></p><p> </p><p>So? Will it, Should it Could it, And would it work? If you think or know it doesn't would you mind explaining how to set it up in a well written explanation. I know this post makes hardly any sense :< Anyways,</p><p>Thanks in advance.</p></blockquote><p></p>
[QUOTE="DiverseLulz, post: 65216, member: 7445"] I found this on os & as the title says Would this work? I have the buy button above it But that doesn't need to be included [CODE]<?php define('USERNAME_REQUIRED', TRUE); define('ACCOUNT_REQUIRED', TRUE); include('global.php'); define("THIS_SCRIPT", 'buy'); if(isset($_GET['u'])) { $username = $core->EscapeString($_GET['u']); } else { $username = $core->EscapeString($_SESSION['username']); } function write2LogFile( $message, $file = "mylog.txt" ) { $file = fopen($file, "a"); fputs($file, "[".date('d-m-Y')."] ".$message."\n"); fclose($file); } $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); if (!$fp) { write2LogFile( "ERROR Can not connect to paypal!" ); } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { $payment_status = $_POST['payment_status']; $transaction_id = $_POST['txn_id']; $payer_email = $_POST['payer_email']; $custom_field = $_POST['custom']; if ( $payment_status == 'Completed' ) { // Make the user VIP mysql_query("UPDATE users SET rank = '2' WHERE username='$username'"); } { // Make the user VIP mysql_query("UPDATE users SET vip = '1' WHERE username='$username'"); } else if ( $payment_status == 'Canceled_Reversal' ) { // Ban the account mysql_query("INSERT INTO bans (bantype, value, reason, expire, added_by, appeal_state) VALUES ('user', '$username', 'Disputing/Claiming the payment', 'system', '1')"); } } } fclose ($fp); } ?> [/CODE] One of the replies states this So? Will it, Should it Could it, And would it work? If you think or know it doesn't would you mind explaining how to set it up in a well written explanation. I know this post makes hardly any sense :< Anyways, Thanks in advance. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Would this work for AutoVIP?
Top