[PHP] Sessions and Security Concerns

2010-03-29 Thread Ben Stones
Hi, I'm just wondering whether there are any apparent security concerns I should be aware of when using sessions in my PHP scripts. I understand that sessions are tracked with an individual user via a session ID which is stored in a temporary location on the server, as well as a PHPSESSID cookie a

[PHP] Recommended Books on Object Oriented Programming

2010-03-24 Thread Ben Stones
Hi, I want to properly learn object oriented programming as I've been coding in procedural style since I started with PHP a few years ago, and want to give OOP a shot. The web isn't really a good resource to learn OOP in PHP to be honest, as a lot is outdated for PHP4's style of OOP. I've looked i

[PHP] Inserting Associative array values into a MySQL INSERT statement?

2010-02-14 Thread Ben Stones
Hi, I want to be able to create a function that acts as an insert mysql function that accepts specific parameters for the fields and the values I want to insert into those respective fields and I know I'll need to use associative arrays to complete this task when passing values to the function, bu

[PHP] Object Oriented Programming question

2010-01-19 Thread Ben Stones
Hi, I've been learning about object oriented programming for the past few weeks and I've understood it pretty well, but I have one question. Usually with PHP scripts I make, all the functionality for a specific page is in the actual PHP file, and I'd use PHP functions in a separate directory which

Re: [PHP] Sessions in object oriented code

2008-10-30 Thread Ben Stones
Hi, I can't really understand that. Not sure if you understand my problem properly (if I've not explained properly). Anyone can give me some solutions please? Thanks. 2008/10/31 Yeti <[EMAIL PROTECTED]> > OK I guess it's somehow like this .. > > > if (isset($_POST['submit'])) { > include('ses

[PHP] Sessions in object oriented code

2008-10-30 Thread Ben Stones
Hi, Hope I can explain this as easily as possible, basically I am using both cookies and sessions for my script, whereby the user is allowed to choose which method they want to login with. Problem for me is removing the registration form, etc., from those that are logged in. The thing is the form

Re: [PHP] Microsoft China to Punish private windows users

2008-10-15 Thread Ben Stones
via e-mail? lol - speaking of which doubt many would visit the site anyway :)... oh wait, the archive... is it indexed by Google? 2008/10/16 Ashley Sheridan <[EMAIL PROTECTED]> > On Wed, 2008-10-15 at 16:38 -0400, Wolf wrote: > > > > > This is extremely off-topic. Please don't abuse this list in

Re: [PHP] Information on Cookies

2008-10-15 Thread Ben Stones
Makes perfect sense. I have included this security in my script - thanks to both of you for your help! Cheers! 2008/10/15 Stut <[EMAIL PROTECTED]> > On 15 Oct 2008, at 16:04, Ben Stones wrote: > >> Can you explain to me the benefits of hashing/encrypting/md5'ing cookie

[PHP] Information on Cookies

2008-10-15 Thread Ben Stones
I've read a few videos on cookie security and it makes sense that people can modify cookie values which is a problem I'm trying to figure out to *try* and prevent. What I'll first do is at the top of the page that validates if the cookie values is in the database, but what my next problem is they'd

Re: [PHP] Information on Cookies

2008-10-15 Thread Ben Stones
Can you explain to me the benefits of hashing/encrypting/md5'ing cookie values? I don't see how it'd stop hackers from changing cookie values? 2008/10/15 Stut <[EMAIL PROTECTED]> > On 15 Oct 2008, at 15:23, Ben Stones wrote: > >> I've read a few videos on c

[PHP] Can't use copy() to copy files

