[advanced search]
Results from the most recent live auction are here.
18 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Domain Name Industry Newsletter
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 06-16-2008, 06:27 PM   · #1
yilduz
NamePros Regular
 
Name: Dennis.
Location: Wisconsin
Trader Rating: (7)
Join Date: May 2008
Posts: 277
NP$: 97.00 (Donate)
yilduz is on a distinguished roadyilduz is on a distinguished road
Animal Rescue
my first php code!

I created a php code! I made a guestbook. Rather than find a guestbook code and figure it out, I decided to read some tutorials and make my own. I did it and it works and I now have my own guestbook!

I'm confident in learning php now.


Please register or log-in into NamePros to hide ads
__________________
I'm selling off domains at my homepage | PaganDruid.com | My family site | RunicTarot.com | Affpros.com
yilduz is offline   Reply With Quote
Old 06-16-2008, 06:31 PM   · #2
Hurley4540
Hurley4540.com
 
Trader Rating: (21)
Join Date: May 2003
Posts: 2,402
NP$: 2179.50 (Donate)
Hurley4540 is a splendid one to beholdHurley4540 is a splendid one to beholdHurley4540 is a splendid one to beholdHurley4540 is a splendid one to beholdHurley4540 is a splendid one to beholdHurley4540 is a splendid one to beholdHurley4540 is a splendid one to behold
Nice, more than I can make
Hurley4540 is offline   Reply With Quote
Old 06-16-2008, 06:31 PM   · #3
weblord
www.1weblord.com
 
weblord's Avatar
 
Name: William R. Nabaza - williamrnabaza.com
Location: Philippines - www.Nabaza.com
Trader Rating: (234)
Join Date: Dec 2005
Posts: 19,348
NP$: 18063.28 (Donate)
weblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatness
Autism Protect Our Planet
where did you place it? can we see the code?
weblord is offline  
  Reply With Quote
Old 06-16-2008, 06:41 PM   · #4
yilduz
NamePros Regular
 
Name: Dennis.
Location: Wisconsin
Trader Rating: (7)
Join Date: May 2008
Posts: 277
NP$: 97.00 (Donate)
yilduz is on a distinguished roadyilduz is on a distinguished road
Animal Rescue
Originally Posted by weblord
where did you place it? can we see the code?


I placed it on my homepage.

http://yilduz.com/contact.php#guestbook

It's not the best in the world, it's only very, very basic. I'm going to improve it eventually, but I just started reading php tutorials yesterday. I think it's good for a day of learning.
__________________
I'm selling off domains at my homepage | PaganDruid.com | My family site | RunicTarot.com | Affpros.com
yilduz is offline   Reply With Quote
Old 06-16-2008, 06:52 PM   · #5
weblord
www.1weblord.com
 
weblord's Avatar
 
Name: William R. Nabaza - williamrnabaza.com
Location: Philippines - www.Nabaza.com
Trader Rating: (234)
Join Date: Dec 2005
Posts: 19,348
NP$: 18063.28 (Donate)
weblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatness
Autism Protect Our Planet
looks good
weblord is offline  
  Reply With Quote
Old 06-16-2008, 06:54 PM   · #6
yilduz
NamePros Regular
 
Name: Dennis.
Location: Wisconsin
Trader Rating: (7)
Join Date: May 2008
Posts: 277
NP$: 97.00 (Donate)
yilduz is on a distinguished roadyilduz is on a distinguished road
Animal Rescue
Originally Posted by weblord
looks good


Thank you!

I've been working very hard to get the html, javascript, css, php and mysql all work together. I think I'll get the hang of it soon.
__________________
I'm selling off domains at my homepage | PaganDruid.com | My family site | RunicTarot.com | Affpros.com
yilduz is offline   Reply With Quote
Old 06-16-2008, 06:58 PM   · #7
weblord
www.1weblord.com
 
weblord's Avatar
 
Name: William R. Nabaza - williamrnabaza.com
Location: Philippines - www.Nabaza.com
Trader Rating: (234)
Join Date: Dec 2005
Posts: 19,348
NP$: 18063.28 (Donate)
weblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatness
Autism Protect Our Planet
finally paid off.

Originally Posted by yilduz
Thank you!

I've been working very hard to get the html, javascript, css, php and mysql all work together. I think I'll get the hang of it soon.

weblord is offline  
  Reply With Quote
Old 06-16-2008, 07:34 PM   · #8
SecondVersion
while ($awake){ code(); }
 
