| View previous topic :: View next topic |
| Author |
Message |
ElectroFusion Grandmaster Cheater
Reputation: 0
Joined: 17 Dec 2006 Posts: 786
|
Posted: Fri Dec 12, 2008 12:01 am Post subject: [PHP]Code Snippets |
|
|
I'll be posting all of my code snippets here. I'm taking requests.
Very Easy
* Mathematics
| Code: | <html>
<head>
<title>Mathematics</title>
</head>
<body>
<strong>Proper to improper fraction</strong>
<form name="form1" method="post" action="mathematics.php">
Whole Number:<input type="text" name="num1" /><br />
Numerator:<input type="text" name="num2" /><br />
Denominator:<input type="text" name="num3" /><br />
<input type="submit" value="calculate" />
</form>
<strong>Multiplication</strong>
<form name="form2" method="post" action="mathematics.php">
First Number:<input type="text" name="mnum1" /><br />
Second Number:<input type="text" name="mnum2" /><br />
<input type="submit" value="calculate" />
</form>
<?php
if($_POST['num1'])
{
$num1 = $_POST['num1'];
$num2 = $_POST['num2'];
$num3 = $_POST['num3'];
$num4 = $num1 * $num3 + $num2;
$result = "<br />" . $num4 . " over " . $num3;
echo $result;
}
if($_POST['mnum1'])
{
$mnum1 = $_POST['mnum1'];
$mnum2 = $_POST['mnum2'];
$mnum3 = $mnum1 * $mnum2;
$res = "<br />" . $mnum3;
echo $res;
}
?>
</body>
</html> |
Request as much as you want, because I wanna fill up on scripts.  _________________
| qwerty147 wrote: |
| ghostonline wrote: |
what world are you in?
|
bera
but i live in NZ
|
|
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Fri Dec 12, 2008 8:52 am Post subject: |
|
|
| Sorry, but this is something you learn on the first day when you're learning php. |
|
| Back to top |
|
 |
ElectroFusion Grandmaster Cheater
Reputation: 0
Joined: 17 Dec 2006 Posts: 786
|
Posted: Fri Dec 12, 2008 9:50 am Post subject: |
|
|
I know that. Plus I know PHP very well. [(I made my own board like vBulletin)]. I said i'm taking REQUESTS though. _________________
| qwerty147 wrote: |
| ghostonline wrote: |
what world are you in?
|
bera
but i live in NZ
|
|
|
| Back to top |
|
 |
SXGuy I post too much
Reputation: 0
Joined: 19 Sep 2006 Posts: 3551
|
Posted: Fri Dec 12, 2008 10:16 am Post subject: |
|
|
ok heres a request.
Create a php submission form, which sends the data to mysql or access |
|
| Back to top |
|
 |
ElectroFusion Grandmaster Cheater
Reputation: 0
Joined: 17 Dec 2006 Posts: 786
|
Posted: Fri Dec 12, 2008 10:35 am Post subject: |
|
|
@SXGuy, I kind of forgot mysql, so the $query is "I forgot."
| Code: |
<html>
<head><title>Untitled Crap</title>
</head>
<body>
<?php
if(!$_POST['name']){ ?>
<form name="form1" method="post" action="index.php">
Naem plz: <input type="text" name="name" /><br />
Aeg plz: <input type="text" name="age" /><br />
<input type="submit" value="register" />
<?php
}else{
$name = $_POST['name'];
$age = $_POST['age'];
$mysql_host = "your_host";
$mysql_user = "your_user";
$mysql_pass = "your_pass";
$mysql_db = "your_db";
$connect = mysql_connect($mysql_host, $mysql_user, $mysql_pass) or die(mysql_error());
$dbconnect = mysql_select_db($mysql_db, $connect) or die(mysql_error());
$query = "forgot mysql.";
$res = mysql_query($query) or die(mysql_error());
echo 'your account has been made.';
}
?>
</body>
</html> |
_________________
| qwerty147 wrote: |
| ghostonline wrote: |
what world are you in?
|
bera
but i live in NZ
|
|
|
| Back to top |
|
 |
p99 Master Cheater
Reputation: 0
Joined: 21 Jan 2007 Posts: 271
|
Posted: Fri Dec 12, 2008 1:11 pm Post subject: |
|
|
Filter the input >.<
How about an authentication script utilizing flash cookies? _________________
|
|
| Back to top |
|
 |
ElectroFusion Grandmaster Cheater
Reputation: 0
Joined: 17 Dec 2006 Posts: 786
|
|
| Back to top |
|
 |
Spawnfestis GO Moderator
Reputation: 0
Joined: 02 Nov 2007 Posts: 1746 Location: Pakistan
|
Posted: Sat Dec 13, 2008 1:54 pm Post subject: |
|
|
| ElectroFusion wrote: | | I know that. Plus I know PHP very well. [(I made my own board like vBulletin)]. I said i'm taking REQUESTS though. |
Dude will you ever give it up?
Go fuck yourself, and take your trolling elsewhere. Everyone knows you do not know anything, stop making yourself look bigger than you are, this is not a place to gain fans nor achieve a larger e-penis, please, stick to the maplestory forum - faggot.
Thanks.  _________________
CLICK TO HAX MAPLESTORAY ^ !!!! |
|
| Back to top |
|
 |
SXGuy I post too much
Reputation: 0
Joined: 19 Sep 2006 Posts: 3551
|
Posted: Sun Dec 14, 2008 6:22 am Post subject: |
|
|
| i gotta admit, every request thats been written, is just a template ive seen in other places, maybe variables have been changed but thats it lol |
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Sun Dec 14, 2008 9:59 am Post subject: |
|
|
| SXGuy wrote: | | i gotta admit, every request thats been written, is just a template ive seen in other places, maybe variables have been changed but thats it lol |
Im not saying EF knows what he's doing, but alot of php is pretty much the same code. There's only a few ways to do things sometimes. _________________
|
|
| Back to top |
|
 |
torpin005 Master Cheater
Reputation: 0
Joined: 19 Nov 2007 Posts: 255
|
Posted: Sun Dec 14, 2008 12:57 pm Post subject: |
|
|
Can you send me your forumt hign? _________________
Go check it out. Good Hacks |
|
| Back to top |
|
 |
|