...

View Full Version : Printing Html



ricardovw
03-08-2003, 08:44 PM
im learnin php, and have two questions, im used with perl in script programmin however i would like to migrate to php...

i would like to know how to print large amounts of html without gettin all the print statements
the code i used to use in perl was

print <<HTML;

CODE CODE $CODE CODE
CODE CODE $CODE CODE
CODE CODE $CODE CODE
CODE CODE $CODE CODE

HTML

and it was done, my second question is that i can get data in to the script, get or post, in perl u need to parse input, but my php book which im readin, says that php does it automatically..

haha thanks !!!

ricardovw
03-08-2003, 08:47 PM
im runnin php through IISv5... :confused:

Evlich
03-08-2003, 09:27 PM
This is how you do Heredocument in PHP.
print <<<END
This uses the "here document" syntax to output
multiple lines with $variable interpolation. Note
that the here document terminator must appear on a
line with just a semicolon no extra whitespace!
END;
Variables are parsed in Heredocument notation, so inthe example above, the value of $variable would replace the string '$variable' if you don't want this to happen you need to escape the $ by saying \$variable.
It is true that variables are parsed automatically for you in PHP. You can use _GET['variablename'] to get stuff out of the query string. For instance, if your path was test.php?string=hello, the value of _GET['string'] would be "hello". The help files that you can download at php.net are really good, take a look at them.
~evlich

ricardovw
03-08-2003, 09:34 PM
thanks the print statement work out fine, however the parse input thingy is still wrong, maybe i need to check something in my php.ini file... thanks alot though

Spookster
03-08-2003, 11:33 PM
You can also find more information on this form previous posts:

http://codingforums.com/search.php?s=&action=showresults&searchid=90043&sortby=lastpost&sortorder=descending



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum