NameSilo

Php..free account help

Spaceship Spaceship
Watch
hi,

i have a script running it lets me enter the amount i want to charge for an account. so when someone signs up they go straight to the paypal pay page.

the problem is i want to be able to give accounts away for free using the script.I set the price via my script to $0.00, but it still send the user to the paypal site to pay the $0.00.

I have tried to get around this problem by added a mail form and doing it manualy. i dont like this method.

if any one can help please pm me or leave message here.

thanks

ps the web site is www.officelets.net
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Dear Fried-Chicken Send me NP$s at the earliest otherwise I 'll contact administrators!
 
Last edited by a moderator:
0
•••
hi,

i said i would pay 150 for the correct solution. to date i have not recieved the CORRECT SOLUTION. i gave you NP$30 just for trying, even though i never said i would give any np$ for trying.

I would count yourself lucky to recieve the NP$30.

I am a fair man, you may contact the admin. but i believe i have done no wrongs here.

sorry, but enjoy the NP$30
 
0
•••
gursimran2006, admittedly I don't see how you've solved the problem at all...

The solution would be to add an if statement before :

Code:
	if($_GET[PaymentGateway] == "paypal")
	{
		//paypal post
		header("location:https://www.paypal.com/xclick?business=$aset[PayPalEmail]&item_name=$a2[PackageName] for $a1[FisrtName] $a1[LastName] ($a1[username])&first_name=$a1[FirstName]&last_name=$a1[LastName]&email=$a1[email]&item_number=1&custom=$_SESSION[AgentID]|$_GET[SelectedPackage]&amount=$a2[PriceValue]&currency_code=GBP&notify_url=$site_url/notify.php&return=$site_url");


		exit();

	}

I don't know how does the price MySQL table look like, so I can't tell for sure.
But it will be along the lines of :

Code:
if($price == 0.00) {
       - CODE HERE - (Eg. Mail, etc.)
       die();
}
 
1
•••
Sorry fried chicken i really dont want to hurt you. actually you was not getting online after the sugession. so i thought that you duped me
sorry for that

jerometan thanks for that...

hope da problem is solved now


send 60 60 to both (if solved) :))

Reputation is just a click to you - the world to me
If you enjoyed trading with me, a TR would be great!

Requesting for rep makes you liable for -ve reps:))
 
0
•••
Has this been solved? If not, send me notify.php and the page this code is on and you'll have your solution in a few minutes.
 
0
•••
I've gotten plus rep for that post, just checked, so maybe its solved.
 
0
•••
0
•••
Tell me wat error are you getting now! are there any changes after a lot of editing or not?
 
0
•••
here is the script.

please some one help. offering NP$150 for the solution.
 
Last edited:
0
•••
I have downloaded the script, I will have a little look for you if I get time latter

Ok I have played arround with it a little and changed the payment.php page open it up, back it up and then save this as the page. For an item to be free set the price to 0.00

heres the code

PHP:
<?
require_once("conn.php");
require_once("includes.php");

