Jump to content

sylvertwst

Members
  • Posts

    21
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

sylvertwst's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i can see the use of it thank you for the swift answers everyone <3 phpfreaks
  2. thank you very much. i will adopt your way of naming on a side note, did you just tell php to use classAutoload() instead of __autoload() to autoload the classes? ps: DanielO i like your signature. particulary the how to ask questions faq link
  3. cool! thanks for the tip on autoload. when i make a new class that implements another class or interface, can i use separate files as well, do i need to use the autoload function at the top of eacth class file then? or should parent/child classes go in the same document still?
  4. hello all, i was wondering what you would consider best practise to do: when i have multiple classes, i was thinking of making one php file per category, for example i would have one database connection class and a query class in dbconnect.php, and then user class and login class in user.php. is this a good way of doing things? would yousuggest a new document for each class used? one document for all classes in a single class library? thanx in advance beginner OO php Sylvertwyst
  5. i was unable to work a week or so due to an accident. thank you for your replies, i'm checking out the design patterns tutorial right now. it may be exactly what i was looking for
  6. that looks like an excellent body of objects. i have one concern though. the manual states that it is written in php4. arent the differences between php 4 and 5 a little too great for me to start studying this framework?
  7. hello all, i've just recently begun learning php, i only have the very basic experience with programming elements as loops conditionals etc, but i'm learing:) to start of with the state of the art methods i want to take off in php with OO, i've found a number of excellent tutorials, but they all explain the same things. that a dog has 4 legs and a head and he can bark and poop, you know what i mean. yay i learnt some new stuff. while it is essential for beginners as me to understand this, i'm beyond this stage. i need to know how to implement this model in things such as building a page class. building object oriented code for a login system. anything to get me going on how it is actually implemented and how i can start developing my own code. any pointer or anyone know a good tutorial beyond the metaphorical dog? thanks a lot Sylvertwyst edit:: o.o we have an oop section. srry for this. can an admin move please?
  8. i'm pretty new here myself, i think the loginsystem isnt synced with the main page. i.e. you need two diffrent accounts for forum/ main page. but dont shoot me if i'm wrong. did i say that i'm new here yet? lol edit:: =.= see above. what do i know about this forums anyway XD
  9. ::)DOH okay stage cleared.. it seems i am using sessionvars in a wrong way. if session_register("myusername"); has been done i should be able to get it simply with $myusername .. right? egh i could probably figure this one out... using google. >< forgive me for being lazy at 2 am and if this is gainst policies tell me:p i'll set it to solved as my initial question(wasnt that a hard one) has been answered
  10. hello. i've been studying this code letter by letter and i seriously have no idea what i'm doing wrong. what seems to be the problem is that the sql command returns nothing, while it should. the database has a table 'users' with fields user_id, user_name and user_password. (yeah.. a login tutorial from a book... i'm starting to think the book is flawed. lol.) the vars from the form on the previous page are fine, as when i get that echo, they show up. the ones from the sql query dont... there isnt even an error report. the sql request array is just empty. i confirmed that with checking if $sql_login_check is set or not. please help me clear this i'm so eager to learn lol i get frustrated when i get stuck on stuff like this. <?php include('include/db_connect.php'); //get submitted credentials $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; //secure credentials against code-injection to protect database $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); //compare user/pw to records in database $login_check="select * from users where user_password='$mypassword'"; $sql_login_check = mysql_query("$login_check"); $sql_username=$sql_login_check['user_name']; $sql_password=$sql_login_check['user_password']; $sql_id=$sql_login_check['user_id']; if($sql_username!=$myusername || $sql_password!=$mypassword){ //login failed echo("login failed. incorrect username/password<br /><br />"); //errornotes for debug purposes echo('username provided: ' . $myusername .'<br />'); echo('password provided: ' . $mypassword .'<br /><br />'); echo('username mysql: ' . $sql_username .'<br />'); echo('password mysql: ' . $sql_password .'<br />'); echo('ID mysql: ' . $sql_id .'<br />'); }else{ //login succes! register the provided username and pass to the session session_register("myusername"); session_register("mypassword"); //redirect to login_succes.php header("location: login_succes.php"); } ?> <body> </body> <?php include('include/footer.php');?> many thanks, Sylv
  11. maybe change the link to an input(on index.php) and set a variable that you can call to check if the user came from the index on the next page?
  12. you should specify more... what other vars are you getting from the $_POST array? more info please
  13. yeah from the html tags to that echo just before the redirect.. cant have it. in your situation i would recommend javascript redirect instead. there's tons of tuts on that on google
  14. sylvertwst

    Ubuntu 7.04

    u can try one of following: sudo <command> this will execute whatever command you give it with root privileges. if there's multiple commands you need to do you'll have to type 'sudo' everytime at the start of the line. if you dont want to do that you can do (not recommended): sudo su will make you root in terminal until you decide to stop using root privileges bye tying 'exit' these above two should give you all the acces you need to do whatever you want. in ubuntu you shouldnt need to gain a fully enabled root account. hope it helps, Sylv
  15. \o/ thorpe is our king ! ty very much, it works now:D i can finallly start on php. i'm gonna do a stupid guestbook project first, to get the hang of 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.