BetterPHP PHP Library

Written something you are proud of, post it here.
User avatar
Kamal
Posts: 123
Joined: Fri May 06, 2011 10:45 am
Contact:

Re: BetterPHP PHP Library

Post by Kamal »

Give us some ideas. I want to contribute :S
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: BetterPHP PHP Library

Post by jacek »

Kamal wrote:Give us some ideas. I want to contribute :S
Image manipulation if you are feeling up to it :)

Something to basically wrap the GD library functions but also take some of the pain away and maybe add some function to do things like resize images and create thumbnails.
Image
User avatar
Kamal
Posts: 123
Joined: Fri May 06, 2011 10:45 am
Contact:

Re: BetterPHP PHP Library

Post by Kamal »

bleh.. I have no experience at all with GD.
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: BetterPHP PHP Library

Post by jacek »

Then come up with your own idea :lol:
Image
Tino
Posts: 360
Joined: Thu May 05, 2011 8:55 pm
Location: The Netherlands

Re: BetterPHP PHP Library

Post by Tino »

You could do something with caching.
Please check out my CodeCanyon items.
bowersbros
Posts: 534
Joined: Thu May 05, 2011 8:19 pm

Re: BetterPHP PHP Library

Post by bowersbros »

For my reference mainly, and for people to suggest extras:

Validation Class:
  • Secure (general security)
    username validation (remove spaces, etc)
    Password validation (checks security level (types of characters required))
    SecurePass (encryption and salt)
Users Class:
  • login
    register
    available (checks availability of username and email and anything else)
Last edited by bowersbros on Thu May 12, 2011 6:52 pm, edited 1 time in total.
I don't like to brag, but I wasn't circumcised. I was circumnavigated. ;)

Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
User avatar
Temor
Posts: 1186
Joined: Thu May 05, 2011 8:04 pm

Re: BetterPHP PHP Library

Post by Temor »

bowersbros wrote:For my reference mainly, and for people to suggest extras:

Validation Class:
  • Secure (general security)
    username validation (remove spaces, etc)
    Password validation (checks security level (types of characters required))
    SecurePass (encryption and salt)
    available (checks availability of username and email and anything else)
Users Class:
  • login
    register
Looks good!
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: BetterPHP PHP Library

Post by jacek »

bowersbros wrote:For my reference mainly, and for people to suggest extras:

Validation Class:
  • Secure (general security)
    username validation (remove spaces, etc)
    Password validation (checks security level (types of characters required))
    SecurePass (encryption and salt)
    available (checks availability of username and email and anything else)
Users Class:
  • login
    register
Maybe you should just to a login / register combined thing :? most of the methods inthe validation class would make more sense in the login one.

and "general security" is never a good idea, people use it and assume they are protected form everything.
Image
bowersbros
Posts: 534
Joined: Thu May 05, 2011 8:19 pm

Re: BetterPHP PHP Library

Post by bowersbros »

well.. im doing them seperate because login checks data, but register enters data and im trying to get register to check an array also. (so they can enter any details and it will hopefully get entered)
I don't like to brag, but I wasn't circumcised. I was circumnavigated. ;)

Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: BetterPHP PHP Library

Post by jacek »

Hmm okay, well its up to you really, but the "available (checks availability of username and email and anything else)" methid should defiantly be part of the user class.
Image
bowersbros
Posts: 534
Joined: Thu May 05, 2011 8:19 pm

Re: BetterPHP PHP Library

Post by bowersbros »

Code: Select all

$fields = array('name','username','password','users','hey','whatsup');

while($fields){
            foreach(array_keys($fields) as $field){
                 echo $field;
            }
        }

 
What i need is the key of the array name and the content to go together into the database for registration.. Any ideas? :P

/edit: got it.

Code: Select all

$fields = array('name' => 'Alex', 'last_name' => 'bowers', 'month' => 'Jan');

foreach($fields as $k => $v){
    echo "Key: " . $k . " -> Value: " . $v;
}

 
Last edited by bowersbros on Thu May 12, 2011 6:55 pm, edited 1 time in total.
I don't like to brag, but I wasn't circumcised. I was circumnavigated. ;)

Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: BetterPHP PHP Library

Post by jacek »

I don't really get your use of the while loop there :? In fact I have no idea what you mean :lol:

Also it should probably be a post in php help ;)
Image
bowersbros
Posts: 534
Joined: Thu May 05, 2011 8:19 pm

Re: BetterPHP PHP Library

Post by bowersbros »

Got it. see above :P
I don't like to brag, but I wasn't circumcised. I was circumnavigated. ;)

Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: BetterPHP PHP Library

Post by jacek »

bowersbros wrote:Got it. see above :P
Ah fair enough !

Yes that method makes a lot more sense.

Also, any code submission should be done in attachments here on PM me so I can add to the main .zip file.
Image
bowersbros
Posts: 534
Joined: Thu May 05, 2011 8:19 pm

Re: BetterPHP PHP Library

Post by bowersbros »

jacek wrote:
bowersbros wrote:Got it. see above :P
Ah fair enough !

Yes that method makes a lot more sense.

Also, any code submission should be done in attachments here on PM me so I can add to the main .zip file.
no where near done yet, im working on getting it all entered into the database.. kinda difficult without the mysql class :/
I don't like to brag, but I wasn't circumcised. I was circumnavigated. ;)

Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: BetterPHP PHP Library

Post by jacek »

you are not forced to use the other library files. But yeah I can see how it would be ;)
Image
User avatar
EcazS
Posts: 789
Joined: Fri May 06, 2011 5:29 pm

Re: BetterPHP PHP Library

Post by EcazS »

Do something that downloads images from a site
$website = "http://google.com";
$folder = "./folder/images/"
download($website, $folder);
:lol:
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: BetterPHP PHP Library

Post by jacek »

EcazS wrote::lol:
Was that a joke :?

If you think that would be useful then feel free to make it and I will put it in ;)
Image
User avatar
EcazS
Posts: 789
Joined: Fri May 06, 2011 5:29 pm

Re: BetterPHP PHP Library

Post by EcazS »

jacek wrote: Was that a joke :?
No :lol:
jacek wrote: If you think that would be useful then feel free to make it and I will put it in ;)
I doubt it would, I just want such a thing :lol:
bowersbros
Posts: 534
Joined: Thu May 05, 2011 8:19 pm

Re: BetterPHP PHP Library

Post by bowersbros »

EcazS wrote:
jacek wrote: Was that a joke :?
No :lol:
jacek wrote: If you think that would be useful then feel free to make it and I will put it in ;)
I doubt it would, I just want such a thing :lol:
Give it a go? :D
I don't like to brag, but I wasn't circumcised. I was circumnavigated. ;)

Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
User avatar
Kamal
Posts: 123
Joined: Fri May 06, 2011 10:45 am
Contact:

Re: BetterPHP PHP Library

Post by Kamal »

<?php
function download($url, $save_to){
    if(file_put_contents($save_to, file_get_contents($url))){
        return true;
    }else {
        return false;
    }
}
?>
Isn't it that simple?
Post Reply