if(empty($_GET[SelectedPackage]))
{
	header("location:prices.php?e=1&PaymentGateway=$_GET[PaymentGateway]");
}
elseif(empty($_GET[PaymentGateway]))
{
	header("location:prices.php?e=2&SelectedPackage=$_GET[SelectedPackage]");
}
else
{
	//get the price details
	$q1 = "select * from re2_prices where PriceID = '$_GET[SelectedPackage]' ";
	$r1 = mysql_query($q1) or die(mysql_error());
	$a1 = mysql_fetch_array($r1);

	//update the advertiser's record/credits
	$aexp =  mktime(0,0,0,date(m) + $a1[Duration],date(d),date(Y));

	//set the expire date
	//$q1 = "update re2_agents set PriorityLevel = '$a1[PriorityLevel]', offers = '$a1[offers]', ExpDate = '$aexp' where AgentID = '$_SESSION[AgentID]' ";
	//mysql_query($q1) or die(mysql_error());

	//get the agent details
	$q1 = "select * from re2_agents where AgentID = '$_SESSION[AgentID]' ";
	$r1 = mysql_query($q1) or die(mysql_error());
	$a1 = mysql_fetch_array($r1);

	//get the price details
	$q2 = "select * from re2_prices, re2_priority where re2_prices.PriceID = '$_GET[SelectedPackage]' and re2_prices.PriorityLevel = re2_priority.PriorityLevel ";
	$r2 = mysql_query($q2) or die(mysql_error());
	$a2 = mysql_fetch_array($r2);
	
	//Start chickers bit
	
    if($a2[PriceValue] == "0.00")
	 {
	 
	 
	 include_once("conn.php");

			$Addvertiserid = $_SESSION[AgentID];
			
			$PriceID = "0.00";

			//get the price details
			$q1 = "select * from re2_prices where PriceID = '$PriceID' ";
			$r1 = mysql_query($q1) or die(mysql_error());
			$a1 = mysql_fetch_array($r1);

			//update the advertiser's record/credits
			$aexp =  mktime(0,0,0,date(m) + $a1[Duration],date(d),date(Y));

			//$_SESSION[AccountExpireDate] = $aexp;
			//$_SESSION[AccountStatus] = "active";
			//$_SESSION[MaxOffers] = $a1[offers];

			$_SESSION[AgentID] = "";

			$q2 = "update re2_agents set ExpDate = '$aexp', AccountStatus = 'active', PriorityLevel = '$a1[PriorityLevel]', offers = '$a1[offers]' where AgentID = '$Addvertiserid' ";
			mysql_query($q2) or die(mysql_error());
	 
	 }
	 
	 //end chickers bit
	 
	if($_GET[PaymentGateway] == "paypal")
	{
		//paypal post
		header("location:https://www.paypal.com/xclick?business=$aset[PayPalEmail]&item_name=$a2[PackageName] for $a1[FisrtName] $a1[LastName] ($a1[username])&first_name=$a1[FirstName]&last_name=$a1[LastName]&email=$a1[email]&item_number=1&custom=$_SESSION[AgentID]|$_GET[SelectedPackage]&amount=$a2[PriceValue]&notify_url=$site_url/notify.php&return=$site_url");

		exit();

	}
	elseif($_GET[PaymentGateway] == "stormpay")
	{
		header("location:https://www.stormpay.com/stormpay/handle_gen.php?generic=1&vendor_email=$aset[sp_vendor_email]&payee_email=$aset[sp_payee_email]&transaction_ref=$_SESSION[AgentID]|$_GET[SelectedPackage]&product_name=$a2[PackageName] for $a1[FisrtName] $a1[LastName] ($a1[username])&amount=$a2[PriceValue]&require_IPN=1&notify_URL=$site_url/sp_notify.php&return_URL=$site_url");
      
		exit();
	}
	elseif($_GET[PaymentGateway] == "2checkout")
	{
		// 2checkout redirect
		header("location:https://www.2checkout.com/cgi-bin/sbuyers/cartpurchase.2c?sid=$aset[SellerID]&total=$a2[PriceValue]&cart_order_id=$_SESSION[AgentID]|$_GET[SelectedPackage]&card_holder_name=$a1[FirstName] $a1[LastName]&email=$a1[email]&phone=$a1[phone]");	
	}
	else
	{
		//manual

		//send an email to the admin
		$to = $aset[ContactEmail];
		$subject = "Manual Service Activation Request";
		$message = "A client has selected Manual Service Activation\nHere are the details:\n\n";
		$message .= "Username: $a1[username]\nNames: $a1[FirstName] $a1[LastName]\nSelected Package: $a2[PackageName] $a2[PriorityName], $a2[Duration] months, $a2[offers] offers\n\n";

		$headers = "MIME-Version: 1.0\n"; 
		$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
		$headers .= "Content-Transfer-Encoding: 8bit\n"; 
		$headers .= "From: $_SERVER[HTTP_HOST] <$aset[ContactEmail]>\n"; 
		$headers .= "X-Priority: 1\n"; 
		$headers .= "X-MSMail-Priority: High\n"; 
		$headers .= "X-Mailer: PHP/" . phpversion()."\n"; 

		mail($to, $subject, $message, $headers);		

		//get the templates
		require_once("templates/HeaderTemplate.php");
		require_once("templates/ManualTemplate.php");
		require_once("templates/FooterTemplate.php");
	}

}

