gfx25
inherit
-4177576
0
Nov 29, 2024 17:49:46 GMT -8
gfx25
0
January 1970
GUEST
|
Post by gfx25 on Sept 11, 2010 10:02:50 GMT -8
How do you do them?
I tried something like
echo ("Hello");
<br /)
echo ("Hi");
Doesnt seem to work
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Sept 11, 2010 13:23:56 GMT -8
If you want a line break that the browser will parse which the user will be able to notice:
echo "<br />";
If you want a line break in your source so it's not in one huge long line.
echo "\n";
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Sept 12, 2010 7:50:05 GMT -8
As said, HTML goes within echo as well.
echo "Hello<br />Hi";
The only thing that goes outside of echo is PHP code itself. Generally, anything that gets outputted is within echo.
On a side note, line breaks in source code would be \r\n instead of just \n, although that's just nitpicking.
|
|
gfx25
inherit
-4178901
0
Nov 29, 2024 17:49:46 GMT -8
gfx25
0
January 1970
GUEST
|
Post by gfx25 on Sept 12, 2010 9:11:57 GMT -8
echo "<br />"; Seemed to work, so another question if I wanted to output text in bold, italic etc... would it be like echo "<i> ("Hello world")";.
Still a nub at php but thanks for the comments appreciate them =)
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Sept 12, 2010 14:37:48 GMT -8
echo "<b>Hello world.</b>";
It's exactly the same as HTML... excpet instead of <html here>, it's echo "<html here>";
There is no need for the extra parenthesis or quotation marks in the middle of the string.
|
|
gfx25
inherit
-4179724
0
Nov 29, 2024 17:49:46 GMT -8
gfx25
0
January 1970
GUEST
|
Post by gfx25 on Sept 12, 2010 18:29:54 GMT -8
Alright so if you wanna do HTML inside of php you just echo it out like anything else in php
|
|
inherit
77753
0
Jul 18, 2024 12:23:50 GMT -8
Bob
2,623
April 2006
bobbyhensley
|
Post by Bob on Sept 12, 2010 18:44:11 GMT -8
Alright so if you wanna do HTML inside of php you just echo it out like anything else in php PHP isn't a replacement for HTML. No server resource is. As far as PHP is concerned your HTML is no different than plain text. It's all just a string of incoherent characters. And yes, you either echo it out or you drop out of PHP entirely.
|
|
gfx25
inherit
-4179780
0
Nov 29, 2024 17:49:46 GMT -8
gfx25
0
January 1970
GUEST
|
Post by gfx25 on Sept 12, 2010 18:56:34 GMT -8
Yeah I need to look up more Toots on how to deal with html and php together right now im learning if else statement and its confusing me to no end
|
|
inherit
23506
0
Nov 19, 2012 5:30:35 GMT -8
James [a_leon]
I feel a strong desire to XSS a cookie from Peter.
4,334
April 2004
mnstrgarge
|
Post by James [a_leon] on Sept 13, 2010 9:55:33 GMT -8
Yeah I need to look up more Toots on how to deal with html and php together right now im learning if else statement and its confusing me to no end Draw a flowchart of what you want to happen. That's a good way to get used to if else statements.
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Sept 15, 2010 4:11:58 GMT -8
Yeah I need to look up more Toots on how to deal with html and php together right now im learning if else statement and its confusing me to no end I recommend you learn JavaScript before you attempt PHP. It will allow you to better understand programming languages (such as PHP) and - annoyingly but necessarily - teach you about DOM. Besides, there's not a such thing as a modern webpage without JavaScript.
|
|