![]() |
|
[PHP] PHP Page Creation - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183) +---- Thread: [PHP] PHP Page Creation (/showthread.php?tid=3810305) |
PHP Page Creation - BrainDeadGenius - Oct 17, 2013 I'm trying to make a mostly automated process. So, that means making a PHP page from a template. I've found out that it can create PHP pages using the function I have shown below, but with the template, it does not work. (The variables at the top are just substitutes for values that would be gathered from the site) PHP Code * - The Real Slim Shaddy - Oct 17, 2013 Better if you define what problem are you facing any errors thrown by function * - BrainDeadGenius - Oct 17, 2013 There are none with that. However, if I try to escape the variables ($info['somevalue']), then I get an error. The reason I'd want these as a comment is that these are variables that need to be in the file itself. The error is: Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /home/mystic/public_html/learn/test.php on line 28 (Updated the original post with that code) * - MicroCoil - Oct 17, 2013 That script is a whole fail. Just looking a the Syntax highlight explains how broken it is... * - Charger - Oct 17, 2013 $template = " $mysqli = my information What are you trying to do from that point on? * - BrainDeadGenius - Oct 17, 2013 (Oct 17, 2013 07:45 AM)Charger Wrote: $template = " $mysqli = my information Imagine you have a template for how a page looks. All I want to be able to do is create a new page (an actual .php page) when the script is run. It uses $name and $category to define where the script is on the server, and what the script's name is. The page that's created needs to have the variables and mysqli connection, but those are not to be affected by the creating of the new page. Because it's just a template. The reason there is the backslash ( \ ) before most of the quotes ( " ) is so it doesn't try to use variables that don't exist in the script that makes the page. They exist on the actual page that's made. (Oct 17, 2013 07:02 AM)AGNZ Wrote: That script is a whole fail. Why don't you do something, instead of just looking. The syntax highlighting that the post shows is incorrect of what the actual highlighting is in the editor. So hop the fuck out, or be helpful. |