Coding PHP Scripts

Status
Not open for further replies.

Coder

Member
Jan 4, 2011
34
0
Basically, I want to make a bunch of script (just so I have a personal archive of them). Also, it is good practice for me.

Request scripts you would like and I will do my best to fulfill your requirements (but if I think of doing something differently, there is a high chance I will) :p

All scripts will be released for download here and come with a README.txt file as well as an install.php wherever necessary.

If it is a large script, I may write it in object oriented PHP, and I will most likely use jquery in all scripts.

Programming Language: PHP
Markup Language: HTML
Styling Language: CSS
Database: MySQL
Enhancements: Javascript and jQuery Library

Also, if you want a simple script in C [not C#, not C++, C], you can let me know. I'm learning C right now so it is good practice :p

Things you cannot request:
- Register/Login Script [WAY WAY WAY Overdone. It gets boring after a while]
- Addons for PHPRetro or UberCMS (Though I may be willing to do HoloCMS ones)

Thanks :)

PS: If it gets to be a lot of scripts that need making (I doubt it will though), bear with me and give me time. Understand I go to college and I have a life.
 

Coder

Member
Jan 4, 2011
34
0
@smartguy - I'll get on it.

@Kryptos - OOP, yes.

@WestLife - By cool login I'm gonna assume you mean "cool looking login box" which is all styling and gfx and ish. No. Plus, I Said no register/login script unless it has some unique feature to it.

@StrongFaith - Can you give more details please? Would you like a script that they input email, subject, body, etc and it emails? Or what?

@DayRon - C is not C#. C is closer to C++ which was an object oriented adaptation of C.



C isn't widely used anymore, but its not that hard to learn. Also it was the first language to use if( ){ }else{}, while loops, for loops, switch statements, and all that stuff all the languages use now.
 

Kryptos

prjRev.com
Jul 21, 2010
2,205
1,252
Ok, how about an OOP news system, don't do it all fancy though, as I would use it for learning porposes.
Also, @StrongFaith/Mac
PHP:
<?php
$username = strip_tags($_POST['username']);
$to = "[email protected]";
$headers = "From $username";
$subject = "This is a subject!";
$message = nl2br(strip_tags($_POST['message']));

if(isset($_POST['submit'])) {
if(!isset($username)) {
echo "Please enter your desired username";
} if(!isset($message)) {
echo "Please enter why you should get picked";
}else{
mail($to,$subject,$message,$headers);
echo "Your message has been sent";
}
}else{
?>
<form action='whatever.php' method='post'>
Enter your desired username: </br>
<input type='text' name='username'> </br>
Enter why you should get picked and past experience: </br>
<textarea rows='7' cols='55' name='message'><?php if(isset($_POST['message'])) echo $_POST['message']; ?> </textarea> </br>
<input type='submit' name='submit' value='App'>
</form>
<?php
}
?>
That's the best way to do a mail form, and no, it doesn't make it more advanced or anything if it is OOP.
 

Mac

New Member
Feb 9, 2011
111
2
@Kryptos {
Yeah , its same as mine , same function but coded on an other way :
PHP:
/* MyScripts V2 *\
** Email Scripts
** MyScripts V2 made by Mac
\* MyScripts V2 */

# Email Settings
$To = "[email protected]" ; # Email To
$Name = $_POST['Name'] ;
$Subject = $_POST['Subject'] ; # Email Subject
$Message = $_POST['Message'] ; # Email Message
$From = $_POST['MyEmail'];
$Headers = "From: ".$From;
$Send = $_POST['Send'] ; # Send button.

Function SendMail() { # Send Mail Function , Comments : OFF
	Global $To, $Subject, $Message, $Headers ;
	Mail($To, $Subject, $Message, $Headers) ;
}

If( IsSet( $To ) ) {
	If( $Send ) {
		Global $To, $Subject, $Message, $Headers ;
		$Error = ""; # Error is not set , Comments : ON
		If( !$Name ) { # If name is not selected.
			$Error .= "<p>You should select a name.</p>" ; # Error is set.
		}
		If( !$Message ) { # If message is not selected.
			$Error .= "<p>You should select a message.</p>" ; # Error is set.
		}
		If( !$Subject ) { # If subject is not selected
			$Error .= "<p>You should select a subject.</p>" ; # Error is set.
		}
		If( !$Error ) { # If no error
			SendMail() ; # Send mail
			Echo "<p>Mail sent.</p>" ;
		}
		Else {  # If error
			Echo $Error ; # Echos error.  Comments: OFF
		}
	}
}
Else {
	Echo "Email is not set." ;
}
?>
<!-- Mail form !-->
<html>
<head>
<title>Mail Form</title>
</head>
<body>
<form method='post'>
	<b>Name:</b> <br />
	<input type='text' name='Name'> <br /> <br />
	<b>Your Email:</b> <br />
	<input type='email' name='MyEmail'> <br /> <br />
	<b>Subject:</b> <br />
	<input type='text' name='Subject'> <br /> <br />
	<b>Your Message:</b> <br />
	<textarea rows='5' cols='50' name='Message'></textarea> <br /> <br />
	<input type='submit' name='Send'>
</form>
</body>
</html>
 

Coder

Member
Jan 4, 2011
34
0
Can you NOT use capital letters for your PHP statements?

Kryptos. Thanks. I'll start on your news system. Other than Add News, Edit News, Remove News, View News, any other features?
 

Coder

Member
Jan 4, 2011
34
0
Comments. Ok. I'll start it tomorrow (I have other things for tonight)

Since there are comments, I assume you will want users as well (rather than a hard coded password for adding/editing/deleting news)

I Gotchu ;)
 

Coder

Member
Jan 4, 2011
34
0
I should probably mention that the work I do on these scripts won't be much during the week. Most coding I do during the week is for my habbo retro ( ) but since I don't update it on weekends, I Can devote weekends to other coding work.

@Smart Guy
I've planned your chat thing (how I will do it etc.) it's just a matter of doing it :p

@Kryptos
When I finish his thing, I'll do yours. Yours won't take much planning. Just classes (which I'll do now)

PHP:
Class: Core
{ my pre-made core class that I use for most things object oriented and I add to it as I go along }
Class: Users
{ Also pre-made, that I Will use and add to }
Class: Articles
{ 
Properties: ID, title, content, author, date, comments = array()

Methods: getArticle(id); getComments(); addArticle(title, content, author, date); removeArticle(); updateArticle(property, value); 
}
Class: Comments
{
Properties: Similar to News

Methods: Similar to News
}

Let me know if you want something added. If you don't understand what I mean above, in object oriented programming, functions are called methods and variables are called properties, that should clear things up a bit. That is my plan for the classes. Once classes are made, it is a matter of using them.

Also, due to my inability to do graphics work, and my not wanting to do much HTML/CSS, this script will not have a design. It will be square and ugly. Unless you give me a template.

Thanks

Also, if I don't finish a script in 1 week -_______________- close thread. But gimme a week. I Actually know what I'm doing.
 
Status
Not open for further replies.

Users who are viewing this thread

Top