Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. Huh!! whar are you talking about hackerkts ? ???
  2. LOL you are not fetching the data try <?php $result = mysql_query("select * from members_info where user_name='$user_name' and password = password('$password')"); $row = mysql_fetch_array($result) or die(mysql_error()); print_r($row); ?> not sure how i missed that
  3. Yes, but i am finding it quite hard to read the code you supplied.. can you re-post it
  4. ok remove the echo and die now (i have to ask) but the password in the database was written via the "Password" function in mysql ? i assume so.. ok now <?php print_r($result); die; if (!$result) return 0; ?>
  5. Try #1 append the echo and die; <?php <?php function login($user_name, $password) // check username and password with db // if yes, return true // else return false { // connect to db echo "$user_name - $password"; die; ?>
  6. oh as a side note, #1 password shoudn't be stored as clear text #2 that script is open to SQL injection
  7. ok i'll point it out... try setting the varibles $user_name & $password also use isset quick update... <?php if (isset($_POST['user_name']) && isset($_POST['password'])) // they have just tried logging in { $user_name= $_POST['user_name']; $password = $_POST['password']; if (login($user_name, $password)) ?> **i only reviewed the start of the code *update is untested EDIT: Added <?php marks
  8. *BUMP#2* I am starting to think i am on my own on this one!
  9. post the code that sets the cookie
  10. it means you have send data to the page before calling session_start() this post may help
  11. No Paste the first 10 lines (remove any passwords or anything) i just need about 10 lines I can't view the php via view source, OR Try Remove the current session_start(); and at the VERY TOP of the page add this <?php sesstion_start(); ?> if this fails then we need to see the php code, in the php help section pinned in a post about headers that may help PS please use the code tags
  12. I guess something like this Select products.Name, grades.Name, subjects.Name Left JOIN grades ON grades.GradeID IN (products.GradeID) Left JOIN subjects ON subjects.SubjectID IN (products.SubjectID) WHERE products.ProductID = 84512; **UNTESTED
  13. session_start(); Must be the first command (nothing must be sent to the page before them) show the first 10 lines of your index.php file in code tags
  14. The best programming language is the one the suites the jobs needs the best.. while many languages can do the same thing theirs normally atleast one factor that decides a better language it may be expandbility, performance, compaiability, development time(cost), or language requirements (cost hardware/software) Oh spaghetti...
  15. *BUMP* Suggection even ?
  16. OK basically i have a class that is growing quite large.. i have look and found some posts close but not exacly what i need.. Now i have been extending the class but its a pain also i don't need all the extended classes all the time so Question #1 Does the this type of code decrease performance in any way? Question #2 is their a better way of doing this? for example if i didn't need MoreTextStuff but could add it in half way through a routine Sample code (very basic) <?php $Test = new TextFormatting; $Test->AddText("Test<br />"); $Test->Underline(); $Test->AddText("Test2<br />"); $Test->BoldText(); $Test->AddText("Test3<br />"); echo $Test->TheText; class TextStuff { public $TheText; function AddText($string) { $this->TheText = $this->TheText.$string; } } class MoreTextStuff extends TextStuff { function BoldText() { $this->TheText = "<u>".$this->TheText."</u>"; } } class TextFormatting extends MoreTextStuff { function Underline() { $this->TheText = "<b>".$this->TheText."</b>"; } } ?> any ideas, Thanks In advance --MadTechie
  17. Please put the code in the code tags explain the problem including errors and for gods sake read the rules..
  18. well i saw a post asking the same thing.. it didn't go far see here
  19. could use array_keys to get the keys and then shuffle that array and use that ie <?php $Quests = array("1" => "Q1", "2" => "Q2", "3" => "Q3", "4" => "Q4", "5" => "Q5" ); $RandQ = array_keys($Quests); shuffle($RandQ); foreach($RandQ as $R) { echo $Quests[$R]; } ?> **UNTESTED
  20. Doesn't work Just kidding looks like it will work,
  21. $result = array('birthday' => 01, 'birthmonth' => 03, 'birthyear' => 1990); returns 17 $result = array('birthday' => 01, 'birthmonth' => 05, 'birthyear' => 1990); returns 17 the current Month is the 4 so on the 3rd month it should be 16 and on the 5th month it should be 17
  22. doesn't work 100%, doesn't take months into account, ie if the month is the 4 and your birth month is the 7 then it will still count as if you had your birthday that year!
  23. please search the forum first Age calculation
  24. Rules 2. Don't ask someone to write or re-write a script for you, unless you are posting a message to the PHPFreelancing Forum. The forums are not the place to request XYZ script. This is a community of people learning PHP, and not a script location service. Try searching sourceforge, phpclasses, hotscripts, or Google.
×
×
  • 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.