« first day (143 days earlier)      last day (4805 days later) » 

Tek
12:10 AM
@ircmaxell pastie.org/1645408 Is it ok if I write something like this? Previously I had $stmt -> prepare, execute(), fetc_all on every if() and elseif() (it looked really messy) and manually typed up the queries for each field, it was a pain... This is a lot cleaner but I've never used variables in prepares...
 
12:50 AM
sec
Well, you might want to build with an AND or an OR clause so you can search by multiple fields
 
Tek
Like, how?
 
oh, and that's susceptible to sql injection
check you parameter orders
 
Tek
Which parameters?
Thanks, I see that now.
 
Tek
If you refreshed I fixed it, forgot to put column name
 
12:59 AM
that's one way
 
Tek
that works too
Whoa, that looks awesome.
Thanks! ^_^
I could have never wrote something like that D:
 
lol
it's not that hard
 
Tek
It is, i'm not 100% fluent yet.
So I can't put my thoughts into code 100% yet =(
Just partly
Which is why it can get funky sometimes
 
You'll get there
 
Tek
Yeah, little by little
I'm just glad I get OOP even if I'm not the most fluent
A lot of people seem to have trouble understanding the concept
@ircmaxell How long have you been doing PHP for anyway?
 
1:10 AM
About 6 years or so
Professionally 4
 
Tek
Lol that explains a lot =D
What did you originally learn PHP for?
Hobby or ?
 
A friend and I wanted to launch a website
and I didn't want to pay for a cgi bin to build my own perl site
 
Tek
Ah
How'd the site turn out anyway? lol
 
1:31 AM
Eih, scrapped
 
Tek
Ah, well at least you learned, eh? =)
 
yup
 
1:47 AM
Hi
is there a way to make php cookie to not log out (even when browser is closed or page is closed) until the user clicks logout ?
like the remember me button when u login to forums
 
Tek
Why don't you make a question instead in stackoverflow.com ? It would be better for the community
 
okay
 
Tek
Then you can just link it here and the people here might answer it :)
 
HELP !!!
Oops! Your question couldn't be submitted because:

* Sorry, we are no longer accepting questions from this account.
 
banned?
 
1:58 AM
WTF ?
 
Tek
O_o
 
Maday mayday !!!
 
0
Q: SO Is not accepting questions from my account anymore

sriI can't post a question when logged in via OpenID on SO. Can someone give me advice how to do it?

 
Tek
@ircmaxell Oh wow. I didn't even know that was in effect.
 
neither did I
 
2:04 AM
what to do ?
 
Tek
Harsh, but understandable I think?
 
create new account ?
 
Tek
@NSanjay If I were you I'd start a new account lol. And maybe try to ask questions with a bit more research? Since that seems to be the problem
I don't know
People in SO don't like general / vague questions
 
but im not banned am I ?
 
Tek
I'm not sure
 
2:06 AM
maybe a vote will unban me ?
help by voting me please
 
it's IP based
and votes won't help, it's perminent, from my understanding
 
but my status is good !
reputation 21, 6 bronze badge & 75% accept rate
dont make sence
 
21 rep on 11 questions isn't great
 
oh okay
so i create new account
SUCKS & TROUBLESOME !!!
 
It's IP based, prob won't work
 
2:11 AM
so ban 4 life ?
 
2
A: Clarify "no longer accepting questions from this account" error

Jeff Atwood It's particularly important to tell them what they can do to fix the problem We don't view this as a fixable problem in these cases.

 
sent email asking to lift ban
 
Tek
2:49 AM
Holy crap
I just noticed the Desktop notifications from SO chat that can be enabled in chrome
NEAT!
 
Oh nice!
how?
 
Tek
:D
It's just there
 
Oh, didn't even notice that
 
Tek
Neither did I, until just now haha
@ircmaxell testing 1 2 3
 
ohhh
very nice
@Tek: word
 
Tek
2:57 AM
@ircmaxell I wonder when they implemented this :D
 
dunno
 
help, whats wrong with my class ?
<?php
include("sql_information.php");

