Jump to content

Archived

This topic is now archived and is closed to further replies.

redarrow

[solved]paypal and activated not working cheers.

Recommended Posts

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

[code]
<?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;
}
}
  }
   }
?>
[/code]

Share this post


Link to post
Share on other sites
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 [b]$_SESSION['name'] = $record['name'];[/b]

after all that, you need to be more specific when you say "it doesn't work." what are you wanting it to do?

Share this post


Link to post
Share on other sites
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;

Share this post


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

Share this post


Link to post
Share on other sites

×

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.