Jump to content

[SOLVED] Parse error: syntax error, unexpected T_ELSEIF What do I do??


electripunk

Recommended Posts

I am creating a generator. This consists of 4 pages and 4 codes.

 

I have a generator.php

            code.php

            generator-code.php

            preview.php

 

here is what we are looking at:

 

(((((top of page code)))))

 

<?

include('../../../config.php');

 

if ($_POST['gen'])

{

      include ($sm['path_base'] . 'my_dir/code.php');

 

include ($sm['path_inc'] . 'header.php');

?>

 

 

(((((bottom of page code)))))

 

<?

{

elseif ($_POST['view'])    <-------------------This is line 173 (where the error is)

{

include($sm['path_base'] . 'my_dir/preview.php');

}

?>

 

 

Here is the problem. I have tried several different things, but nothing seem to work. If I remove the include function from the top  'gen' function, it works but with an undefined function 'gen' line 12

 

With 'gen' defined as you see, I get a parse error, and a white page.

The parse error is:

 

Parse error: syntax error, unexpected T_ELSEIF mydirectory/generator-code.php

 

 

What am I doing wrong?

 

We need to see actual code. (In


tags please)

 

This is all the code in question. I have gotten the code to work, but still shows an error. The error is undefined index 'gen' in mydir/generator-code.php

 

[nobbc]

<?
include('../../../config.php');

if ($_POST['gen'])
{

include ($sm['path_inc'] . 'header.php');

?>
<div id="content">
<br />
<center>
<h1>
<?
$sm['page_name'] = $sm['page_title'];

echo
   $sm['page_name'];
?>
</h1>
<br />


<h2 align="center">MySpace Layout Generator</h2>
</center>
<br />

<br />

<center>
<h3>
Copy the following code into the, 'About me' section of your profile!
</h3>

<br />   
    <center><textarea name="textarea" cols=50 rows=10 class="bginput" onClick="this.focus();this.select()">
    <?php
     echo '<style type="text/css">
    body {background-color:'.$_POST['bgcolor'].'; background-image:url('.$_POST['bgimage'].'); background-position:'.$_POST['bgposition'].'; background-attachment:'.$_POST['bgmovement'].'; background-repeat:'.$_POST['bgtiled'].';}
    Table, Td { background-color:transparent; border-style:none; }
    table table td { width:100%; }
    table table table table td { width:auto; }
    table table table {background-color:'.$_POST['tablebg'].'; background-image:url('.$_POST['tableimage'].'); background-position:Top Center; background-repeat:no-repeat; border-color:'.$_POST['tablebordercolor'].'; border-style:'.$_POST['tableborderstyle'].'; border-width:'.$_POST['tableborder'].'; padding:4px;}
    table table table table{ background-image:none; background-color:transparent; border-style:none; }
    
    .orangetext15, .lightbluetext8, .whitetext12, .nametext, .btext, .redtext, .redbtext {color:'.$_POST['headingcolor'].'; font-size:'.$_POST['headingsize'].'; ';
    
    if ($_POST['headingstyle'] == "bold") {
    echo "font-weight:bold; ";
    }
    if ($_POST['headingstyle'] == "underline") {
    echo "text-decoration:underline; ";
    } 
    if ($_POST['headingstyle'] == "strike") {
    echo "text-decoration:line-through; ";
    }
    
    echo 'font-style:normal; font-family:'.$_POST['headingfont'].',arial,verdana,sans-serif;} body, div, p, strong, td, .text, .blacktext10, .blacktext12, a.searchlinkSmall, a.searchlinkSmall:link, a.searchlinkSmall:visited { color:'.$_POST['textcolor'].'; font-size:'.$_POST['textsize'].'; ';
    
    if ($_POST['textstyle'] == "bold") {
    echo "font-weight:bold; ";
    }
    if ($_POST['textstyle'] == "underline") {
    echo "text-decoration:underline; ";
    }
    if ($_POST['textstyle'] == "strike") {
    echo "text-decoration:line-through; ";
    }
    echo 'font-style:normal; font-family:'.$_POST['textfont'].',arial,verdana,sans-serif;}
    a, a:link, a:visited, a.navbar, a.navbar:link, a.navbar:visited, a.man, a.man:link, a.man:visited {color:'.$_POST['linkcolor'].'; font-size:'.$_POST['linksize'].'; ';
    
    if ($_POST['linkstyle'] == "bold") {
    echo "font-weight:bold; ";
    }
    if ($_POST['linkstyle'] == "underline") {
    echo "text-decoration:underline; ";
    }
    if ($_POST['linkstyle'] == "strike") {
    echo "text-decoration:line-through; ";
    }
    echo 'font-style:normal; font-family:'.$_POST['linkfont'].',arial,verdana,sans-serif;}
    a:hover, a:active, a.navbar:hover, a.navbar:active, a.man:hover, a.man:active, a.searchlinkSmall:hover, a.searchlinkSmall:active {color:'.$_POST['linkhcolor'].'; font-size:'.$_POST['linkhsize'].'; ';
    if ($_POST['linkhstyle'] == "bold") {
    echo "font-weight:bold; ";
    }
    if ($_POST['linkhstyle'] == "underline") {
    echo "text-decoration:underline; ";
    }
    if ($_POST['linkhstyle'] == "strike") {
    echo "text-decoration:line-through; ";
    } 
    echo 'font-style:normal; font-family:'.$_POST['linkfont'].',arial,verdana,sans-serif;}
    </style><br><br>This profile was edited with <a href="{url_base}" target="_blank">Rapid Codes Editor</a><br><br><a href="{url_base}" target="_blank"><img 
    src="{dir_support_images}support.png" alt="Myspace Layouts" style="position:fixed; left:0px; 
    top: 0px;" border="0"></a></div>';
    
    ?></textarea></center>

</center>
<br />

<?
include ($sm['path_inc'] . "footer.php");
?>
</div>

<?

}
elseif ($_POST['view'])
{
include($sm['path_base'] . 'myspace-images/profile/generators/preview.php');
} 
?>

[/nobcc]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.