Be a Supporter!

Php: Main

  • 85,593 Views
  • 591 Replies
New Topic Respond to this Topic
DFox
DFox
  • Member since: Aug. 9, 2003
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Php: Main Nov. 14th, 2005 @ 07:52 PM Reply

At 11/14/05 07:49 PM, Afro_Ninja wrote: Also, GC, we can't edit posts, just delete them. So if you mess up you can just repost like you did this time

I did not know that. Thanks for the information. Also, thank you for cleaning up the posts.


BBS Signature
JeremysFilms
JeremysFilms
  • Member since: Feb. 18, 2005
  • Offline.
Forum Stats
Member
Level 18
Blank Slate
Response to Php: Main Nov. 14th, 2005 @ 08:45 PM Reply

At 11/14/05 07:52 PM, GamesCool wrote: I did not know that. Thanks for the information. Also, thank you for cleaning up the posts.

:D Shawn's the best. He was even kind enough not to get pissed for posting again after he said everyone please refrain from posting.

DFox
DFox
  • Member since: Aug. 9, 2003
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Php: Main Nov. 14th, 2005 @ 09:00 PM Reply

PHP: Using explode and implode functions


BBS Signature
Greeley
Greeley
  • Member since: Aug. 30, 2005
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to Php: Main Nov. 14th, 2005 @ 10:01 PM Reply

At 11/14/05 09:00 PM, GamesCool wrote: PHP: Using explode and implode functions

I breifly read over this one GamesCool. I don't quite understand it because I'm only but a humble beginner. I'll be going through and reading all of the complicated ones once I understand the basics alot more. I still need to understand strings, arrays, and some functions abit more. I'll understand it all over time.

Pilot-Doofy
Pilot-Doofy
  • Member since: Sep. 13, 2003
  • Offline.
Forum Stats
Member
Level 37
Musician
Response to Php: Main Nov. 14th, 2005 @ 10:15 PM Reply

At 11/14/05 10:01 PM, Greeley wrote: I still need to understand strings, arrays, and some functions abit more. I'll understand it all over time.

Strings are one of the most simple concepts a human can comprehend. Since PHP doesn't have a method of discerning between single characters (char) and multi-character strings (string) then everything that contains quotes is a string. Well, that's a nice general rule to use.

You know, in C/C++ 'b' is a char while "hello" is a string.

Arrays are pretty easy also. Using predefined functions isn't much different than using simple constructs such as echo. If you're building your own functions I find it a lot simpler than building them in other languages such as C/C++.

In php, while defining your own function there is no return type that must be specified; however, I also make a note showing the return type so I know how to use the function in later programs.

If you're used to a C language you can think of the function keyword as the return type. You declare a function in php like this:

function func_name(argument list) {
function code
}

Here is a basic function that just renames echo to show_output and turns the construct into a function which an optional return parameter.

function show_output($string, $return = 1) {
if ($return == 0) {
return$string;
} else {
echo $string;
}
}

Okay, this is a nice feature because we can have a void return type if the statement is echoed or we can have a string return type if return is set to false.

Pilot-Doofy
Pilot-Doofy
  • Member since: Sep. 13, 2003
  • Offline.
Forum Stats
Member
Level 37
Musician
Response to Php: Main Nov. 14th, 2005 @ 10:18 PM Reply

I'm writing a tutorial on how to write your own functions so no one else take it please!

Greeley
Greeley
  • Member since: Aug. 30, 2005
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to Php: Main Nov. 15th, 2005 @ 09:44 PM Reply

Thankyou for the help man... I never really knew what a string was exactly but you are right... it's quite the easiest thing and I was using them without even knowing what they were called!

Greeley
Greeley
  • Member since: Aug. 30, 2005
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to Php: Main Nov. 20th, 2005 @ 06:40 PM Reply

Someone write some more tutorials so I can learn some more from the newgrounds users. :P

Taylor
Taylor
  • Member since: Aug. 19, 2003
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Php: Main Nov. 20th, 2005 @ 06:54 PM Reply

This shit is way too basic, I'm going to write a real one in a bit.

Greeley
Greeley
  • Member since: Aug. 30, 2005
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to Php: Main Nov. 20th, 2005 @ 07:14 PM Reply

