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

Did you know?Explore Trending and Topic pages for more stories like this.
$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

check if string contain only a-z/A-Z
Is where any way to check if string contains only a-z/A-Z, without writing an array with all possibl

Unable to customise toolbar in FCK
generating random codes
Hi guys n gals,

I have a requirement to generate 250,000 unique codes...

These codes a

Is it possible to view php source code??
Hi All

I was just wondering if it's possible to view a websites php source code?
I know

Help me with some material on Open Text Overview.
Hi Experts,
Please help me out with some material on Open Text. I have been supporting AP Workf

Email/MMS to Site
Hey guys. I'm looking for a way for a user to upload images and/or text via their cell phones. It

how to query data from website using VC?
I want to query some datum from a website,so I need a program to read data from a .csv file, and ass

FPDF Help
I've been playing with the FPDF module. I was building a form and rolling right along and then sudde

Contact Form Not Working When I Add Validation Codes
So I built my first working PHP "Contact Us" like form. But, I have been trying to now mak

Will this protect from mysql injection?
I do not want anything like DROP TABLE to work or any type of coding..

Heres my code.. is it

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