EOSERV Forum > Programming > Example of the GET function PHP
Topic is locked.
Page: << 1 >>
Example of the GET function PHP
Author Message
Post #138178 Example of the GET function PHP

Paha I had a lot of fun making this, so I thought you guys would have just as much fun playing with the concept

www.danscottnetwork.co.uk/xbox 

Type in what you want in the box, and it displays whatever you typed as an xbox achievement. Magic right? XD.. But in all seriousness it is just using the $_GET function if anyone wants the source I'll share it but it was really simple. Have fun guize.

---
If money doesn't grow on trees, then why do banks have branches?
14 years, 14 weeks ago
Post #138179 Re: Example of the GET function PHP

On page load make it expand from the Xbox logo. Just set no overflow and resize on document on load. This could be a fun thing to email to friends and let them open it. 

---
Andrewbob - I would be on the fucking copter of rofls

Programmer, Web Developer, and Graphics Designer
14 years, 14 weeks ago
Post #138180 Re: Example of the GET function PHP

Is this really needed? It's nothing special and way basic for PHP.

$variable = $_GET[id];

---
Eat shit, bro.

I support Ephixa [http://ephixa.com/]. Fuck Skrillex, Sonny Moore is no more.
14 years, 14 weeks ago
Post #138181 Re: Example of the GET function PHP

Well this is an example of the possibilities of it

P.s. get on msn dan

---
Andrewbob - I would be on the fucking copter of rofls

Programmer, Web Developer, and Graphics Designer
14 years, 14 weeks ago
Post #138182 Re: Example of the GET function PHP

This community IS corrupted. I mean, someone can't even post something that they enjoyed working on without getting -1'd. Fucking ridiculous.

Anyways, I found this pretty sweet. I tricked some of my not-so-smart friends into thinking I got some pretty beast achievements, haha.

---
People are only as stupid as god meant them to be.
14 years, 14 weeks ago
Post #138228 Re: Example of the GET function PHP
Helos posted: (21st Mar 2012, 01:58 am)

This community IS corrupted. I mean, someone can't even post something that they enjoyed working on without getting -1'd. Fucking ridiculous.

Anyways, I found this pretty sweet. I tricked some of my not-so-smart friends into thinking I got some pretty beast achievements, haha.


I completely agree.. The whole rating system is so abused.. But that's another story. Uhm just to update you all, I'm currently trying to generate an image from the source file with the writing so that the achievements can be embedded for even greater authenticity :D thanks for the support though man! :D
---
If money doesn't grow on trees, then why do banks have branches?
14 years, 13 weeks ago
Post #138229 Re: Example of the GET function PHP

Post the whole code so people can looky. I could think of a few ways to improve it.

I've been learning php recently (finally) and I came up with this while practicing:



<html>
<head>
<title>Simple math quiz</title>
<style type="text/css">
#body { background-color: rgb(50,50,50); text-align:center; color:#ffffff; font-family: Verdana, Geneva, sans-serif; }
#wrapper { width:302px; margin:10px auto; }
#header { font-size:x-large; color:#ffffff; margin-bottom:10px; }
#quizbox { padding:5px; border:1px solid #000000; border-radius:6px; -webkit-border-radius: 6px; -moz-border-radius: 6px; }
#footer { margin-top:50px; font-size:small; color:#ffffff; }
.value { color:#ffffff; background-color: rgb(50,50,50); text-align:center; border:1px dotted #fff; border-radius:6px; -webkit-border-radius: 6px; -moz-border-radius: 6px; width:50px; display:inline; float:left; margin-right:10px; }
.equa { color:#ffffff; width:50px; display:inline; float:left; margin-right:10px; text-align:center; border:none; background-color: rgb(50,50,50); }
.submit { color:#ffffff; background-color: rgb(50,50,50); text-align:center; border:1px dotted #fff; border-radius:6px; -webkit-border-radius: 6px; -moz-border-radius: 6px; width:150px; display:inline; margin-right:10px; }
.answer { color:#ffffff; background-color: rgb(50,50,50); text-align:center; border:1px dotted #fff; border-radius:6px; -webkit-border-radius: 6px; -moz-border-radius: 6px; width:50px; display:inline; float:left; }
.correct { color:#33dd33; }
.incorrect { color:red; }
a, a:visited { color:#33dd33; text-decoration:none; margin-bottom:10px; }
a:hover { border:1px dotted #ffffff; border-radius:6px; -webkit-border-radius: 6px; -moz-border-radius: 6px; padding:1px; }
</style>
<!--[if lte IE 8]>
<style type="text/css">
#wrapper { width:319px; height:500px; margin:10px auto; }
</style>
<![endif]-->
<script type="text/javascript">
function formfocus() {
document.getElementById('answer').focus();
}
window.onload = formfocus;
</script>
</head>
<body id="body">
<div id="wrapper">
<div id="header">Simple math quiz</div>
<div id="quizbox">
<?php
$value1 = rand (1,10);
$value2 = rand (1,20);
?>
<form action="mathsquiz.php" method="post">
<input type="text" name="value1a" value="<?php echo $value1; ?>" class="value" />
<input type="text" value="x" class="equa" />
<input type="text" name="value1b" value="<?php echo $value2; ?>" class="value" />
<input type="text" value="=" class="equa" />
<input id="answer" type="text" name="answer" value="" class="answer" /><br /><br />
<input type="submit" value="Submit answer" class="submit">
</form>
<?php
$result = $_POST['answer'];
$value1a = $_POST['value1a'];
$value1b = $_POST['value1b'];
if ($answer == '')
{
print('Type your answer in the empty box.');
}
else if ($result == $value1a * $value1b)
{
print($value1a . ' x ' . $value1b . ' = ' . '<span class="correct">' . $result . '</span>' . '<br />Correct!');
}
else
{
print($value1a . ' x ' . $value1b . ' = ' . '<span class="incorrect">' . $result . '</span>' . '<br />Wrong!<br /> The correct answer was: ' . '<span class="correct">' . $value1a * $value1b . '</span>');
}
?>
</div>
</div>
</body>
</html>
---
Web developer, currently looking for graphic artists / designers.
14 years, 13 weeks ago
Post #138527 Re: Example of the GET function PHP

Nice, good job. You need to add an empty field check though.

14 years, 13 weeks ago
Post #138800 Re: Example of the GET function PHP

UPDATE: Image Embedding now works :D 

This could be a lot of fun :P 

---
If money doesn't grow on trees, then why do banks have branches?
14 years, 13 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > Programming > Example of the GET function PHP