Syntax Help


Posted on 16th Feb 2014 07:03 pm by admin

I'm trying to make a form that edits a php file which contains config settings. I'm using strings that are defined by the user form inputs. This is what my file should look like when the form is process(or something like it)

Code: <?php

$config['site_url'] = "http://localhost/sideeffect";

$config['site_name'] = "asdfasdf";
$config['site_motto'] = "A community of gamers";
$config['img_dir'] = $config['site_url']."/images";
$config['style_dir'] = $config['site_url']."/css";
$config['js_dir'] = $config['site_url']."/javascript";
$config['enable_comments'] = FALSE;
$config['enable_points'] = TRUE;
$config['enable_ratings'] = FALSE;
$config['maintenance_mode'] = TRUE;

?>
This is the bit that produces what should be written to the file:
Code: $data = "<?phpnn

$config['site_name'] = "".$info['site_name']."";n [b]//Line that the error occurs on[/b]
$config['site_motto'] = "".$info["site_motto"]."";n
$config['img_dir'] = "".$info["img_dir"]."";n
$config['style_dir'] = "".$info["style_dir"]."";n
$config['js_dir'] = "".$info["js_dir"]."";n
$config['enable_comments'] = "".$comments."";n
$config['enable_points'] = "".$points."";n
$config['enable_ratings'] = "".$ratings."";n
$config['maintenance_mode'] = "".$maintenance."";nn

?>";
This is the error that I'm getting:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:xampphtdocssideeffectsystemapplicationmodelsadminsettings.php on line 4

Thanks for your help

No comments posted yet

Your Answer:

Login to answer
120 Like 12 Dislike
Previous forums Next forums
Other forums

Display error above the login forum help!
Hi guys. just so you know im not asking for someone to do this for me I just need to be pointed in t

Keeping track of php uploads
Hello all.

I was looking at the way PHP handles file uploads.
It seems that PHP uses a tem

Email logic not working
I would like to send an email using the php email() function then if it does execute i.e sends i wou

Reading Most Recent CSV File in Directory
I thought I had wrapped this project up, but found out that the program I use to FTP a csv file to m

(sub)screen resize modification doesn't work after ECC 6 EhP 4 installation
Hello,

We have previously extended the size of the custom data tab on PO transaction ME23

help with multi-update
Now sure how to ask this really....
10g database if that matters.

I have a customer

want to add a break after a certain amount of characters
i was wondering how to add a break in a blog post after a certain amount of characters... any idea o

get multiple rows
Hi I want to get multiple rows from a db

I am using this for the db query
Code: public

calendar dates and hours compare problem
i have a calendar in wordpress, everything works great except that i can make 2 meetings at the same

Storing/displaying image urls in a database?
Hi
Basically I have the following scenario:
User chooses picture from list. Picture info is ad

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash