FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Php code messed up. What's wrong?





SpellcasterDX
This is my boardedit.php file:
Code:
<?
if ($boardvippost == "1"){
$bvippost = "True";
$vipselect = "SELECTED";
}else{
$bvippost = "False";
}
if ($boardprivate == "1"){
$bprivate = "VIP+";
$poselect = "SELECTED";
}elseif ($boardprivate == "2"){
$bprivate = "Insider";
$ptselect = "SELECTED";
}else{
$bprivate = "False";
}
if (!$boardprivateusers){ $bprivateusers = "None"; }

$boardform = "
<SPAN CLASS='InputSection'>Current Settings</SPAN><BR>
<TABLE>
<TR><TD CLASS='BoardColumn'>Board ID</TD>    <TD>".$boardid."</TD></TR>
<TR><TD CLASS='BoardColumn'>Name</TD>        <TD>".$boardname."</TD></TR>
<TR><TD CLASS='BoardColumn'>Description</TD> <TD>".$boarddescription."</TD></TR>
<TR><TD CLASS='BoardColumn'>Rank</TD>        <TD>".$boardrank."</TD></TR>
<TR><TD CLASS='BoardColumn'>Group</TD>       <TD>".inputDBCycle("", $boardgroupid, TABLE_GROUPS, "ID", "groupname", "show", "grouprank")."</TD></TR>
<TR><TD CLASS='BoardColumn'>VIP+ Only Post</TD> <TD>".$bvippost."</TD></TR>
<TR><TD CLASS='BoardColumn'>Private Board</TD> <TD>".$bprivate."</TD></TR>
<TR><TD CLASS='BoardColumn'>Invited Users</TD> <TD>".$bprivateusers."</TD></TR>
</TABLE>
<P>
<TABLE>
<TR><TD WIDTH='50%' CLASS='BoardRowHeading'>Description</TD>
<TD WIDTH='50%' CLASS='BoardRowHeading'>Permissions</TD></TR>
<TR><TD WIDTH='50%'>
<SPAN CLASS='InputSection'>Board Name</SPAN><BR>
".inputText("boardname", $boardname, 30)."<BR>
<SPAN CLASS='InputSection'>Board Description</SPAN><BR>
".inputText("boarddescription", $boarddescription, 30)."<BR>
<SPAN CLASS='InputSection'>Board Rank</SPAN><BR>
".inputText("boardrank", $boardrank, 3, 1)."<BR>
<SPAN CLASS='InputSection'>Group</SPAN><BR>
".inputDBCycle("boardgroupid", $boardgroupid, TABLE_GROUPS, "ID", "groupname", "edit", "grouprank")."
</TD>
<TD WIDTH='50%'>
<SPAN CLASS='InputSection'>Board Post Limits</SPAN><BR>
<SELECT NAME='boardvippost'>
<OPTION VALUE='0'>No Limits</OPTION>
<OPTION VALUE='1'  ".$vipselect.">VIP+ Only</OPTION>
</SELECT>
<BR>
<SPAN CLASS='InputSection'>Board Private</SPAN><BR>
<SELECT NAME='boardprivate'>
<OPTION VALUE='0'>No</OPTION>
<OPTION VALUE='2' ".$ptselect.">Insider</OPTION>
<OPTION VALUE='1' ".$poselect.">VIP+</OPTION>
</SELECT><BR>
<SPAN CLASS='InputSection'>User's With Access</SPAN><BR><SPAN CLASS='red'>
If &quot;Board Private&quot; is set to Insider or VIP+, you can give users not in those Access Classes access to the boards
by inputting their user ID in the box below.<BR>
ex. 1,5,18,32</SPAN><BR>
<INPUT TYPE='TEXT' NAME='boardprivateusers' VALUE='".$boardprivateusers."'><BR>
</TD></TR>
</TABLE>
<P>";
?>


That's the code. How do I do it so it'll work?

I get a Parse Error: Syntax error

Quote:
Parse error: syntax error, unexpected $end in /home/spellcas/domains/sdx.frih.net/public_html/boards/elements/boardedit.php on line 73
shamil
Have u post full length of boardedit.php file? Because error is on line 73 but code u have posted is 66 lines.
Ok Maybe u ommitted the blank lines.

It seems there is no any syntax error in the code. But i have no chance to check inputDBCycle and inputText functions. Check those function for syntax error. May be u forgot to close the opened bracket or ;
Maryndor
Isn`t it better this way:
Code:
$Text = <<<EOD
This is
some text with
a lot of new lines
EOD;

Instead of
Code:
$Text = "This is
some text with
a lot of new lines";

or at least
Code:
$Text = "This is".
"some text with".
"a lot of new lines";


???
X3 Talk
Oh dear. PHP can be very cryptic at times can't it? When one codes for such a long amount of time you start to think like PHP does. Obviously I don't have a testing server here, but I think you need to look around that line is causing you trouble and look for possible errors.
Stubru Freak
Please post the full source code here, so we can help you.
hexkid
SpellcasterDX wrote:
This is my boardedit.php file:
Code:
// ...


That's the code. How do I do it so it'll work?

I get a Parse Error: Syntax error

Quote:
Parse error: syntax error, unexpected $end in /home/spellcas/domains/sdx.frih.net/public_html/boards/elements/boardedit.php on line 73

There is no syntax error in the code you posted:

my system wrote:
~$ php -l spellcas.php
No syntax errors detected in spellcas.php

~$ head spellcas.php
<?
if ($boardvippost == "1"){
$bvippost = "True";
$vipselect = "SELECTED";
}else{
$bvippost = "False";
}
if ($boardprivate == "1"){
$bprivate = "VIP+";
$poselect = "SELECTED";

~$ tail spellcas.php
</SELECT><BR>
<SPAN CLASS='InputSection'>User's With Access</SPAN><BR><SPAN CLASS='red'>
If &quot;Board Private&quot; is set to Insider or VIP+, you can give users not in those Access Classes access to the boards
by inputting their user ID in the box below.<BR>
ex. 1,5,18,32</SPAN><BR>
<INPUT TYPE='TEXT' NAME='boardprivateusers' VALUE='".$boardprivateusers."'><BR>
</TD></TR>
</TABLE>
<P>";
?>

~$ wc spellcas.php
66 206 2535 spellcas.php
Related topics
PHP Validation Class
How To : Improve Your PHP Programming
Show PHP Code
PHP CODE INCLUSION
mySQL Query/PHP code - get the highest value...
my PHP code benchmark script that got some problems
PHP code snippit?
CSS for making images go through a php code.
Gradient Fill Cell
What is a good or bad php code?
I want PHP Code to ......
Help With Simple PHP Code Snipit
removing DirectAdmin part of URL makes php code work
Highlight PHP-code in a HTML-document
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.