?>

Tell me if that works or not,

Andy
 
0
•••
ive tried once before.

the result is that the script takes you to the paypal page where it asks for payment of 0.00

even if it this is not fill in no acount is set up
 
0
•••
Have you coppied that whole page? Oh I just noticed one error, changing it now


PHP:
<?
require_once("conn.php");
require_once("includes.php");

if(empty($_GET[SelectedPackage]))
{
    header("location:prices.php?e=1&PaymentGateway=$_GET[PaymentGateway]");
}
elseif(empty($_GET[PaymentGateway]))
{
    header("location:prices.php?e=2&SelectedPackage=$_GET[SelectedPackage]");
}
else
{
    //get the price details
    $q1 = "select * from re2_prices where PriceID = '$_GET[SelectedPackage]' ";
    $r1 = mysql_query($q1) or die(mysql_error());
    $a1 = mysql_fetch_array($r1);

    //update the advertiser's record/credits
    $aexp =  mktime(0,0,0,date(m) + $a1[Duration],date(d),date(Y));

    //set the expire date
    //$q1 = "update re2_agents set PriorityLevel = '$a1[PriorityLevel]', offers = '$a1[offers]', ExpDate = '$aexp' where AgentID = '$_SESSION[AgentID]' ";
    //mysql_query($q1) or die(mysql_error());

    //get the agent details
    $q1 = "select * from re2_agents where AgentID = '$_SESSION[AgentID]' ";
    $r1 = mysql_query($q1) or die(mysql_error());
    $a1 = mysql_fetch_array($r1);

    //get the price details
    $q2 = "select * from re2_prices, re2_priority where re2_prices.PriceID = '$_GET[SelectedPackage]' and re2_prices.PriorityLevel = re2_priority.PriorityLevel ";
    $r2 = mysql_query($q2) or die(mysql_error());
    $a2 = mysql_fetch_array($r2);
    
    //Start chickers bit
    
    if($a2[PriceValue] == "0.00")
     {
     
     
     include_once("conn.php");

            $Addvertiserid = $_SESSION[AgentID];
            
            $PriceID = "0.00";

            //get the price details
            $q1 = "select * from re2_prices where PriceID = '$PriceID' ";
            $r1 = mysql_query($q1) or die(mysql_error());
            $a1 = mysql_fetch_array($r1);

            //update the advertiser's record/credits
            $aexp =  mktime(0,0,0,date(m) + $a1[Duration],date(d),date(Y));

            //$_SESSION[AccountExpireDate] = $aexp;
            //$_SESSION[AccountStatus] = "active";
            //$_SESSION[MaxOffers] = $a1[offers];

            $_SESSION[AgentID] = "";

            $q2 = "update re2_agents set ExpDate = '$aexp', AccountStatus = 'active', PriorityLevel = '$a1[PriorityLevel]', offers = '$a1[offers]' where AgentID = '$Addvertiserid' ";
            mysql_query($q2) or die(mysql_error());
echo "Payment was free, succesfully done";
     
     }
     
     //end chickers bit
     
    elseif($_GET[PaymentGateway] == "paypal")
    {
        //paypal post
        header("location:https://www.paypal.com/xclick?business=$aset[PayPalEmail]&item_name=$a2[PackageName] for $a1[FisrtName] $a1[LastName] ($a1[username])&first_name=$a1[FirstName]&last_name=$a1[LastName]&email=$a1[email]&item_number=1&custom=$_SESSION[AgentID]|$_GET[SelectedPackage]&amount=$a2[PriceValue]&notify_url=$site_url/notify.php&return=$site_url");

        exit();

    }
    elseif($_GET[PaymentGateway] == "stormpay")
    {
        header("location:https://www.stormpay.com/stormpay/handle_gen.php?generic=1&vendor_email=$aset[sp_vendor_email]&payee_email=$aset[sp_payee_email]&transaction_ref=$_SESSION[AgentID]|$_GET[SelectedPackage]&product_name=$a2[PackageName] for $a1[FisrtName] $a1[LastName] ($a1[username])&amount=$a2[PriceValue]&require_IPN=1&notify_URL=$site_url/sp_notify.php&return_URL=$site_url");
      
        exit();
    }
    elseif($_GET[PaymentGateway] == "2checkout")
    {
        // 2checkout redirect
        header("location:https://www.2checkout.com/cgi-bin/sbuyers/cartpurchase.2c?sid=$aset[SellerID]&total=$a2[PriceValue]&cart_order_id=$_SESSION[AgentID]|$_GET[SelectedPackage]&card_holder_name=$a1[FirstName] $a1[LastName]&email=$a1[email]&phone=$a1[phone]");    
    }
    else
    {
        //manual

        //send an email to the admin
        $to = $aset[ContactEmail];
        $subject = "Manual Service Activation Request";
        $message = "A client has selected Manual Service Activation\nHere are the details:\n\n";
        $message .= "Username: $a1[username]\nNames: $a1[FirstName] $a1[LastName]\nSelected Package: $a2[PackageName] $a2[PriorityName], $a2[Duration] months, $a2[offers] offers\n\n";

        $headers = "MIME-Version: 1.0\n"; 
        $headers .= "Content-type: text/plain; charset=iso-8859-1\n";
        $headers .= "Content-Transfer-Encoding: 8bit\n"; 
        $headers .= "From: $_SERVER[HTTP_HOST] <$aset[ContactEmail]>\n"; 
        $headers .= "X-Priority: 1\n"; 
        $headers .= "X-MSMail-Priority: High\n"; 
        $headers .= "X-Mailer: PHP/" . phpversion()."\n"; 

        mail($to, $subject, $message, $headers);        

        //get the templates
        require_once("templates/HeaderTemplate.php");
        require_once("templates/ManualTemplate.php");
        require_once("templates/FooterTemplate.php");
    }

}