2008-10-14 Thread Ben Stones
Ok, here is my code (mind it is a bit messy I was just testing to see if it works first of without success): if($_GET['act'] == "update") { $check_exists=file_exists($_GET['file']); if($check_exists==1) { if(copy($_GET['file'],$_GET['file'])) { echo 5; } else { echo $_GET['fil

Re: [PHP] New to PHP

2008-10-14 Thread Ben Stones
There are many places to get help when you need it, but a good place is the unofficial PHP IRC channel. Search on Google for XChat, download it, and connect to ##PHP in irc.freenode.net. Great place and it seriously has helped me once or twice. If you don't know about how to use IRC, search on Goog

Re: [PHP] Setcookie()

2008-10-13 Thread Ben Stones
logic is done then (IMHO) it's wrong and needs to be rewritten anyway, > regardless of the need to set a cookie. > > -Stut > > -- > http://stut.net/ > > Ben Stones wrote: >> >>> What I mean is I cannot use setcookie, I need to check if user >>>

[PHP] Alternative to HTTP_REFERER?

2008-10-11 Thread Ben Stones
are there any alternatives to HTTP_REFERER as that only works for "clicking" but it won't work for referrals from redirects? Cheers

Re: [PHP] Setcookie()

2008-10-11 Thread Ben Stones
as I want to display a message saying that they have successfully logged in in the correct area of my template. 2008/10/11 Per Jessen <[EMAIL PROTECTED]> > Ben Stones wrote: > > > I'm using cookies for my website script and upon users logging in a > > cookie is set.

[PHP] Setcookie()

2008-10-11 Thread Ben Stones
Hi, I'm using cookies for my website script and upon users logging in a cookie is set. Problem for me is that the cookie doesn't work due to headers already sent. Is there anyway of fixing this because, there is no possible way of adding setcookie() to the top of the PHP file when the cookie is ho

Re: [PHP] Re: OOP - Calling methods from classes that are inheriting?

2008-09-21 Thread Ben Stones
ho parent::func(); } } $class=new otherClass(); echo $class->otherFunc(); Nothing outputs. Sorry I am slightly new to OOP so there may be a simple fix for this? 2008/9/21 Lupus Michaelis <[EMAIL PROTECTED]<[EMAIL PROTECTED]> > > Ben Stones a écrit : > >> Hope I have m

[PHP] OOP - Calling methods from classes that are inheriting?

2008-09-21 Thread Ben Stones
Hi, How do I call methods from classes that are inherited? I want to add a mysql_num_rows() function to a second class that is an addon to a MySQL query in the first class. The first class will be used in several different classes for different parts of the site so I don't want to directly add the

[PHP] Calling methods from others classes

2008-09-21 Thread Ben Stones
Hi, I have this piece of code that I have created: class userQueries { public function numberUsers() { $get_users=mysql_query("SELECT * FROM `users` WHERE `online` < NOW()") or exit("../includes/error.php"); } } class usersOnline extends userQueries { public function usersOnl

Re: [PHP] Public in Classes

2008-09-21 Thread Ben Stones
he variables and there are no variables called numberUsers. Cheers! 2008/9/21 Jochem Maas <[EMAIL PROTECTED]> > Ben Stones schreef: > > Hi, >> >> Just started with object oriented programming and glad I have come across >> it, just need a few things clearing u

[PHP] Public in Classes

2008-09-21 Thread Ben Stones
Hi, Just started with object oriented programming and glad I have come across it, just need a few things clearing up. When I make a variable or method public, does this mean that it can be used outside of classes, for instance in other classes or as well as instantiating classes? So if I made it

[PHP] Readdir() question

2008-09-11 Thread Ben Stones
Hi, I'm going to make a small browser based file system for ease of small updates that I make frequently on my Website. First of all I want to loop all the files on the same directory and to tell PHP read the same directory, I think I'd need to use the magic constant I think its called, __DIR__ su

[PHP] Setting up a password for WAMP

2008-09-10 Thread Ben Stones
Hi, just installed WAMP and wondering how do I setup a root password for accessing phpMyAdmin, MySQL, etc. Couldn't find anything on the WAMP's Website how to do this. I realise this has got nothing to do with PHP specifically but any help will be appreciated!

[PHP] Anything like XAMPP?

2008-09-10 Thread Ben Stones
There's a bug, I believe with XAMPP where from XAMPP CP you click 'admin' under MySQL, when WinMySQLadmin comes up, the icon in the right (traffic light) is always red, and there's no option to start the service anymore... at the moment there's a "Stop the Service" option but it's unselectable. Are

[PHP] Installation doesn't complete, Windows Vista: error - "script required to complete"

2008-09-10 Thread Ben Stones
Hi, Others are facing the same problem and theres an official bug report here about it: http://bugs.php.net/bug.php?id=43639&thanks=3 PHP hasn't fixed it since December 2007, wondering if anyone has a workaround as I cannot even uninstall it now as the same problem arises. Is there any workaround

[PHP] Basics of OOP

2008-09-09 Thread Ben Stones
Hi, The following bit of code doesn't output anything: text = "Hello World"; echo $this->text; } } $class = new output(); $class->outputText; ?> As well as the following code: text; } } $class = new output(); $class->outputText; ?> Am I doi