1: When I run this code (some unnecessary code omitted) on a webserver, it runs fine. I have an EasyPHP setup, and when I run the exact same code on that, I get the error:
Parse error: syntax error, unexpected '<<' (T_SL) in C:\Program Files (x86)\EasyPHP-12.1\www\my portable files\part1.php on line 985
(Line 985 is commented as such below)
2: Whenever I run this code on the webserver, it says that I do not have access to $_SERVER[PHP_SELF]
, so I have to use "". While "" works, it doesn't validate correctly.
note: I cannot get the code blocks to format properly. The block(s) below should read as one continuous block.
function print_form() {
echo <<<END /*Line 985*/
<h1>Welcome to the player registration page. Please input the following:</h1>
<form action="$_SERVER[PHP_SELF]" method="post">
<div class="name">
Username: <input type="text" name="name" size="12" /> <br />
</div>
<div class="country">
Country: <select name="country">
<option value="">Select Country</option>
<option value="AF">Afghanistan</option>
...
<option value="ZW">Zimbabwe</option>
</select>
</div>
<div class="xfire">
Xfire: <input type="text" name="xfire" /> <br />
</div>
<div class="team">
Team: <input type="text" name="team" /> <br />
</div>
<div class="tag">
Tag: <input type="text" name="tag" /> <br />
</div>
<input type="hidden" name="stage" value="process">
Submit Info:
<input type="submit" value="Submit"/>
</form>
END;
try:
function print_form() {
?>
<h1>Welcome to the player registration page. Please input the following:</h1>
...
<? } ?>
I think this way is much easier...