Home Forums Register FAQ Members List Calendar Search Today's Posts Mark Forums Read Arcade Chat
Go Back   ClubPenguinHQ Forums > General Discussion > Programming > PHP
Reload this Page Constructing a basic program.
PHP Discussion of PHP scripts belongs here.

Constructing a basic program.

Reply
 
LinkBack Thread Tools Display Modes
Constructing a basic program.
Old
  (#1)
Payton is Offline
Member
Payton is an unknown quantity at this point
 
Payton's Avatar
 
Posts: 281
Join Date: Jul 2008
Rep Power: 0
   
Default Constructing a basic program. - Friday, August 14th, 2009

Okay I gotta keep this short because I'm pressed for time (do I cut the blue wire or the red?!) but this is just a tutorial on basic programs in PHP. Yes, we're calling it a program, because it fits the description. Let's go.

First, make your index.php file a form. Nothing fancy for now, you can do that on your own time. Here's the code you'll want to use:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Basic Program - Submission</title>
</head>

<body>
<form action="say.php" method="POST">
Your message: <br />
<textarea rows="10" cols="50" name="message">
Your message here.
</textarea>
</form>
</body>
</html>
Now we have our form set up, and as you saw in it, we want it to go to a file titled "say.php" - however since this file hasn't been created yet, we're going to have to make it. Don't worry, it's a very simple PHP script:

PHP Code:
<?php

echo $_POST['message'];
echo 
"<br /><hr /><strong>Thanks for submitting your message.</strong>";

?>
All this does is posts the information from the form and thanks you for your message. It's very simple, but it still does count as a "program" for what it does. And now, we're done.



LARGE RED TEXT IS SUPER COOL NOW

Last edited by Payton; Saturday, August 15th, 2009 at 01:39pm.
  
Reply With Quote
Old
  (#2)
Hu_ is Offline
Member
Hu_ is on a distinguished road
 
Posts: 61
Join Date: Mar 2009
Rep Power: 3
   
Default Saturday, August 15th, 2009

This is similar to making pcs scripts online.
  
Reply With Quote
Old
  (#3)
Parefgr3 is Offline
Member
Parefgr3 is an unknown quantity at this point
 
Posts: 112
Join Date: Aug 2008
Rep Power: 0
   
Default Saturday, August 15th, 2009

Quote:
Originally Posted by Hu_ View Post
This is similar to making pcs scripts online.
Agreed.

Also, you can also use $_GET[] instead of $_POST[] .
  
Reply With Quote
Old
  (#4)
Hu_ is Offline
Member
Hu_ is on a distinguished road
 
Posts: 61
Join Date: Mar 2009
Rep Power: 3
   
Default Saturday, August 15th, 2009

Quote:
Originally Posted by Parefgr3 View Post
Agreed.

Also, you can also use $_GET[] instead of $_POST[] .
Get sucks andys dick.

It shows the username and password in the address bar.
  
Reply With Quote
Reply

Lower Navigation
Go Back   ClubPenguinHQ Forums > General Discussion > Programming > PHP

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Small Basic Greenday Other 7 Thursday, February 5th, 2009 11:07pm
PCL Script. Basic Bot 0.6 Eternal Macroing & Cheating 8 Friday, June 27th, 2008 01:56pm
Basic Edit Stardude0419 Art 5 Thursday, May 29th, 2008 10:53pm
basic edit Art 12 Wednesday, April 9th, 2008 03:44am



Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
vBulletin Skin developed by: vBStyles.com
Copyright ©2006 - 2009, RancidKraut Industries