Avatar billede iceicepepsi Nybegynder
18. maj 2012 - 18:34 Der er 3 kommentarer og
1 løsning

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/a7182265/public_html/standard.php on line 83

Har prøvet at rode med det, men der kommer en fejl sidst i sætningen:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/a7182265/public_html/standard.php on line 83

Kode:

<?php
/**
* The standared.php is the standared user page
*
* PHP version 5
*
* @category  Application
* @package  UserProfile
* @author    Sakthivel Ganesan <sg@capjo.com>
* @author    Sasikumar Periyasamy <sasi@capjo.com>
* @copyright 2011 Team Capjo
* @license  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ code canyon license
* @version  SVN: <1.0>
* @link      http://www.capjo.com
*/

// Images are from Crystal clear icons
// Website: http://www.everaldo.com

$accessrights=array ('s');
include 'defender.php';

$notifymsg='';
$addedStyle='';

if (isset($_COOKIE['cannotsignupnow'])) {
    $addedStyle="background-color: #FFCCCC;    border: 1px solid #FF0000;";
    $notifymsg="You are logged in now. Please log out to sign up";
    setcookie('cannotsignupnow', '',  time()-3600);
}

echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
  \"http://www.w3.org/TR/html4/loose.dtd\">
<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">
<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">
<META HTTP-EQUIV=\"Expires\" CONTENT=\"-1\">
    <title>Welcome to ".CONFIG_CONSTANTS::$STANDARDROLENAME." user page</title>
<script type=\"text/javascript\">
function clearNotification()
{
    var notify=document.getElementById('headermiddlenotify');
    notify.style.backgroundColor=\"#a3a084\";
    notify.style.border=\"0px\";
    notify.innerHTML='';
}

function initialize()
{
    setTimeout('clearNotification()',5000);
}
window.onload=initialize;


    </style>
</head>
<body>
    <div id=\"header\">
          <div id=\"headercontent\">
                <div id=\"headermiddle\">
                    <div id=\"headermiddlenotify\">
                        $notifymsg
                    </div>
                    <div id=\"headermiddlelinks\">
                        <div id=\"headermiddlelinksleft\">
                        <a href=\"home.php\" style=\"color:#454545;\">
                            &nbsp;&nbsp;&nbsp;Home
                        </a>
                        </div>
                        <div id=\"headermiddlelinksright\">
                        <a href=\"signout.php\" style=\"color:#454545;\">
                            Sign out&nbsp;&nbsp;&nbsp;
                        </a>
                        </div>
                    </div>
                </div>
          </div>
    </div>

    <div id=\"main\">
        <div id=\"maincontent\">
            <div id=\"standard\">
                            </div>
                            <span  style="position: relative;float: right;
                                    left: -10px; top: 10px;">
                                <label style="font-size: 15px"></label>
                                <label style="font-weight: normal;font-size: 14px;color:#3d3d3d;">
                                    </label><br>
                                <label style="font-weight: normal; font-size: 9px;
                                        position: none; top: 1px; left: 20px;color:#6d6d6d;text-shadow:0px 1px #000;">
                                    Welcome <?php echo $username;?>!&nbsp;</label>
                            </span></div>
>
                                  </div>
                            </div>
                        </div>
                    </div>
    <div id=\"footer\">
        <div id=\"footercontent\">
            <span>You are viewing ".CONFIG_CONSTANTS::$STANDARDROLENAME." users page<br>
            This page can be viewed only by ".CONFIG_CONSTANTS::$STANDARDROLENAME." users</span>
        </div>
    </div>
</body>
</html>"

?>
Avatar billede arne_v Ekspert
18. maj 2012 - 19:31 #1
<span  style="position: relative;float: right;
                                    left: -10px; top: 10px;">
                                <label style="font-size: 15px"></label>
                                <label style="font-weight: normal;font-size: 14px;color:#3d3d3d;">
                                    </label><br>
                                <label style="font-weight: normal; font-size: 9px;
                                        position: none; top: 1px; left: 20px;color:#6d6d6d;text-shadow:0px 1px #000;">

