Ver Mensaje Individual
  #20 (permalink)  
Antiguo 25/03/2010, 06:22
Avatar de Eleazan
Eleazan
 
Fecha de Ingreso: abril-2008
Ubicación: Ibiza
Mensajes: 1.879
Antigüedad: 16 años
Puntos: 326
Respuesta: Necesito ayuda con script en PHP urgente

Código PHP:
if (count($data) != 0) {
                        
$account_id $data['account_id'];
                        
$cash_points $data['cash_points'];
                        
                        
// Update Account, adding Cash Points
                        
$mysql->query("UPDATE `login` SET `cash_points` = `cash_points` + '" $options['CashPerSMS'] . "' WHERE `account_id` = '$account_id'");
                        
// Log Entry to the Database
                        
$mysql->query("INSERT INTO `smslog` (`account_id`, `userid`, `code`, `country`, `time`) VALUES ('$account_id', '$userid', '$code', '$country', NOW())");

                        
// Confirmation Message
                        // You can edit it but do not remove the first OK because it confirms to sepomo the SMS have been registered.
                        
echo 'OK Gracias por tu aporte. Tus Cash Points pronto estaran disponibles.';
                } 
Aqui, si te fijas en el insert, añade "CashPerSms" (q se configura al principio). En caso de querer cambiarlo, cambia ese valor.

Podrias hacer algo así
Código PHP:
if (count($data) != 0) {
                        
$puntos['VE'] = 10;
                        
$puntos['CH'] = 15//etc etc!
                        
$account_id $data['account_id'];
                        
$cash_points $data['cash_points'];
                        
                        
// Update Account, adding Cash Points
                        
$mysql->query("UPDATE `login` SET `cash_points` = `cash_points` + '" $puntos[$country] . "' WHERE `account_id` = '$account_id'");
                        
// Log Entry to the Database
                        
$mysql->query("INSERT INTO `smslog` (`account_id`, `userid`, `code`, `country`, `time`) VALUES ('$account_id', '$userid', '$code', '$country', NOW())");

                        
// Confirmation Message
                        // You can edit it but do not remove the first OK because it confirms to sepomo the SMS have been registered.
                        
echo 'OK Gracias por tu aporte. Tus Cash Points pronto estaran disponibles.';
                }