At 11/20/05 06:54 PM, PillowBiter wrote: This shit is way too basic, I'm going to write a real one in a bit.

Learning Basics is essential before going onto harder stuff!

DFox
DFox
  • Member since: Aug. 9, 2003
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Php: Main Nov. 20th, 2005 @ 11:12 PM Reply

At 11/20/05 06:54 PM, PillowBiter wrote: This shit is way too basic, I'm going to write a real one in a bit.

What do you mean a "real one"?

Learning Basics is essential before going onto harder stuff!
At 11/20/05 07:14 PM, Greeley wrote: Learning Basics is essential before going onto harder stuff!

Exactly. If you don't understand the basics, and you go on to harder stuff, you're screwed.


BBS Signature
Greeley
Greeley
  • Member since: Aug. 30, 2005
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to Php: Main Nov. 21st, 2005 @ 12:42 AM Reply

At 11/20/05 11:12 PM, GamesCool wrote: Exactly. If you don't understand the basics, and you go on to harder stuff, you're screwed.

Exactly, and that is why I hate it when people post in forums asking how to make a portal because they are getting in WAY over there heads.

keifer121
keifer121
  • Member since: Aug. 31, 2005
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to Php: Main Dec. 1st, 2005 @ 02:37 AM Reply

Umm i will make a forum with all these link in it so it wont get lsot and it wont keep getting posted over and so i can edit it just puyst every single tut ina reply and ill host it then ill host AS main then all the rest

DFox
DFox
  • Member since: Aug. 9, 2003
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Php: Main Dec. 1st, 2005 @ 03:38 PM Reply

At 12/1/05 02:37 AM, keifer_kjm wrote: Umm i will make a forum with all these link in it so it wont get lsot and it wont keep getting posted over and so i can edit it just puyst every single tut ina reply and ill host it then ill host AS main then all the rest

I could do the same thing by hosting it on my site, but I'm not sure what that would acheive. No one would find it from the BBS.

Also, I will be adding more tutorials in the near future, so it wont get lost.


BBS Signature
JeremysFilms
JeremysFilms
  • Member since: Feb. 18, 2005
  • Offline.
Forum Stats
Member
Level 18
Blank Slate
Response to Php: Main Dec. 1st, 2005 @ 03:42 PM Reply

Someone should do a tutorial on making PHP Polls. (for voting)

keifer121
keifer121
  • Member since: Aug. 31, 2005
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to Php: Main Dec. 2nd, 2005 @ 12:03 AM Reply

But just incase ya know i do have my ownwebsite im working on it wihtFlashKid And AuthorBlues

Khao
Khao
  • Member since: Sep. 20, 2003
  • Offline.
Forum Stats
Member
Level 20
Blank Slate
Response to Php: Main Dec. 2nd, 2005 @ 12:09 AM Reply

I dont see any PHP : Using a mySQL Database ^^
I think I'll make one since I'm bored and it's the only thing I know in PHP :P

DFox
DFox
  • Member since: Aug. 9, 2003
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Php: Main Dec. 2nd, 2005 @ 12:10 AM Reply

At 12/1/05 03:42 PM, JeremysFilms wrote: Someone should do a tutorial on making PHP Polls. (for voting)

I'll try to put one together if I can find enough time. Can anyone else make it?


BBS Signature
DFox
DFox
  • Member since: Aug. 9, 2003
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Php: Main Dec. 2nd, 2005 @ 12:11 AM Reply

At 12/2/05 12:09 AM, -KhAo- wrote: I dont see any PHP : Using a mySQL Database ^^
I think I'll make one since I'm bored and it's the only thing I know in PHP :P

Awesome! I can't wait to see it. It will really help a lot of people.


BBS Signature
Toast
Toast
  • Member since: Apr. 2, 2005
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Php: Main Dec. 2nd, 2005 @ 02:16 AM Reply

At 12/1/05 03:42 PM, JeremysFilms wrote: Someone should do a tutorial on making PHP Polls. (for voting)

Eh, you just need to know some very basic html forms, learn how to use echo in php, and also learn how to use a database :P
Seriously though, I think it can be simply done with forms and echo, and probably the post method.


BBS Signature
Afro-Ninja
Afro-Ninja
  • Member since: Mar. 2, 2002
  • Offline.
