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
Confused with Loop
guys, i got confused with Looping...this is the case
I have 3 stocks, let say "Stock A&q
Sub-domains & calling unique content
Hello,
Is there a way use something similar to the $_GET function for a sub-domain? I to be a
Material Master Update through BAPI - Follow up material not updated
Hi Experts,
I am updating the material master through a custom transaction using the BAPI
Pass sql into pl/sql and create RMAN duplicate script.
Hi,
I'm new to pl/sql and I'm trying to write a script that will generate some RMAN comma
Displaying pictures
i have worked my way through storing images in directory and storing the location in mySQL db.Now i
Good Programming and Web Design Books
Hi,
I recived a pm today from a fellow phpfreaker regarding php books, i replied with the fo
Parse Error with doctype
I'm getting a parse error with this simple code. I don't get it. It worked one time then when I relo
Strange array issue, never happened before.
mysql_fetch_array returns 1 array per call. Generally that's why it is inserted into a while statem
RTF fomatting to email content
Im trying to sen an email with content is picked up from a rtf-file (file_get_contents('*.rtf'). Mai
php calculate
this code echoes correctly the sum but the inserted result is 0??
Code: <?php
$TotalNum