SecondVersion's Avatar
 


Name: Eric
Location: Kentucky
Trader Rating: (142)
Join Date: Mar 2005
Posts: 4,239
NP$: 384.00 (Donate)
SecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond repute
Member of the Month
MOTM September 2005 Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet
Originally Posted by yilduz
I placed it on my homepage.

http://yilduz.com/contact.php#guestbook

It's not the best in the world, it's only very, very basic. I'm going to improve it eventually, but I just started reading php tutorials yesterday. I think it's good for a day of learning.


Not a bad start, but tip - www.php.net/empty

I was able to submit a blank entry
__________________

SecondVersion.com - The Personal Blog of SecondVersion
Domain Name Portfolio - Get your free copy. - Version 1.0.2 now available!!
MetaCreator.com - Free Meta Tag Creator
CodingPlanet.com - Coming soon...
SecondVersion is offline   Reply With Quote
Old 06-16-2008, 07:37 PM   · #9
yilduz
NamePros Regular
 
Name: Dennis.
Location: Wisconsin
Trader Rating: (7)
Join Date: May 2008
Posts: 277
NP$: 97.00 (Donate)
yilduz is on a distinguished roadyilduz is on a distinguished road
Animal Rescue
Originally Posted by SecondVersion
Not a bad start, but tip - www.php.net/empty

I was able to submit a blank entry


Ah, thank you.

That's one of the reasons I've been posting it. I'm ALWAYS looking for more tips, help, ideas, etc...

thank you. I'll look at it and make the appropriate edits.
__________________
I'm selling off domains at my homepage | PaganDruid.com | My family site | RunicTarot.com | Affpros.com
yilduz is offline   Reply With Quote
Old 06-16-2008, 08:29 PM   · #10
wikes82
NamePros Regular
 
wikes82's Avatar
 
Location: K-R.NET
Trader Rating: (43)
Join Date: Sep 2006
Posts: 850
NP$: 1701.73 (Donate)
wikes82 has much to be proud ofwikes82 has much to be proud ofwikes82 has much to be proud ofwikes82 has much to be proud ofwikes82 has much to be proud ofwikes82 has much to be proud ofwikes82 has much to be proud ofwikes82 has much to be proud of
Save a Life Cancer
hmm, you need to filter HTML tag in input...
http://en.wikipedia.org/wiki/Cross-site_scripting

hint: http://us.php.net/strip_tags
__________________
#include <signature.h>
Accepting offer : FUYP.COM - HOYV.COM - OWKZ.COM
wikes82 is offline   Reply With Quote
Old 06-17-2008, 12:03 AM   · #11
xrvel
xrvel is cruel :-)
 
xrvel's Avatar
 
Name: Kurniawan
Location: Indonesia
Trader Rating: (29)
Join Date: Nov 2007
Posts: 1,005
NP$: 1169.18 (Donate)
xrvel is a splendid one to beholdxrvel is a splendid one to beholdxrvel is a splendid one to beholdxrvel is a splendid one to beholdxrvel is a splendid one to beholdxrvel is a splendid one to beholdxrvel is a splendid one to behold
Who put an alert box there? I prefer htmlentities than stripping tags, btw.
__________________
Xrvel Love Domains TraceNic
xrvel is offline   Reply With Quote
Old 06-17-2008, 12:44 AM   · #12
wikes82
NamePros Regular
 
wikes82's Avatar
 
Location: K-R.NET
Trader Rating: (43)
Join Date: Sep 2006
Posts: 850
NP$: 1701.73 (Donate)
wikes82 has much to be proud ofwikes82 has much to be proud ofwikes82 has much to be proud ofwikes82 has much to be proud ofwikes82 has much to be proud ofwikes82 has much to be proud ofwikes82 has much to be proud ofwikes82 has much to be proud of
Save a Life Cancer
Originally Posted by xrvel
Who put an alert box there?



sorry, I just can't resist ... i did it...
__________________
#include <signature.h>
Accepting offer : FUYP.COM - HOYV.COM - OWKZ.COM
wikes82 is offline   Reply With Quote
Old 06-17-2008, 01:25 AM   · #13
Barrucadu
Formally Mikor.
 
Barrucadu's Avatar
 
Name: Michael Walker
Location: East Yorkshire, England
Trader Rating: (7)
Join Date: Aug 2005
Posts: 2,546
NP$: 171.25 (Donate)
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold
Well done, it's good for a first start. I learned PHP by making an image hosting script, followed by an arcade script.
__________________
Me | Last.fm | F@h | Archlinux.co.uk