Forum Stats
Moderator
Level 44
Game Developer
Response to Php: Main Dec. 2nd, 2005 @ 09:30 AM Reply

At 12/2/05 02:16 AM, -Toast- wrote:
Seriously though, I think it can be simply done with forms and echo, and probably the post method.

The poll results still have to be stored somewhere, either in a database or a text file.


BBS Signature
Toast
Toast
  • Member since: Apr. 2, 2005
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Php: Main Dec. 2nd, 2005 @ 12:01 PM Reply

At 12/2/05 09:30 AM, Afro_Ninja wrote: The poll results still have to be stored somewhere, either in a database or a text file.

Isn't it a bit what I said?

At 12/2/05 02:16 AM, -Toast- wrote:
and also learn how to use a database :P

BBS Signature
Afro-Ninja
Afro-Ninja
  • Member since: Mar. 2, 2002
  • Offline.
Forum Stats
Moderator
Level 44
Game Developer
Response to Php: Main Dec. 2nd, 2005 @ 12:25 PM Reply

At 12/2/05 12:01 PM, -Toast- wrote:
At 12/2/05 02:16 AM, -Toast- wrote:
and also learn how to use a database :P

Sorry, didn't see that. Flat files were worth a mention anyway =)


BBS Signature
Toast
Toast
  • Member since: Apr. 2, 2005
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Php: Main Dec. 2nd, 2005 @ 01:06 PM Reply

What are flat files? Never heard about it...


BBS Signature
DFox
DFox
  • Member since: Aug. 9, 2003
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Php: Main Dec. 2nd, 2005 @ 01:21 PM Reply

At 12/2/05 01:06 PM, -Toast- wrote: What are flat files? Never heard about it...

Flat files are basicaly text files that are stored on the server, and you can store data in them. They are not really secure unless you put it above the root directory on the server, otherwise they could be opened by anyone.

A database is a better secure and more usable option.


BBS Signature
shazwoogle
shazwoogle
  • Member since: Sep. 27, 2004
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Php: Main Dec. 4th, 2005 @ 08:41 PM Reply

i need help with special characters.. =(

what im doing is sending data from flash to a php script then from the php save the data to a txt file then get flash to load that data back from the txt file

it works 90%... =(
it sends fines
but dosnt save fine
ergo it cant lad to well

this is the data that im sendin
'<font color="#DCC81C"><b>"+name.name+"</b></font
><br>'

the problem is when php gets that info it turns the " into \" and then that screws it up for flash =(

any way what im asking is, is there a way of stopping " turning into \"?

DFox
DFox
  • Member since: Aug. 9, 2003
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Php: Main Dec. 4th, 2005 @ 09:25 PM Reply

When, you pull the data out, before you output it for flashes use, try stripslashes()


BBS Signature
Sir-Davey
Sir-Davey
  • Member since: Jul. 9, 2001
  • Offline.
Forum Stats
Member
Level 19
Blank Slate
Response to Php: Main Dec. 5th, 2005 @ 04:41 PM Reply

PHP: Rapid Website Development


BBS Signature
DFox
DFox
  • Member since: Aug. 9, 2003
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Php: Main Dec. 5th, 2005 @ 04:52 PM Reply

PHP: GENERAL CODE:

BEGINNER (2)
PHP: Beginners tutorial by GamesCool
PHP: Website Progress/Percentages by Greeley

INTERMEDIATE (3)
PHP: file uploads by Pilot-Doofy
PHP: securing file uploads by Pilot-Doofy
PHP: Using explode and implode functions by GamesCool

PHP: SPECIFIC PROJECTS:

BEGINNER (1)
PHP: Create a random quotes script by GamesCool

INTERMEDIATE (1)
PHP: Random quote image by GamesCool

PHP: USEFUL RESOURCES:

BEGINNER (1)
PHP: Rapid Website Development by Sir-Davey

Total number of tutorials: 8


BBS Signature
IWantSomeCookies
IWantSomeCookies
  • Member since: Aug. 20, 2004
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to Php: Main Dec. 14th, 2005 @ 07:32 AM Reply

Starting to grow, a bit lol.

I might make a PHP: Tutorial later. :-)


"Actually, the server timed out trying to remove all your posts..."
-TomFulp