class LoginChecks{

$db = new MySQLDatabase();

$user_name = $_POST['user_name'];
$password = $_POST['password'];

$sql = "SELECT * FROM user_accounts WHERE name = '$user_name' AND password = '$password'";

$queryresult = $db->query($this->sql);

function userType() {
if ($result = $db->fetchArray($queryresult)) {
//var_dump($result);

$answer = $result['id'];

if ($answer == 1){
return "Welcome {$result['name']} the administrator !";
} elseif ($answer != 1) {
HELLO ???????????
 
3:21 AM
help me
 
3:42 AM
Hello ?
 
4:17 AM
HELLO ??????????????????????????????????????????????????????????????????????
<?php
include("sql_information.php");

class loginchecks{


$db = new MySQLDatabase();
$queryresult = $db->query($sql);
$user_name = $_POST['user_name'];
$password = $_POST['password'];

$sql = "SELECT * FROM user_accounts WHERE name = '$user_name' AND password = '$password'";



function userinfo() {
if ($result = $db->fetchArray($queryresult)) {
//var_dump($result);


$answer = $result['id'];

if ($answer == 1){
echo "Welcome {$result['name']} the administrator !";
} elseif ($answer != 1) {
echo "Welcome {$result['name']} the user !";
whats wrong ????
with my class ?
 
4:31 AM
@NSanjay what error are you getting
 
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in C:\xampp\htdocs\Database Manager\login\login_check.php on line 7
@experiment //somehow I cant post any questions anymore ?
 
mean?
 
when I encapsulate the whole code in class it becomes an eror
 
what error do you get?
 
Tek
That's not how you write a class.
Why don't you make it a function instead?
 
4:36 AM
Description Resource Path Location Type
syntax error, unexpected '}', expecting 'EOF' login_check.php /Database Manager/login line 32 DLTK Problem
Description Resource Path Location Type
syntax error, unfinished class declaration login_check.php /Database Manager/login line 8 DLTK Problem
 
Tek
instead of class logincheck{} try function logincheck(){
//Mysqlcodehere
}
 
wait i try
 
@NSanjay what IDE are you using?
 
eclipse
 
Tek
@experimentX What does it matter? It's PHP returning the error
 
4:38 AM
yes php is returning error
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in C:\xampp\htdocs\Database Manager\login\login_check.php on line 7
 
I think he's getting syntax error
 
Tek
Can you paste the whole code?
 
sure somewhere you missed semicolon
 
Tek
Of what you're doing?
 
<?php
include("sql_information.php");

class loginchecks(


$db = new MySQLDatabase();
$queryresult = $db->query($sql);
$user_name = $_POST['user_name'];
$password = $_POST['password'];

$sql = "SELECT * FROM user_accounts WHERE name = '$user_name' AND password = '$password'";



function userinfo(){
if ($result = $db->fetchArray($queryresult)) {
//var_dump($result);


$answer = $result['id'];

if ($answer == 1){
echo "Welcome {$result['name']} the administrator !";
} elseif ($answer != 1) {
echo "Welcome {$result['name']} the user !";
 
4:39 AM
just paste the line
7
 
$db = new MySQLDatabase();
 
Tek
I told you to remove class
 
you do not have (
after class name
its {
 
ya but i got the same error
 
Tek
@experimentX even then
You can't have variables in a class
You can only have constants
 
4:40 AM
yes
and you have to put it inside methos
 
Tek
$db = new mysqldatabase(); returns an error because of that
 
so ? how to fix it
im learning
 
instead of class make it a functioin
 
Tek
<?php
include("sql_information.php");

function loginchecks(){


$db = new MySQLDatabase();
$queryresult = $db->query($sql);
$user_name = $_POST['user_name'];
$password = $_POST['password'];

$sql = "SELECT * FROM user_accounts WHERE name = '$user_name' AND password = '$password'";



function userinfo(){
if ($result = $db->fetchArray($queryresult)) {
//var_dump($result);


$answer = $result['id'];

if ($answer == 1){
echo "Welcome {$result['name']} the administrator !";
} elseif ($answer != 1) {
 
function loginchecks(){ /*rest of you code here*/ }
yup that should do it
 
4:42 AM
it works now
but why ?
 
Tek
because you can't write a class like that
 
more details please
especially on the $db = new mysqldatabase();
 
what
when did you start php?
 
cant be insde class why ?
4 days ago
 
Tek
Class loginchecks{
$db = null; //correct
}

Class loginchecks{
$db = 3; //correct
}

Class loginchecks{
$db = 'sometext'; //correct
}


Class loginchecks{
$db = new database(); //incorrect
}
 
4:44 AM
no
 
yes
 
just check MySQLDatabase class
 
i know as3
actionscript3
 
asp??
 
asap ?
 
Tek
4:44 AM
He's using PHP
not asp
 
i recommend you to watch a video tutorial on lynda.com
 
Tek
anyway
if you REALLY want to make it a class
 
yes...
at the moment im watching this: youtube.com/watch?v=3gZppuplJQ0&feature=related
how to make it into a class ?
??
 
Tek
pastie.org/1646074 This is how you make it into a class
 
I C
THANK YOU
 
Tek
4:50 AM
then to use it you do

$db = new database();

$db -> logincheck();
You're welcome.
 
finally I understand OOP
 
Tek
There is more OOP than just that, but at least you get the basics of it now.
 
yeah
 
Tek
If you really want to understand OOP more try using this: net.tutsplus.com/tutorials/php/…
Or watch the video.
Plus you should really learn MVC if you don't already. It's widely used and I recommend that you learn about it.
 
thank you
okay i will
 
Tek
4:54 AM
Makes your code super clean =)
too
 
WOHOOO !!!
 
Tek
because things are more organized when you learn how to use MVC in a website
 
i c
shhhhh..... watching the video you gave
 
@experimentX Hi
iam online
 
Greetings
 
5:10 AM
Hi
 
What's going on?
 
getting error:
Notice: Undefined property: database::$sql in C:\xampp\htdocs\Database Manager\login\login_check.php on line 9
Query was empty
 
First time in an SO chat where someone showed up
 
for this code pastie.org/1646074
 
Tek
@JustinStolle What do you mean "showed up"? :P
 
5:11 AM
haha, I've sat around for several minutes and nothing happened before
 
??
//you spamming
/SCUM ?
 
Tek
@JustinStolle Ah, everyone's busy sometimes and just have the window minimized in the back of other windows
 
//joking only dun take it seriously lah
 
let's solve this problem
 
ya my problem
 
Tek
5:13 AM
@NSanjay How are you calling the database class?
 
$sql = "SELECT * FROM user_accounts WHERE name = '$user_name' AND password = '$password'";
 
does anyone know about finding the vertices of a polygon if i know the radius of it
 
Tek
No, I mean the class.
 
@dskanth I doubt it
 
<?php
include("sql_information.php");

class database{
public function logincheck(){


$db = new MySQLDatabase();
$user_name = $_POST['user_name'];
$password = $_POST['password'];
$sql = "SELECT * FROM user_accounts WHERE name = '$user_name' AND password = '$password'";
$queryresult = $db->query($sql);



function userinfo(){
if ($result = $db->fetchArray($queryresult)) {
//var_dump($result);


$answer = $result['id'];

if ($answer == 1){
echo "Welcome {$result['name']} the administrator !";
} elseif ($answer != 1) {
 
5:15 AM
@dskanth hello
 
hello
@MidhunGirish hello
 
i managed to get the algorithm better one this time without iteration working on it
 
@dskanth ello
 
oh... great
 
@dskanth hello....
 
5:16 AM
guys i need a small help
does know a simple jquery calendar sidebar
 
@Tek any solution ?
 
for displaying at the side just name
 
scriptmafia.com
LOL LOL
 
Tek
$dbc = new database();
$dbc -> logincheck();

There are two $db variables, maybe they're conflicting?
 
@tek still same error
 
5:19 AM
@NSanjay the code you posted is different from the pastie link
 
@dskanth the points would be somethig like this
$final['a']['x'] = $init['x']+$distance/sqrt(1+$slope*$slope);
$final['a']['y'] = $init['y']+($slope*$distance)/sqrt(1+$slope*$slope);

$final['b']['x'] = $init['x']-$distance/sqrt(1+$slope*$slope);
$final['b']['y'] = $init['y']-($slope*$distance)/sqrt(1+$slope*$slope);
 
which are you working from?
 
@experimentX I meant scriptmafia.org/
 
i am seeing
 
new code
<?php
include("sql_information.php");

class database{
public function logincheck(){


$db = new MySQLDatabase();
$queryresult = $db->query($sql);
$user_name = $_POST['user_name'];
$password = $_POST['password'];
$sql = "SELECT * FROM user_accounts WHERE name = '$user_name' AND password = '$password'";



function userinfo(){
if ($result = $db->fetchArray($queryresult)) {
//var_dump($result);


$answer = $result['id'];

if ($answer == 1){
echo "Welcome {$result['name']} the administrator !";
} elseif ($answer != 1) {
 
5:21 AM
OK, you're using $sql before you're declaring/assigning it, no?
 
ya I guess
the other way returns an empty page
 
JustinStolle
yeah sanjay u r.. :D
 
don't you want to move $sql = ... above $queryresult = ... ?
 
empty page because there is an error coz there is nothing to output?
 
<?php
include("sql_information.php");

class database{
public function logincheck(){


$db = new MySQLDatabase();
$user_name = $_POST['user_name'];
$password = $_POST['password'];
$sql = "SELECT * FROM user_accounts WHERE name = '$user_name' AND password = '$password'";
$queryresult = $db->query($sql);



function userinfo(){
if ($result = $db->fetchArray($queryresult)) {
//var_dump($result);


$answer = $result['id'];

if ($answer == 1){
echo "Welcome {$result['name']} the administrator !";
} elseif ($answer != 1) {
 
5:25 AM
@experimentX Thanks, looks good code
@MidhunGirish I have a small problem with module config
 
@dskanth i did my homework yesterday and i also clearly understood what vector cross product is
just simple use
 
@NSanjay still errors?
 
of it
 
ya
 
oh.. great work
 
5:26 AM
still errors
 
@experimentX So what is the final code..
 
<?php
include("sql_information.php");

class database{
public function logincheck(){


$db = new MySQLDatabase();
$user_name = $_POST['user_name'];
$password = $_POST['password'];
$sql = "SELECT * FROM user_accounts WHERE name = '$user_name' AND password = '$password'";
$queryresult = $db->query($sql);



function userinfo(){
if ($result = $db->fetchArray($queryresult)) {
//var_dump($result);


$answer = $result['id'];

if ($answer == 1){
echo "Welcome {$result['name']} the administrator !";
} elseif ($answer != 1) {
 
@dskanth i am working in it i will send an update on it
 
@dskanth i think u r not making the db connection .. thts y "No adapter found" error comes
 
@experimentX Thanks, i will wait for u
@MidhunGirish see, iam using application.ini for database config right now
 
5:28 AM
@dskanth its okay but you also should improve it a bit
 
what bout me ?
 
i mean finding if a point is inside a polygon or not
@NSanjay what are you getting
 
@MidhunGirish how can i use module specific config
 
im getting blank page
 
5:31 AM
you're not actually calling userinfo() anywhere
it's defined, but no call to it?
Plus userinfo() looks like its inside of logincheck()
 
@NSanjay you got error
 
how do i access userinfo ?
 
why don't you put an echo "in logincheck()" as the first line of the logincheck() function to see if that page shows you that
 
checking code
 
5:36 AM
@experimentX looks better
 
@experimentX
Notice: Undefined variable: db in C:\xampp\htdocs\Database Manager\login\login_check.php on line 19

Fatal error: Call to a member function fetchArray() on a non-object in C:\xampp\htdocs\Database Manager\login\login_check.php on line 19
 
Oops! change $db to $this->db
and define $db as property
 
Notice: Undefined property: database::$db in C:\xampp\htdocs\Database Manager\login\login_check.php on line 19

Fatal error: Call to a member function fetchArray() on a non-object in C:\xampp\htdocs\Database Manager\login\login_check.php on line 19
 
somewhat similar .. but it contains error
change all $db to $this->db
 
changed 2 bd Notice: Undefined property: database::$db in C:\xampp\htdocs\Database Manager\login\login_check.php on line 11

Fatal error: Call to a member function query() on a non-object in C:\xampp\htdocs\Database Manager\login\login_check.php on line 11
 
5:40 AM
what is line no 11
 
$queryresult = $this->db->query($sql);
 
@NSanjay you changed the wrong line
 
still same error
 
you forgot to define private $db
recheck my prev link
 
Fatal error: Call to a member function fetchArray() on a non-object in C:\xampp\htdocs\Database Manager\login\login_check.php on line 21
 
5:43 AM
$db = new MySQLDatabase();
change here too
$db to $this
->db
 
Fatal error: Cannot re-assign $this in C:\xampp\htdocs\Database Manager\login\login_check.php on line 10
 
guys have you earned talkactive badge
 
i have earned it before
 
me, no
 
what that supposed to mean?
$this->db
i just got it
talkactive badge
and when i got tumbleweed badge .. i thought it was cool
 
5:48 AM
Notice: Undefined variable: db in C:\xampp\htdocs\Database Manager\login\login_check.php on line 21

Fatal error: Call to a member function fetchArray() on a non-object in C:\xampp\htdocs\Database Manager\login\login_check.php on line 21
mee to tumble weed for an unanswers question
 
whats on line 21
 
if ($result = $db->fetchArray($queryresult)) {
 
change it to $this->db
->fetchArray
 
is there a site where you can both edit the code at the same time and see the changes?
 
that would be awesome !
 
5:50 AM
as $db is defined, above all functions inside class, it has become a method
 
Google docs does it
 
i hate google docs
 
@experimentX Its working now !
 
it consumes so much bandwith
 
now to gothru the code & learn
 
5:50 AM
yup
 
yeah, that's why it would be cool if the pastie or codepad or whatever did that
 
sure but i looks awesome for managing there codes
adding chat would not be so difficult after all they've done
 
ya would be ultimatum
 
6:18 AM
@dskanth do you know tan inverse function in php?
 
now to program cookie
is it possible to log to sql when cookie timeout ?
 
like default timeout is 20mins, when it time out it will log echo
 
well, why would you do that?
 
i want to do a loging of login & logout
like a punch card
 
6:24 AM
store login info on session
 
yes but the person would have to click logout to log logout
but if he close browser ?
or abandoned the pc like that
 
okay, everytime you check login, store logout time in session
if the server time is greater thatn session time, logout
i mean don't let login
thats' more secure that storing in cookies
 
so this timer will run even after browser is closed ?
 
yes
on server
 
awesome !
gonna start programming it
 
6:27 AM
okay all the best
 
thank you.
 
7:12 AM
@experimentX sorry yar, iam not aware of it
 
what?
 
of tan inverse function in php
 
oh
i am quite close
 
oh... is it
great
So i see, i need: 1) Number of polygon vertices 2) Center of polygon 3) Radius of polygon
do i need all the above 3 for finding polygon vertices ?
 
yes, if you want to find if the point lies on inside or outside of the polygon
 
7:23 AM
fine, thanks for all ur efforts... iam pleased
for just finding polygon vertices, do i need the above 3, or i need them for finding point in polygon
?
 
for both
you know the radius, if the side and vertices are known
but you don't know the vertices, and you can move them in your example
 
oh... i didn't get you
for just finding vertices of polygon, the above 3 are sufficient?
i mean: 1) Number of polygon vertices 2) Center of polygon 3) Radius of polygon
 
7:40 AM
No is not required, since it is already 5
and we need orientation
 
ok
Great
 
still not working!!
i have to fix algo i think
quite bg at moment
come back in hrs
2
 
Fine. not a problem
Thanks
 
hahah tan(45)=1.45
 
7:54 AM
@dskanth i think i finally nailed vertices
 

« first day (143 days earlier)      last day (4805 days later) »