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
How do I use a global footer..?
If my index.php has a bole bunch of if functions and exit's in them
help with mysql_error()
Hi,
I am trying to insert data into a table, but I am not able to insert it. I wanted to see
PHP & Java
Hello,
can PHP code be used inside java code?
Code: <SCRIPT LANGUAGE="Java
Blank record injected into database
I always found several blank records inside my database, although $SESSION is required to insert the
Working with Global Variables
hi, I'm not really sure why the following code is returning a "Call to a member function getBan
How to display objects in a row
I have 7 codes that i want to display in a row one next to another.
The first is {$ads->ad
Will an XHTML DOCTYPE interfere with my PHP if I'm not experienced enough?
I've read this article here: http://friendlybit.com/html/why-xhtml-is-a-bad-idea/
In a nutshe
CHECK A STRING FOR ' " ' (DOUBLE QUOTES)
I am checking for delimiter (.!?) and if there is a " after a sentence then it should neglect a
mail() says sent but no email received
My code is quite simple:
Code: <?php
$to = "Ty44ler@yahoo.com";
$subje
Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there