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
Specific name typed, specific image shown on html page
Hello,Fairly new to PHP and was curious if someone might know how to solve a fairly simple request.I am currently passing the name of an end user (who types their name in a form field) to a URL which
Format timestamp from mysql
When I tried this:Code: date("m/d/Y H:i A", $row['timestamp'])I got 12/31/1969 18:33 PM, so I know the time section is working at least. How can I get the mm/dd/yyyy section to work
Is this possible? If one file assigned to an ID...
I have a page that lists property listings assigned to a specific user (a manage page), with brief text details and a picture.Each of these listings has several images with it, that aren't seen unless
Move array index to end
Hey guys, Quick question: I have an array that looks like this:Code: [Select]$var = array( 'name' => 'thename', 'title' => 'thetitle', 'media'
How would I protect......
I have a from, actually, a good amount of forms. How can I make it so you can't type the characters: '!~*&^%().;-_ in the form? Where it completely blocks those characters
Consuming third party Payment Gateway API from Procedure.
Hi All,
Looking for help reading a .txt or .ini file and outputting the info.
I have a file called Info.ini and It has the following info:Code: [General]Online=0I would like it to be in a php file as just 0 if possible. Also how would I do this from php file to php file and let
Working with popups and such in a class
I've recently started building my applications completely enclosed in classes. I like the fact that I can base everything off one root and work with that, but I'm having a problem with popups
dropdown menu
Hello everbody, I am php newbie. I need to develop a program that once click the drop down menu, the textarea will change the value base on the dropdown menu. I have problem changing the value of
Executing an exe
Hi. I have some bizarre problem with exec (other any other method) to launch exe's. I am making a game server booking system and the part that is not working is the one with the launching the server