2DWorlds Forums
PHP Help - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: Off Topic (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=5)
+--- Forum: Programming (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=30)
+--- Thread: PHP Help (/showthread.php?tid=6857)

Pages: 1 2


PHP Help - Chaos - 07-14-2011

Code name: blog.php

[lua]

<?php
<html>
include("header.php");
echo "<link href="style.css" rel="stylesheet" type="text/css">";
echo "<center><p>------------------------------------------------------------------------------------</p></center><p><center>";
echo "<p>Posted July 7th, 2011:</p>";
echo "<p>Hello my name is Matt, but just call me chaos. If you have in fact stumbled across</p>";
echo "<p>this site then you have no real reason to be on here. Maybe you just want to check out</p>";
echo "<p>my progress since this is simply a practice site getting me ready for the real world!</p>";
include("footer.php");
</html>
?>
[/lua]

ERROR:
Parse error: syntax error, unexpected '<' in /home/a1555635/public_html/blog.php on line 2


RE: PHP Help - Jacob__mybb_import1 - 07-14-2011

(07-14-2011, 02:25 AM)Chaos Wrote: Code name: blog.php

[lua]

<?php
<html>
include("header.php");
echo "<link href="style.css" rel="stylesheet" type="text/css">";
echo "<center><p>------------------------------------------------------------------------------------</p></center><p><center>";
echo "<p>Posted July 7th, 2011:</p>";
echo "<p>Hello my name is Matt, but just call me chaos. If you have in fact stumbled across</p>";
echo "<p>this site then you have no real reason to be on here. Maybe you just want to check out</p>";
echo "<p>my progress since this is simply a practice site getting me ready for the real world!</p>";
include("footer.php");
</html>
?>
[/lua]

ERROR:
Parse error: syntax error, unexpected '<' in /home/a1555635/public_html/blog.php on line 2
You have the <html> tags inside the PHP tags without echo statements, I'm guessing that's just an accident though.

And if you use double quotes in a string surrounded by double quotes, or single quotes in a string with single quotes, you have to put backslashes before them.

Also, did you know you can mix HTML and PHP in one file? It's a lot easier that way:
[lua]
<html>
<?php
include("header.php");
?>
<link href="style.css" rel="stylesheet" type="text/css">
<center><p>------------------------------------------------------------------------------------</p></center><p><center>
<p>Posted July 7th, 2011:</p>";
<p>Hello my name is Matt, but just call me chaos. If you have in fact stumbled across</p>
<p>this site then you have no real reason to be on here. Maybe you just want to check out</p>
<p>my progress since this is simply a practice site getting me ready for the real world!</p>
<?php
include("footer.php");
?>
</html>
[/lua]


RE: PHP Help - Glome - 07-14-2011

(07-14-2011, 02:52 AM)Jacob_ Wrote:
(07-14-2011, 02:25 AM)Chaos Wrote: Code name: blog.php

[lua]

<?php
<html>
include("header.php");
echo "<link href="style.css" rel="stylesheet" type="text/css">";
echo "<center><p>------------------------------------------------------------------------------------</p></center><p><center>";
echo "<p>Posted July 7th, 2011:</p>";
echo "<p>Hello my name is Matt, but just call me chaos. If you have in fact stumbled across</p>";
echo "<p>this site then you have no real reason to be on here. Maybe you just want to check out</p>";
echo "<p>my progress since this is simply a practice site getting me ready for the real world!</p>";
include("footer.php");
</html>
?>
[/lua]

ERROR:
Parse error: syntax error, unexpected '<' in /home/a1555635/public_html/blog.php on line 2
You have the <html> tags inside the PHP tags without echo statements, I'm guessing that's just an accident though.

And if you use double quotes in a string surrounded by double quotes, or single quotes in a string with single quotes, you have to put backslashes before them.

Also, did you know you can mix HTML and PHP in one file? It's a lot easier that way:
[lua]
<html>
<?php
include("header.php");
?>
<link href="style.css" rel="stylesheet" type="text/css">
<center><p>------------------------------------------------------------------------------------</p></center><p><center>
<p>Posted July 7th, 2011:</p>";
<p>Hello my name is Matt, but just call me chaos. If you have in fact stumbled across</p>
<p>this site then you have no real reason to be on here. Maybe you just want to check out</p>
<p>my progress since this is simply a practice site getting me ready for the real world!</p>
<?php
include("footer.php");
?>
</html>
[/lua]

That's what I told him lol



RE: PHP Help - Chaos - 07-14-2011

I hope this works.


RE: PHP Help - Ashely - 07-14-2011

I thought you were an advance coder?
I'm kind of on that level, I study something new everyday on w3schools.


RE: PHP Help - Chaos - 07-15-2011

I am pretty advanced. I just got stuck in that little jut. If you want, I can show you some of my projects. I made a working calculator, forum, and other things.

It's really the website things that get me stuck with the CSS and HTML. I'm pretty good at making little gadgets for sites.


RE: PHP Help - Ashely - 07-15-2011

Sure, I'd like to see.


RE: PHP Help - Chaos - 07-15-2011

I just posted one in this section.


RE: PHP Help - noob007 - 07-16-2011

(07-15-2011, 08:10 PM)Chaos Wrote: I am pretty advanced. I just got stuck in that little jut. If you want, I can show you some of my projects. I made a working calculator, forum, and other things.

No offense but, many people wouldn't call that stuff very advanced... it's still cool, but just be careful when you call yourself an experienced programmer...


RE: PHP Help - Ashely - 07-16-2011

(07-16-2011, 06:34 AM)noob007 Wrote:
(07-15-2011, 08:10 PM)Chaos Wrote: I am pretty advanced. I just got stuck in that little jut. If you want, I can show you some of my projects. I made a working calculator, forum, and other things.

No offense but, many people wouldn't call that stuff very advanced... it's still cool, but just be careful when you call yourself an experienced programmer...

What would you consider advanced?