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
12
Other forums
Using cURL to PUT
Can somebody help with the correct php code to make a cURL PUT request. Here is a sample of code bel
disabling a button server-side then re-enabling client-side breaks button postback
I have a tabbed container and a button (not in the container) on a page. If the first tab is selecte
Any decent php formatter/beautifier/pretty printer?
Any decent php formatter/beautifier/pretty printer class/function?
I found the following whil
2 decima places & How to reload my page
Hello There,
How do i put full-stop (.) after second figure from behind? ie if i have 123456
Move array index to end
Hey guys,
Quick question:
I have an array that looks like this:
Code: [Select]$var =
sql error
I have been looking at this code for 20mins and can't work out what I am doing wrong. There is somet
newbie question
Hi out thereIm totaly new in this forum and to .net and vb so here is a totaly newbie question.I wan
Redistributing dependent dlls
Hai all ,
I have created an application in VC++ using VS2008 in a development machine which r
Create PHP table grid help, please
I have a MySQL database setup, now it's time for the table (gridview) design in php. Here's the prob
Check premium expire
Hi,
I am making a simple file hosting site and want to check if users premium subscriptions h