| View previous topic :: View next topic |
| Author |
Message |
Maes Advanced Cheater
Reputation: 10
Joined: 09 Apr 2009 Posts: 50
|
Posted: Tue Dec 13, 2011 9:48 pm Post subject: PHP help |
|
|
<html>
<body>
<?php
$communism=("failure");
if ($communism=="fail"); echo "Hey!";
else {
echo "Error!";
?>
</body>
</html>
What's wrong with this? Else seems to be unexpected.
_________________
Account reclaimed by former owner? |
|
| Back to top |
|
 |
..... Expert Cheater
Reputation: 59
Joined: 23 Oct 2010 Posts: 119
|
Posted: Tue Dec 13, 2011 9:49 pm Post subject: Re: PHP help |
|
|
| Athostle/Rokurai wrote: | <html>
<body>
<?php
$communism=("failure");
if ($communism=="fail"); echo "Hey!";
else {
echo "Error!"
?>
</body>
</html>
What's wrong with this? Else seems to be unexpected. |
are you not required a closing }?
|
|
| Back to top |
|
 |
Cryoma Member of the Year
Reputation: 198
Joined: 14 Jan 2009 Posts: 1819
|
Posted: Tue Dec 13, 2011 9:49 pm Post subject: |
|
|
| failure and fail
|
|
| Back to top |
|
 |
Maes Advanced Cheater
Reputation: 10
Joined: 09 Apr 2009 Posts: 50
|
Posted: Tue Dec 13, 2011 9:51 pm Post subject: |
|
|
| Cryoma wrote: | | failure and fail |
Yeah, that's there on pupose. I'm trying to get it to say Error if it can't get the value. (Don't spoonfood if you're gonna help, guys, I need to be taught.)
Parse error: syntax error, unexpected T_ELSE in /private/var/www/index.php on line 7
_________________
Account reclaimed by former owner? |
|
| Back to top |
|
 |
Cryoma Member of the Year
Reputation: 198
Joined: 14 Jan 2009 Posts: 1819
|
Posted: Tue Dec 13, 2011 9:55 pm Post subject: |
|
|
<?php
$communism=("failure");
if ($communism=="fail")
echo "Hey!";
else
echo "Error!";
?>
|
|
| Back to top |
|
 |
Maes Advanced Cheater
Reputation: 10
Joined: 09 Apr 2009 Posts: 50
|
Posted: Tue Dec 13, 2011 10:01 pm Post subject: |
|
|
| Cryoma wrote: | <?php
$communism=("failure");
if ($communism=="fail")
echo "Hey!";
else
echo "Error!";
?> |
Two mistakes by me? Not bad. Thanks.
_________________
Account reclaimed by former owner? |
|
| Back to top |
|
 |
InternetIsSeriousBusiness Grandmaster Cheater Supreme
Reputation: 8
Joined: 12 Jul 2010 Posts: 1268
|
Posted: Tue Dec 13, 2011 10:05 pm Post subject: |
|
|
Atleast Adam is actually trying to learn something.
_________________
FLAME FLAME FLAME!!!@@@ |
|
| Back to top |
|
 |
Maes Advanced Cheater
Reputation: 10
Joined: 09 Apr 2009 Posts: 50
|
|
| Back to top |
|
 |
..... Expert Cheater
Reputation: 59
Joined: 23 Oct 2010 Posts: 119
|
Posted: Wed Dec 14, 2011 9:07 am Post subject: |
|
|
| Athostle/Rokurai wrote: | My first PHP script!
|
Very nice! I'm in the process of learning JavaScript now that I realized HTML is basically a cheat sheet language.
|
|
| Back to top |
|
 |
Maes Advanced Cheater
Reputation: 10
Joined: 09 Apr 2009 Posts: 50
|
Posted: Wed Dec 14, 2011 9:42 am Post subject: |
|
|
| Effect wrote: | | Athostle/Rokurai wrote: | My first PHP script!
|
Very nice! I'm in the process of learning JavaScript now that I realized HTML is basically a cheat sheet language. |
PHP is tough but fun, I suggest you try to learn that. I just did a quick read 30 minute read of the HTML tutorials, just to remember the basics. If you really want to make a flashy website, try AS3 like Cryoma said, you can embed the SWF (Shockwave Flash) file in HTML.
Also, updated the website.
| Description: |
|
| Filesize: |
8.96 KB |
| Viewed: |
3146 Time(s) |

|
_________________
Account reclaimed by former owner? |
|
| Back to top |
|
 |
shitposter Newbie cheater
Reputation: 5
Joined: 12 Nov 2008 Posts: 13
|
Posted: Wed Dec 14, 2011 11:43 am Post subject: |
|
|
| php is not 'tough'
|
|
| Back to top |
|
 |
Aniblaze Grandmaster Cheater Supreme
Reputation: 138
Joined: 23 Apr 2006 Posts: 1757 Location: The Netherlands
|
Posted: Wed Dec 14, 2011 11:58 am Post subject: |
|
|
PHP is a 'handy' programming language, as it allows you to do a lot. This unfortunately also includes mistakes. Prime example is:
| Code: | <?php
$i = true;
if($i) {
$variable = "OMG I'M GOING TO ECHO NOW!";
}
echo $variable;
?> |
Real programmers will know why this will fail in every other programming language, but only throws a warning in PHP, or nothing if you have error reporting set to nothing.
EDIT: Also, if I ever notice any of you post PHP code with the '@' in it, I will come to your house, and beat you to death with a stick.
|
|
| Back to top |
|
 |
Maes Advanced Cheater
Reputation: 10
Joined: 09 Apr 2009 Posts: 50
|
Posted: Wed Dec 14, 2011 12:33 pm Post subject: |
|
|
| xTremist wrote: | | php is not 'tough' |
When learning, it can be. I had pointed that message at him because he'd be learning.
@Augustine:
| Code: | <html>
<body>
<?php
$somevar="@ @ @ @ @ @ @ @ @ @ @ @ @ @ @";
echo ("$somevar");
?>
<br />
<img src="http://www.nationstates.net/images/flags/uploads/trollface_x__861729.png" border="0" />
</body>
</html> |
_________________
Account reclaimed by former owner? |
|
| Back to top |
|
 |
Aniblaze Grandmaster Cheater Supreme
Reputation: 138
Joined: 23 Apr 2006 Posts: 1757 Location: The Netherlands
|
Posted: Wed Dec 14, 2011 12:36 pm Post subject: |
|
|
| Athostle/Rokurai wrote: | | xTremist wrote: | | php is not 'tough' |
When learning, it can be. I had pointed that message at him because he'd be learning.
@Augustine:
| Code: | <html>
<body>
<?php
$somevar="@ @ @ @ @ @ @ @ @ @ @ @ @ @ @";
echo ("$somevar");
?>
<br />
<img src="http://www.nationstates.net/images/flags/uploads/trollface_x__861729.png" border="0" />
</body>
</html> |
|
Echo doesn't require (), so if you were implying that was the error I mentioned, then no. Also, you are echo'ing a variable, so why put quotes around it? Correct method of displaying it would be:
|
|
| Back to top |
|
 |
Maes Advanced Cheater
Reputation: 10
Joined: 09 Apr 2009 Posts: 50
|
Posted: Wed Dec 14, 2011 12:39 pm Post subject: |
|
|
| Augustine wrote: | | Athostle/Rokurai wrote: | | xTremist wrote: | | php is not 'tough' |
When learning, it can be. I had pointed that message at him because he'd be learning.
@Augustine:
| Code: | <html>
<body>
<?php
$somevar="@ @ @ @ @ @ @ @ @ @ @ @ @ @ @";
echo ("$somevar");
?>
<br />
<img src="http://www.nationstates.net/images/flags/uploads/trollface_x__861729.png" border="0" />
</body>
</html> |
|
Echo doesn't require (), so if you were implying that was the error I mentioned, then no. Also, you are echo'ing a variable, so why put quotes around it? Correct method of displaying it would be:
|
| Code: | <html>
<body>
<?php
$somevar="@ @ @ @ @ @ @ @ @ @ @ @ @ @ @";
echo "$somevar";
?>
<br />
<img src="http://www.nationstates.net/images/flags/uploads/trollface_x__861729.png" border="0" />
</body>
</html> |
I'm getting a bit mixed up, sorry about that.
Also, my point was: | Quote: |
EDIT: Also, if I ever notice any of you post PHP code with the '@' in it, I will come to your house, and beat you to death with a stick. | http://storageserver.x10.mx/Stg/
I was trying to be clever. ;_;
_________________
Account reclaimed by former owner? |
|
| Back to top |
|
 |
|