archlinux User
Barrucadu is offline   Reply With Quote
Old 06-17-2008, 01:51 AM   · #14
Mujahid
NamePros Regular
 
Mujahid's Avatar
 
Name: Mujahid Ishtiaq
Location: PK
Trader Rating: (11)
Join Date: Apr 2007
Posts: 341
NP$: 217.50 (Donate)
Mujahid will become famous soon enoughMujahid will become famous soon enough
I`m also learning php these days. I also know C/C++ so its becoming easy for me to learn php. I`ve left a comment on your guestbook as well.
__________________
Your Link in 100 Social Bookmarking Websites - 260 NP$
Mujahid is offline   Reply With Quote
Old 06-17-2008, 01:52 AM   · #15
Smiler
NamePros Regular
 
Smiler's Avatar
 
Trader Rating: (2)
Join Date: Jul 2007
Posts: 902
NP$: 270.00 (Donate)
Smiler has a spectacular aura aboutSmiler has a spectacular aura about
Where can you get some good practice and tutorial for php coding. I know HTML but I'm hoping to learn php codes in the near future. I've been reading about php and I've learn that its a very dynamic code which is really cool IMO.
__________________
Game9.net|ZipCoders.com|Blog94.com|VXEM.com|Payz.info|m-voting.net|

My 2nd & 3rd Signature Line is for rent $10/Month. PM me if your intested


Smiler is offline   Reply With Quote
Old 06-17-2008, 05:47 AM   · #16
yilduz
NamePros Regular
 
Name: Dennis.
Location: Wisconsin
Trader Rating: (7)
Join Date: May 2008
Posts: 277
NP$: 97.00 (Donate)
yilduz is on a distinguished roadyilduz is on a distinguished road
Animal Rescue
Originally Posted by Smiler
Where can you get some good practice and tutorial for php coding. I know HTML but I'm hoping to learn php codes in the near future. I've been reading about php and I've learn that its a very dynamic code which is really cool IMO.


When I coded my guestbook, I was actually looking at several tutorials. I'd google for tutorials and look at a few, when they all did something similar and had the same bit of code, i knew that's what did it. I've noticed that many, many php tutorials are horribly non-descriptive. Most just show a working code and say what the entire thing does. Not really a tutorial, if you ask me. Maybe I'll write some when I learn a bit more.
________________
As soon as I saw that little wazzup box pop up, I knew you guys were doing more stuff to see what I did wrong. :P
Thank you, though. I'll look at what you guys have shown me and learn a bit more.

Thanks for the comments and the help.

Quote:
Well done, it's good for a first start. I learned PHP by making an image hosting script, followed by an arcade script.


As soon as I get the guestbook good, project 2 is going to be a text-based game.
__________________
I'm selling off domains at my homepage | PaganDruid.com | My family site | RunicTarot.com | Affpros.com
yilduz is offline   Reply With Quote
Old 06-17-2008, 12:57 PM   · #17
yilduz
NamePros Regular
 
Name: Dennis.
Location: Wisconsin
Trader Rating: (7)
Join Date: May 2008
Posts: 277
NP$: 97.00 (Donate)
yilduz is on a distinguished roadyilduz is on a distinguished road
Animal Rescue
I've been looking around those links you guys gave me. I think it's good now.

Anyone want to check it for me?
__________________
I'm selling off domains at my homepage | PaganDruid.com | My family site | RunicTarot.com | Affpros.com
yilduz is offline   Reply With Quote
Old 06-17-2008, 06:09 PM   · #18
thebrokenbox
Account Closed
 
Location: USA
Trader Rating: (9)
Join Date: May 2008
Posts: 632
NP$: 13.65 (Donate)
thebrokenbox is a jewel in the roughthebrokenbox is a jewel in the roughthebrokenbox is a jewel in the rough
Still has annoying javascript popups. It's a nice little script and stuff. Now work on adding anti-spam measures and that whole blank and html issues. Other then that great job. I need to get back into PHP
thebrokenbox is offline   Reply With Quote
Old 06-17-2008, 07:08 PM   · #19
yilduz
NamePros Regular
 
Name: Dennis.
Location: Wisconsin
Trader Rating: (7)
Join Date: May 2008
Posts: 277
NP$: 97.00 (Donate)
yilduz is on a distinguished roadyilduz is on a distinguished road
Animal Rescue
Originally Posted by thebrokenbox
Still has annoying javascript popups. It's a nice little script and stuff. Now work on adding anti-spam measures and that whole blank and html issues. Other then that great job. I need to get back into PHP


