Thread: H-Tracker v2
View Single Post
  #56  
Old 13th May 2009, 22:07
raefor's Avatar
raefor raefor is offline
Senior Member
 
Join Date: Mar 2008
United States
Posts: 90
Default
Quote:
Originally Posted by razvaneluu View Post
how to integrate a sms payment ?
can give this a try

It's configured to work with mosms.com


Here is the SQL:

PHP Code:
ALTER TABLE `usersADD `cellvarchar(255NOT NULL default ''
Create a new .php file calledsms1.php and add this:

PHP Code:
<?
ob_start
("ob_gzhandler");
require 
"backend/functions.php";
dbconn(true);
loggedinorreturn();
stdhead();
begin_frame("SMS Donation");

  
$curre $CURUSER['username'];
  
$cell $_POST['cell'];

echo(
"<h2>SMS donation (25 SEK) Step 1/3</h2>");

?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="POST">
What cellphone number will you donate from?<br>
OBS! Type your cellphone number below. See the example.<br><br>
<input type="text" name="cell"><br>
<i>example: 0701234567</i>
<br><br>
<input type="submit" name="submit" value="Continue">
</form>

<?

if($_POST['submit'] && $_POST['cell']){
  
mysql_query("UPDATE users SET cell = '$cell' WHERE username = '$curre'");
  
header("Location: sms2.php");
  }

end_frame();
stdfoot();
?>
Then make a new one again called sms2.php and add this:

PHP Code:
<?
ob_start
("ob_gzhandler");
require 
"backend/functions.php";
dbconn(false);
loggedinorreturn();
stdhead();
begin_frame("SMS Donation");

echo(
"<h2>SMS donation (25 SEK) Step 2/3</h2><br>");
echo(
"Send a SMS to 72550 with the following information: ");
echo(
"<b>");
echo(
"SILVTORR"); // YOUR PREFIX HERE
echo("</b><br><br>");
?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="GET">
<input type="submit" name="submit" value="Continue">
</form>

<?

if($_GET['submit']){
header("Location: sms3.php");
}
end_frame();
stdfoot();
?>
Then make a new again called sms3.php and add:

PHP Code:
<?
require "backend/functions.php";
dbconn(false);
loggedinorreturn();
stdhead();
begin_frame("SMS Donation");

echo(
"<h2>SMS donation (25 SEK) Step 3/3</h2>");


echo(
"Your donation should now be complete!<br> You will notice this with a star beside your nickname!<br><br> The staff at silvertorrents.org are graceful for your donation and are hoping that you will like us.");


end_frame();
stdfoot();
?>
and now the final one to create, name it takesms.php and add this:

PHP Code:
<?php
require "backend/functions.php";
dbconn(true);

$nr $_REQUEST['nr']; // Cellphone number donation came from
$donated $_REQUEST['tariff']; // How much that have been donated
$curre $CURUSER['username'];
$qry "UPDATE users SET donated = '$donated' WHERE cell = '$nr'"// Remove this line if you dont have the donation mod or the donated column in your sql 
$qry2 "UPDATE users set donor = 'yes' WHERE cell = '$nr'";
mysql_query($qry); // Remove this line if you dont have the donation mod or the donated column in your sql
mysql_query($qry2);

echo(
"Thank you for your donation! You are helping us to continue to run our activity //Staff"); //This is the SMS to the cellphone
?>
This script is configured to work with the swedish site www.mosms.com.
If you have another SMS site that you want this script to work with just easily change the $_REQUEST variables in takesms.php. If you want help with that i can probably help you out there.

Ofcource you need to have a registered account at mosms if you want this script to work. Just simply link your connection @ mosms to takesms.php . Its really simple but i can also help you with that if you dont get it to work.

Also be sure to have no errors in takesms.php or add this line -> error_reporting(0); . If you have errors in your takesms.php code it will be sent to the cellphone. Why? Well because everything you are echoing in the takesms.php file will be sent to the cellphone. So if you have any errors in your takesms.php the error msg will be sent to the cellphone.

Thats it i'll hope you will like this mod and if you have any questions just ask.

Cheers

Edit: For you who want to use mosms and don't understand swedish here is a quick guide:

MOSMS connection:

1. Create an account @ mosms

2. Login to your mosms account

3. Choose the option "Ta betalt med sms"

4. Choose the option "L
Reply With Quote