| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#21 (permalink) | |
|
Registered User
Join Date: Oct 2007
Posts: 7
|
New to PHP...need help
Quote:
It appears as though the PHP code above to transform a filename into a clean string is what I've been looking for. I'm on the ground floor with PHP, and without sounding like a complete idiot, I really need to know where this code goes and how to implement it on each of my web pages. I have a div for banner where I'd like the page title to appear. Do I simply place this code in the div? |
|
|
|
|
|
|
#23 (permalink) |
|
Registered User
Join Date: Mar 2006
Location: Colleyville, Tx
Posts: 43
|
heres my pagination link function which will out put something like << < 4 5 6 7 8 9 10 > >> PHP Code:
and a quick simple example PHP Code:
|
|
|
|
#24 (permalink) |
|
I like code.
|
This isn't a function but a bunch of functions(methods) in a container(class) I created a couple of classes that I use GDImage and GDDraw both in the same file. I just attached the file because it is pretty big, but I will put a simple example here. Note: This is still a work in progress, so there might be one or so things that might not work exactly as planned but so far I have not had any problems what so ever. PHP Code:
and one more example while using the GDDraw class PHP Code:
Each method is documented in the classes so it should be pretty easy to see how everything will work and such. |
|
|
|
#25 (permalink) |
|
Moderator
Join Date: Jan 2005
Location: Brooklyn, NYC
Posts: 11,869
|
Something I recently wrote... PHP Code:
Find good advice in the beginners web design thread.
patrick o'neill web developer | blog | spam humor |
|
|
|
#26 (permalink) |
|
Designers are strange :)
|
PHP Code:
PHP Code:
PHP Code:
These aren't too complex, but they work, so yeah. Happy XMAS!!!!!! I love using die(); in my scripts. XD If it works, it's valid.
Last edited by RaelRode : 18-12-2007 at 15:59. |
|
|
|
#27 (permalink) |
|
Trailer Trash™
Join Date: Sep 2006
Posts: 851
|
rael: comments, meant to be constructive ok? and i've avoided php for ages now so really only general stuff it's hashing not encryption; also, dont multi-hash things - it does nothing except chew resources - you want a salted hash you're checking for magic quotes twice which is just a waste of resources - lose the elseif and just else it surely a method that checks for the validity of something should return a boolean rather than a string? (check_email). your naming sucks i.e. check_email - perhaps is_valid_format_email instead? slightly more verbose but it reads better, follows php conventions and allows for a consistent scheme e.g. is_valid_format_address etc. naming your args the same as your methods is useless meh.
|
|
|
|
#28 (permalink) |
|
Designers are strange :)
|
I commented it because I wasn't the only developer, and I was giving it to my friend who wanted to learn PHP. Naming convention, ok I see your point. The make_safe function...well yeah it seemed logical before but maybe not...shit. Lol. Oh and as for the mutiple encryption / encoding, I will write a new one later on. If it works, it's valid.
|
|
|
|
#30 (permalink) |
|
Podcaster on Web Design
|
Used for security redirects while users log in. It works well. PHP Code:
|
|
|
|
#31 (permalink) | |
|
rock n' roller
|
Wow awesome scripts, specially this one. Quote:
And one from me. PHP Code:
|
|
|
|
|
#32 (permalink) | ||
|
www.mesrop.info
|
my simple and useful func. PHP Code:
Quote:
Quote:
|
||
|
|
|
#33 (permalink) |
|
I like code.
|
Got a easy to use function for resizing images, while keeping the aspect ratio. The function. PHP Code:
|