mangler vist escape af "
Avatar billede vagnk Juniormester
18. maj 2012 - 19:38 #2
Fra linie 78 og ud mangler du en masse backslash \ foran dine quotes "
Avatar billede rix Praktikant
18. maj 2012 - 19:40 #3

<?php
/**
* The standared.php is the standared user page
*
* PHP version 5
*
* @category  Application
* @package  UserProfile
* @author    Sakthivel Ganesan <sg@capjo.com>
* @author    Sasikumar Periyasamy <sasi@capjo.com>
* @copyright 2011 Team Capjo
* @license  http://codecanyon.net/ (...) code canyon license
* @version  SVN: <1.0>
* @link      http://www.capjo.com
*/

// Images are from Crystal clear icons
// Website: http://www.everaldo.com

$accessrights=array ('s');
include 'defender.php';

$notifymsg='';
$addedStyle='';

if (isset($_COOKIE['cannotsignupnow'])) {
    $addedStyle="background-color: #FFCCCC;    border: 1px solid #FF0000;";
    $notifymsg="You are logged in now. Please log out to sign up";
    setcookie('cannotsignupnow', '',  time()-3600);
}

echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
  \"http://www.w3.org/ (...)
<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">
<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">
<META HTTP-EQUIV=\"Expires\" CONTENT=\"-1\">
    <title>Welcome to ".CONFIG_CONSTANTS::$STANDARDROLENAME." user page</title>
<script type=\"text/javascript\">
function clearNotification()
{
    var notify=document.getElementById('headermiddlenotify');
    notify.style.backgroundColor=\"#a3a084\";
    notify.style.border=\"0px\";
    notify.innerHTML='';
}

function initialize()
{
    setTimeout('clearNotification()',5000);
}
window.onload=initialize;


    </style>
</head>
<body>
    <div id=\"header\">
          <div id=\"headercontent\">
                <div id=\"headermiddle\">
                    <div id=\"headermiddlenotify\">
                        $notifymsg
                    </div>
                    <div id=\"headermiddlelinks\">
                        <div id=\"headermiddlelinksleft\">
                        <a href=\"home.php\" style=\"color:#454545;\">
                            &nbsp;&nbsp;&nbsp;Home
                        </a>
                        </div>
                        <div id=\"headermiddlelinksright\">
                        <a href=\"signout.php\" style=\"color:#454545;\">
                            Sign out&nbsp;&nbsp;&nbsp;
                        </a>
                        </div>
                    </div>
                </div>
          </div>
    </div>

    <div id=\"main\">
        <div id=\"maincontent\">
            <div id=\"standard\">
                            </div>
                            <span  style=\"position: relative;float: right;
                                    left: -10px; top: 10px;\">
                                <label style=\"font-size: 15px\"></label>
                                <label style=\"font-weight: normal;font-size: 14px;color:#3d3d3d;\">
                                    </label><br>
                                <label style=\"font-weight: normal; font-size: 9px;
                                        position: none; top: 1px; left: 20px;color:#6d6d6d;text-shadow:0px 1px #000;\">
                                    Welcome $username !&nbsp;</label>
                            </span></div>

                                  </div>
                            </div>
                        </div>
                    </div>
    <div id=\"footer\">
        <div id=\"footercontent\">
            <span>You are viewing ".CONFIG_CONSTANTS::$STANDARDROLENAME." users page<br>
            This page can be viewed only by ".CONFIG_CONSTANTS::$STANDARDROLENAME." users</span>
        </div>
    </div>
</body>
</html>";

?>


uhh ved ikke helt hvordan jeg skal forklare det.

men du echo html siden inde i ". du havde nogle html tag. som havde " i. dette kan php ikke finde ud af. for så tror php at den er er færdig der og det er den jo ikke. så jeg ændre dem til \" så ved php at den ikke er færdig der og \" skal vise " når den udskriver resultatet

hvorfor echo en hel html side med php??
Avatar billede iceicepepsi Nybegynder
18. maj 2012 - 19:50 #4
tak
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester