TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 10-14-2011, 06:38 AM   #1 (permalink)
The Visitor
 
Join Date: Oct 2011
Posts: 2
Thanks: 0
hockey97 is on a distinguished road
Default Advance problem trying to generate files.

Hi, I am trying to generate programming files on the fly.

my user will use a gui to click buttons that for instance on their webapage they will be able to program the webpage how they like it via my gui.

my gui will create the php if statements etc and will create the file for the persons webspage.

here is the problem. I know how to create files and put data to them and us regular expressions to find lines of text inside the file.

the problem is that after I created this webpage file for the users webpage. Later on I want to be able to update the file and make changes to it. Like the user can use my gui to edit the file and update or make any changes to existing code. Not directly of course. I will have a gui interface where my php scripts should be the only ones touching raw code.

now, I know how to generate the if statements and variables and functions etc.

I just don't know how via script I can search for each line of code.

like I don't understand how I can go to a certain if statement and select not just the if and the condition but everything inbetween the { ]} brackets including the brackets themselves.

lets say I need to delete a whole if statement. How can I select this line of code? lets say the if(conditon){ is on line 5 and
the } is on line 20. how can I select all the lines from 5 to 20 and delete everything.

then again what if I don't want to delete the if statement but want to changes the conditions and the code that is applied when those conditions are met.


I been thinking and thinking and asked many many programmers this question and they told me it can't be done every time you make the programming file you have to remake it from scratch you can't just go in a program file and search for certain code and just edit that code.

I was thinking what if I put comments on the start and end of the code. The have comments at the start and end of each program code inside the if statement. that way I can select inbetween those comments to either delete that code and if I need to make changes could put the new code there and might make changes to the comments left.

would that work?

If you don't understand what I am asking then here is a software version:

http://www.hkvstore.com/phpmaker/


it's a software application for your desktop. the program is a GUI they allows you by clicking buttons and selecting stuff from a drop down menu. It will generate the right php,html,css code for you.

you can edit the files later on. The user dosen't touch any code by hand at all.

I don't understand how they store this information into a file first and later if you need to make changes they would make the changes directly to the files.

I want to do the same thing but implement this on a webpage using just php.

how can this be done?

Last edited by hockey97 : 10-14-2011 at 07:10 AM.
hockey97 is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
small Css problem - Thank you in advance.. codefreek XHTML, HTML, CSS 5 08-19-2009 06:05 PM
Problem uploading MP3 files via FTP ebuoe Advanced PHP Programming 4 06-04-2009 02:22 PM
Huge Session Problem Killswitch General 1 11-17-2008 02:36 AM
Ftp file mode problem - spaces in files benton General 6 11-05-2008 11:20 PM
Retrieving Files from a Backup in Vista CMellor The Lounge 2 06-24-2008 02:34 PM


All times are GMT. The time now is 12:00 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design