Jump to content

[solved]paypal and activated not working cheers.


redarrow

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]
Link to comment
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?
Link to comment
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;
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.