Jump to content


Photo

[solved]paypal and activated not working cheers.


  • Please log in to reply
4 replies to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 23 August 2006 - 04:38 AM

can someone help the person with the paypal payment and activated does not seem to work please help cheers.

<?php

if(($name)&&($password)){

$query="select * from members where name='$name' and password='$password'";

$result=mysql_query($query);

while($record=mysql_fetch_assoc($result)){

if(mysql_num_rows($result)==1){

$id=$record['id'];
$password=$record['password'];
$name=$record['name'];

session_register('name');
session_register('password');
session_register('id');

if($record['email_activated']=="yes"){

header("location: payment_plan.php");
exit;

}elseif

(($record['email_activated']=="yes")&&($record['paypal_payment_payed']=="yes")){
header("location: members_area.php");
exit;
}
 }
  }
   }
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#2 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 23 August 2006 - 04:50 AM

well first off, youre elseif will never be executed, because the only way it will be true is if the first argument is true, in which case your original if statement would have been true and that would have executed instead of the elseif. 

2nd, if you are only expecting and wanting to execute code based on 1 row returned, ditch the while loop, and simply do your fetch_assoc inside your if statement.

3rd, assigning the values of $record to your variables and then registering them is redundant, and if i'm not mistaken, session_register is depreciated. instead, you should simply do $_SESSION['name'] = $record['name'];

after all that, you need to be more specific when you say "it doesn't work." what are you wanting it to do?
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 23 August 2006 - 04:53 AM

i want this conndition


how can  i get both condition to work one or the other then cheers.

if($record['email_activated']=="yes"){

header("location: payment_plan.php");
exit;

}elseif

(($record['email_activated']=="yes")&&($record['paypal_payment_payed']=="yes")){
header("location: members_area.php");
exit;
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 23 August 2006 - 04:56 AM

okay i think what you are wanting to do is this:
if ($record['email_activated']=="yes") {
  if ($record['paypal_payment_payed']=="yes") {
      header("location: members_area.php");
      exit;
  } else {
      header("location: payment_plan.php");
      exit;
  }
}

Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#5 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 23 August 2006 - 05:05 AM

thank you solved
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users