I think I eliminated those problems. The boxes were already put there from other people. i'll get rid of them. See if you can still add that stuff.
__________________
I'm selling off domains at my homepage | PaganDruid.com | My family site | RunicTarot.com | Affpros.com
yilduz is offline   Reply With Quote
Old 06-17-2008, 07:36 PM   · #20
SecondVersion
while ($awake){ code(); }
 
SecondVersion's Avatar
 


Name: Eric
Location: Kentucky
Trader Rating: (142)
Join Date: Mar 2005
Posts: 4,239
NP$: 384.00 (Donate)
SecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond repute
Member of the Month
MOTM September 2005 Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet
Pulled this from one of my projects, try this:

PHP Code:
/**
* Strip any unsafe tags/chars/attributes from input values.
*
* @param  string  Value to be cleaned
* @param  boolean Strip \r\n ?
* @return string
*/
function sanitize($value, $strip_crlf = true)
{
    
// Some of what we have in the $search array may not be needed, but let's be safe.
    
$search = array(
        
'@<script[^>]*?>.*?</script>@si',
        
'@<applet[^>]*?>.*?</applet>@si',
        
'@<object[^>]*?>.*?</object>@si',
        
'@<iframe[^>]*?>.*?</iframe>@si',
        
'@<style[^>]*?>.*?</style>@si',
        
'@<form[^>]*?>.*?</form>@si',
        
'@<[\/\!]*?[^<>]*?>@si',
        
'@&(?!(#[0-9]+|[a-z]+);)@si'
    
);

    if (
$strip_crlf)
    {
        
array_push($search, '@([\r\n])[\s]+@');
    }
    
$value = preg_replace($search, '', $value);

    
// Make sure we get everything..
    
$value = strip_tags($value);

    return
clean($value);
}

/**
* Cleans either a string, or can clean an entire array of values:
*    clean($array);
*
* @param  mixed  Value to be cleaned
* @return mixed
*/
function clean($value)
{
    if (
is_array($value))
    {
        foreach (
$value AS $key => $val)
        {
            if (
is_string($val))
            {
                
$value["$key"] = trim(stripslashes($val));
            }
            else if (
is_array($val))
            {
                
$value["$key"] = clean($value["$key"]);
            }
        }
        return
$value;
    }
    return
trim(stripslashes($value));
}


Example:

PHP Code:
$name = sanitize($_POST['name']);
__________________

SecondVersion.com - The Personal Blog of SecondVersion
Domain Name Portfolio - Get your free copy. - Version 1.0.2 now available!!
MetaCreator.com - Free Meta Tag Creator
CodingPlanet.com - Coming soon...
SecondVersion is offline   Reply With Quote
Old 06-20-2008, 09:33 AM   · #21
-Ray-
An American Soldier
 
-Ray-'s Avatar
 
Name: Ray
Location: Pennsylvania
Trader Rating: (25)
Join Date: Jun 2005
Posts: 1,521
NP$: 347.25 (Donate)
-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold
Originally Posted by yilduz
I created a php code! I made a guestbook. Rather than find a guestbook code and figure it out, I decided to read some tutorials and make my own. I did it and it works and I now have my own guestbook!

I'm confident in learning php now.



yep.. ive been working with php for 5 years off and on.. i dont use it extensivivly, but rather just for my little projects.
__________________
-- Afghanistan --
-Ray- is offline   Reply With Quote
Old 06-25-2008, 04:26 AM   · #22
itnashvillecom
Elite PHP Guru
 
Trader Rating: (14)
Join Date: Jun 2008
Posts: 151
NP$: 0.00 (Donate)
itnashvillecom is on a distinguished roaditnashvillecom is on a distinguished road
Very nice, great job!!
__________________

Now accepting quality coding jobs (LAMP)!


Innovative Technologies
itnashvillecom is offline   Reply With Quote
Old 06-27-2008, 10:40 AM   · #23
mholt
DNOA Member
 
mholt's Avatar
 
Name: Matthew Holt
Location: 127.0.0.1
Trader Rating: (75)
Join Date: May 2004
Posts: 4,869
NP$: 17.21 (Donate)
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Couldn't hurt to run mysql_real_escape_string() on all the input put into the database, either.
__________________
www.mwholt.com
mholt is offline   Reply With Quote