Simple Machines Community Forum

General Community => Scripting Help => Aiheen aloitti: Blade14228 - syyskuu 29, 2007, 08:33:25 AP

Otsikko: Starting to code a CMS for my site
Kirjoitti: Blade14228 - syyskuu 29, 2007, 08:33:25 AP
I'm starting to code a CMS, and I am new to PHP. I am just trying this for fun, and I don't have any plans of putting it up live (unless it turns out really great). However, I am already stuck! I am coding the settings.php file right now, and am trying to put some basic text values in it. So far I have,


 
$text = array(
  t1 = "Welcome to ".$siteName."!",
  t2 = "Sorry, but you must be registered to login!",
  t3 = "Welcome back, ".$userName."!",
  t4 = "See you soon!",
  t5 = "Your last login was",
  t6 = "News",
  );

So, I built index.php with this code.

<?php
require_once('settings.php');
$siteName 'Test app';
echo 
$text[t1];
?>


However, I get the following error.

Parse error: syntax error, unexpected '=', expecting ')' in ###### on line 27


What is wrong with the array code?

Thanks for any and all help,
Keith
Otsikko: Re: Starting to code a CMS for my site
Kirjoitti: Duggis - syyskuu 29, 2007, 09:21:24 AP
remove your comma after the last element.
Otsikko: Re: Starting to code a CMS for my site
Kirjoitti: Blade14228 - syyskuu 29, 2007, 06:03:32 IP
Okay, it worked! Thanks!