?>

That should now work, forgot to add an else ps I did not add an interface to it
 
0
•••
Did this work? if not can you send me a copy of the database so I can replicate this.
 
0
•••
hi chicker,

not at home right now will check first thing tomorrow morning.

thanks
 
0
•••
0
•••
If you want a real solution then stop using the script and use ccavenue which I use

I think i 've already provided you correct solution. If it doesn't work then use ccavenue
 
0
•••
gursimran2006 said:
If you want a real solution then stop using the script and use ccavenue which I use

I think i 've already provided you correct solution. If it doesn't work then use ccavenue


If you solved this then fried chicken would of said!
 
0
•••
hi,

just tried your suggestion.

it doesnt seem to work. have a go registering.

hope this can be sorted
 
0
•••
Is it printing anything? or does it still go to paypal?
 
0
•••
its seems to be doing something.

however the account isnt being activated.
 
0
•••
Ok I think that the best way I test this is probably on a backup server/ testing server, can you pm me a copy of the database, does not have to be the full records etc just a few so I can test.
 
0
•••
I'm a bit busy at the moment, but ill help as soon as im free. gursimran2006 please stop bugging him for $NP, he didn't initially offer any $NP and just said he would give some as a sign of his gratitude, don't go begging for $NP it doesn't make you look good and certainly doesn't boost your rep.
 
0
•••
hi chicker, the script you downloaded was the only thing i have. it creates the database its self. i do however have the install.php which was not in the file you downloaded.
i'll send it to you via pm


cheers for understanding and your comments beaver
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back