Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. I see them top left, and seam to work ie (PS i included the links)
  2. Like this $sql="INSERT INTO messages (to_username,from_username,message,type, timestamp) VALUES ('{$playerdata['username']}','System','You have reached level ".($level + 1)." in Notoriety, Please check the Skill Points section to see if you now qualify for any upgrades!','Player', NOW())";
  3. First all, its nothing like ordering your boss around, also lower class can live without the need for upper class, but the same is not true the other way around! But its nice to meet the guy who talks down to the waitress and chew on her spit, Personally i fine when I am courteous. I get better service. But hey enjoy your gets salty mayo in his lunch, mmmmm
  4. Yep, a variable variable, not much of a question as you also posted the answer Example $var1 = 'var2';$var2 = 'output';echo $$var1;
  5. 1. use PHP tags 2. move the update code above the select code 3. for debugging update both mysql_query($sql); to mysql_query($sql) or die($sql.mysql_error()); 4. report errors if any (after you applied the updates (3)
  6. you could us global ie $filePath = "oil.ini"; echo get_value_of('five'); function get_value_of($name){ global $filePath; $ini_array = parse_ini_file($filePath); return $ini_array[$name]; } or a class class readINI{ private $ini_array; public function __construct($filePath) { $this->ini_array = parse_ini_file($filePath); } function get_value_of($name){ return $this->ini_array[$name]; } } //use class $oilINI = new readINI('oil.ini'); echo $oilINI->get_value_of('five'); EDIT: I should of said, with the class you can get multiple results like this $oilINI = new readINI('oil.ini'); //loaded echo $oilINI->get_value_of('one'); //display 1 echo $oilINI->get_value_of('five'); //display 5 echo $oilINI->get_value_of('ten'); //display 10 //etc etc another option would be define define("my_ini_file", 'oil.ini'); //outside function $lines = file(my_ini_file);//inside function (note no $ ) it really depends on how your planning to use it and how it would expand
  7. this UPDATE tbl_members SET member_password=AES_ENCRYPT('password', '1234567890123456') WHERE member_username='rk'; encrypts the password so the password changes from 1234567890123456 to ™Ã7Ée“ûË+{£#”U)à So when selecting the WHERE need to find the encrypted password NOT the decrypted one! you only decrypt when you want to view it like this SELECT *, AES_DECRYPT('password','1234567890123456') as DecrypedPassword FROM tbl_members WHERE member_username='rk' AND member_password=AES_ENCRYPT('password', '1234567890123456'); However why encrypt it ? why not use a hash, ie SHA or MD5 another other is to decrypt the field in the where ie SELECT *, AES_DECRYPT('password','1234567890123456') as DecrypedPassword FROM tbl_members WHERE member_username='rk' AND AES_DECRYPT('password', `member_password`) = '1234567890123456';
  8. As far as i am aware, mail doesn't support SMTP Authentication, your better off going with PEAR Mail package or a fsocket system like phpMailer Of course you can just change your reply address, but that will only send from a non-authenticated account
  9. Post doesn't contain idtochange, check your form
  10. http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
  11. All the sign code tells me is that the field is `DateCreated` WHERE NOW() < DATEADD(`DateCreated`, INTERVAL 1 DAY) I don't know what you want to do, or how you want to implement it, only you can decided that!
  12. That's the WHERE part of the SQL, just add it to the login query! Its very hard for me to say how to incorporate it without knowing anything about your current system.
  13. i assume you mean if(strip_tags($_GET['dl'])){ $dl = (int)$_GET['dl']; $check=mysql_num_rows(mysql_query("SELECT * FROM search WHERE id='$dl' AND username='$username'")); if ($check !="0"){ mysql_query("DELETE FROM search WHERE id='$dl'"); echo "Search deleted"; } }
  14. Check line 72 of all files on your server, if the problem isn't then please re-clarify the problem
  15. Well the "oop" isn't designed the way i would design it... However below the private $notify_element = null; add this private $UserName = null; private $UserID = null; and add these into the class public function getUsername(){ return $this->UserName; } public function getUserID(){ return $this->UserID; } Now replace your commented out code with this $this->UserName = $row['username']; $this->UserID = $row['id']; okay now.. the problem with session is probably due to the fact you have output sent before the session_start().. So now find where you call this class something like this $ajax = new ajaxLoginModule(); and below add this (for testing) echo $ajax->getUsername();
  16. Try this Part of the SQL WHERE NOW() < DATEADD(`createdTime`, INTERVAL 1 DAY)
  17. The commented out code looks okay BUT did you have call session_start(); before calling the function ?
  18. Sure thing $customer_id=(int)$_POST['customer_id']; (int) means get as an integer, so 0 = 0, 1=1 but HELLO = 0 I used it to stop SQL injection on a Int $query = "select * from customer where customer_id=$customer_id LIMIT 1"; LIMIT means once you found that limit (1) stop searching, this is just a little optimization if(mysql_num_rows($result) < 1) { echo 'The record could not be found.'; 1 refs to the records found, (if less than 1 records then none are found I hope it all makes sense also remember to mark as solved
  19. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=308424.0
  20. Don't display the password length either.. that also reduces the security ! just have the * as 8 chars no matter of the length
  21. okay try this and post back the debug info ie <?php //initilize variables $var_nic = ''; $var_full_name = ''; $var_name_with_initials = ''; $var_address = ''; $var_contact_number = ''; $var_gender = ''; echo "DEBUG:~"; error_reporting(E_ALL); echo "----------------------------<BR />\n"; echo "POST:";var_dump($_POST);echo "<BR />"; if(isset($_POST['customer_id'])) { $customer_id=(int)$_POST['customer_id']; $query = "SELECT * FROM customer WHERE customer_id=$customer_id LIMIT 1"; echo "\$query = $query<BR />\n"; $result = mysql_query($query) or die(mysql_error()); if(mysql_num_rows($result) < 1) { echo 'The record could not be found.'; }else { $row=mysql_fetch_array($result); echo "\$row = $row<BR />\n"; $var_nic = $row['nic']; $var_full_name = $row['full_name']; $var_name_with_initials = $row['name_with_initials']; $var_address = $row['address']; $var_contact_number = $row['contact_number']; $var_gender = $row['gender']; } } echo "----------------------------<BR />\n";
  22. But you said As it seams your $customer_id would be a number and would relate to only 1 record would so this //initilize variables $var_nic = ''; $var_full_name = ''; $var_name_with_initials = ''; $var_address = ''; $var_contact_number = ''; $var_gender = ''; if(isset($_POST['customer_id'])) { $customer_id=(int)$_POST['customer_id']; $query = "select * from customer where customer_id=$customer_id LIMIT 1"; $result = mysql_query($query) or die(mysql_error()); if(mysql_num_rows($result) < 1) { echo 'The record could not be found.'; }else { $row=mysql_fetch_array($result); $var_nic = $row['nic']; $var_full_name = $row['full_name']; $var_name_with_initials = $row['name_with_initials']; $var_address = $row['address']; $var_contact_number = $row['contact_number']; $var_gender = $row['gender']; } }
  23. IF remote access is allowed but yeah be warned
  24. I have to agree with ProjectFear, check the cached copy and see what it says
×
×
  • 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.