Jump to content

Panta

Members
  • Content Count

    115
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Panta

  • Rank
    Member

Contact Methods

  • Website URL
    http://
  • ICQ
    0

Profile Information

  • Location
    Nigeria
  • Interests
    dreams that will come true, One day i will stand and say "i've gotten what i want"

Recent Profile Visitors

3,891 profile views
  1. thanks so much, i checked db.php and saw spaces causing it.
  2. Thanks for effort, i printed it and the number is "1", i wish to know if there is another possible cause for it not redirecting
  3. tried this and is not relocating
  4. I tried this and it will not relocate to the address
  5. Please i dont know why the my little code do not run the header function - header('Location: http://www.example.com/'); Please i need ans. thanks <?php session_start(); //start the session for the page include("db.php"); //include database file //Check if page was entered by a submit button $user_name=$_POST['user_name']; //Get username !!FROM FORM!! $password=($_POST['password']); //Get name !!FROMFORM!! if (!empty($user_name) && !empty($password)) { $ck=$flash->prepare("SELECT * FROM `data` WHERE `user`=:user_name AND `password`=:password "); //get rows where the username or email address is allready registered $ck->bindParam(':user_name',$user_name); $ck->bindParam(':password',$password); $ck->execute(); //if email address allready excists if($ck->rowCount() > 0) { header('Location: http://www.example.com/'); }} ?>
  6. the code is working fine.and printing see, the problem is getting the code to stop running after doing the job
  7. i want a loop that will update all the rows in a table that met a certain condition.
  8. Good day, please i want to update all that the time has elapsed a table (merged). I want the script to check for all that the current time is equals or greater than a fixed time. and update the colom (receiver). This i want the script to do see my code i tried using do-while but is not working <?php include "../../include/db.php"; $mergestatus="no"; $awaiting='awaiting'; $exp_to_donate='1'; $exp_tobe_paid='2'; $paidto_redonate='3'; $redonated_exp_balance='4'; //adding time db just to get time $new = $flash->query("SELECT * FROM `user` WHERE merged='awaiting' AND active='yes'"); if($new->rowCount() > 0){ echo "see"; $newrecord = $new->fetch(); $newsender=$newrecord['email']; echo $newsender; //adding time db just to get time $timeget = $flash->query("SELECT * FROM `merge` WHERE status='0' AND sender='$newsender'"); if($timeget->rowCount() > 0){ $xxx = $timeget->fetch(); $timeget_xtime=strtotime($xxx['xtime']); $currentTimestamp = strtotime(date('Y-m-d H:i:s')); $payment_time= date("Y-m-d H:i:s",strtotime(date("Y-m-d H:i:s")." +3 hours"));//adding 3hrs to the current time if($currentTimestamp >=$timeget_xtime ) { //checking for who to pay $placecheck = $flash->query("SELECT * FROM `user` WHERE `active`='yes' AND `right`='0' AND `merged`='no' AND (`level`='$exp_tobe_paid' OR `level`='$redonated_exp_balance') LIMIT 1"); if($placecheck->rowCount() > 0){ $ddd = $placecheck->fetch(); $togethelp=$ddd['email']; $gonow = $flash->query("UPDATE `merge` SET `receiver`='$togethelp',`payment_time`='$payment_time' WHERE `sender`='$newsender'"); $up= $flash->query("UPDATE `user` SET merged='yes' WHERE email IN ('$newsender','$togethelp')"); }//if there is someone active and not admin else{ $placeadmin = $flash->query("SELECT * FROM `user` WHERE `right`='1' LIMIT 1"); $profinadmin = $placeadmin->fetch(); $togethelpadmin=$profinadmin['email'];//sponsor email $payment_time= date("Y-m-d H:i:s",strtotime(date("Y-m-d H:i:s")." +3 hours"));//adding 3hrs to the current time $gonowadmin = $flash->query("UPDATE `merge` SET `receiver`='$togethelpadmin',`payment_time`='$payment_time' WHERE `sender`='$newsender'"); $upadmin= $flash->query("UPDATE `user` SET merged='yes' WHERE (`email`='$newsender')"); } }//if current time is above do{ //checking for who to pay $placecheck = $flash->query("SELECT * FROM `user` WHERE `active`='yes' AND `right`='0' AND `merged`='no' AND (`level`='$exp_tobe_paid' OR `level`='$redonated_exp_balance') LIMIT 1"); if($placecheck->rowCount() > 0){ $ddd = $placecheck->fetch(); $togethelp=$ddd['email']; $gonow = $flash->query("UPDATE `merge` SET `receiver`='$togethelp',`payment_time`='$payment_time' WHERE `sender`='$newsender'"); $up= $flash->query("UPDATE `user` SET merged='yes' WHERE email IN ('$newsender','$togethelp')"); }//if there is someone active and not admin else{ $placeadmin = $flash->query("SELECT * FROM `user` WHERE `right`='1' LIMIT 1"); $profinadmin = $placeadmin->fetch(); $togethelpadmin=$profinadmin['email'];//sponsor email $payment_time= date("Y-m-d H:i:s",strtotime(date("Y-m-d H:i:s")." +3 hours"));//adding 3hrs to the current time $gonowadmin = $flash->query("UPDATE `merge` SET `receiver`='$togethelpadmin',`payment_time`='$payment_time' WHERE `sender`='$newsender'"); $upadmin= $flash->query("UPDATE `user` SET merged='yes' WHERE (`email`='$newsender')"); } } while($currentTimestamp >=$timeget_xtime && ($timeget->rowCount() > 0)); }//if status is 0 in merge table }// if merge is awaiting in user table //end of assign sponsor to user ?>
  9. ok thanks . let me check it
  10. Thanks so much bro +rep
  11. Please i dont know why this is not working fine, $unsetmerge=$flash->query("UPDATE `user` SET merged='no' WHERE email IN ('$emailuser','$togethelp')"); it will SET '$emailuser' to no but will not do same for '$togethelp' . i dont know what am not doing right and when i print $togethelp it contains the proper data
  12. It do register to database when email has not been registered, and will not register when is existing.
×
×
  • Create New...