Jump to content

Lodius2000

Members
  • Posts

    586
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.scriptingsource.com

Profile Information

  • Gender
    Male
  • Location
    Denver

Lodius2000's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. off topic but taiths sig "90% of computer issues exist between the seat, and the keyboard." HAHAHAHAH
  2. learning php 5 (o'reilly) each chapter has exercises kind of like quizzes at the end so you can apply all the really dry programming mumbo jumbo you just read, its pretty good stuff, 1 vice, it introduces pear db, which is out of date, for its mysql handler, rather than using php's built in mysql functions, good news is, pear's object names look similar to mysql functions, so translating shouldnt be too much of a problem, wasnt for me aside from html, and css, php is my first real programming language and thanks to this book, and this forum i have built a blog style cms
  3. hi getting one of those error thingies on line 119 (the line that defines $defaults) looked the code over, cant find any missing ; or mismatched quotes and as far as I know you can concatanate single quote strings into a var BUT could i just double quote it to avoid the concatanation? otherwise whats wrong <?php print "Copy this code into the article form on the creation page<br/>\n"; $defaults = '"<a href="photos/misc/bigphotos/' . $bg_file . '"><img class="floatright" src="photos/misc/smallphotos/' . $sm_file .'" /></a>'; print "<form>\n"; ?>
  4. this may be the total wrong place to put this but it does involve objects I know very little about oop so here goes i am getting an error message when I submit a valid username and password in my login page it tells me: Please enter a valid password. Note: I user PEAR DB and the password is stored crypt()-ed the password validation //check that password matches username $encrypted_password = $db->getOne("SELECT password FROM users WHERE username = '$_POST[username]'"); if ($encrypted_password != crypt($_POST['password'], $encrypted_password)){ $errors[] = 'Please enter a valid password.'; } i tried replacing getOne with query but it returned a php error that said "Warning: crypt() expects parameter 2 to be string, object given in admin/index.php on line 75," which is the if() statement i have also tried $encrypted_password = $db->getOne("SELECT password FROM users WHERE username = '".$_POST['username']."'"); that didnt work, I didnt think it would because my username verification looks like //check that the username exists $q = $db->query("SELECT username FROM users WHERE username = '$_POST[username]'"); if ($q->numrows() == 0 ){ $errors[] = 'Please enter a valid username.'; } and it works just fine the really frustrating thing about this is that I copied the password varification directly out of "learning php 5" by o'reilly and it doesnt work so i guess my question is how do you convert an object into a string, so that i can use query instead of getOne or... if you know what the problem is please let me know how to fix it
×
×
  • 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.