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
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
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
Old 11-07-2011, 10:54 PM   #2 (permalink)
HersheysBlog.com
 
Hershey's Avatar
 
Join Date: Nov 2011
Posts: 15
Thanks: 0
Hershey is on a distinguished road
Default

So, first off help me understand what you mean.

Are you trying to build an application that allowed a person(s) to edit their profile? Or something like that?

If so, lets you should do something like MyBB and other popular applications do. They have a Language file that holds the content of most things. If this is what you need help with, I can most definitely help you! If not, please further explain.
Send a message via MSN to Hershey Send a message via Skype™ to Hershey
Hershey is offline  
Reply With Quote
Old 11-09-2011, 03:15 AM   #3 (permalink)
The Visitor
 
Join Date: Oct 2011
Posts: 2
Thanks: 0
hockey97 is on a distinguished road
Default

I don't know what you mean.

what I am talking about is this:

for example lets make facebook.com the example.

well lets say that facebook.com allows you to edit your profile the way it looks.

like you can drag things and move divs, images, input boxes around on the page.

you can delete these elements too or add new ones to the profile page.

what I want is to make a GUI interface not a application but maybe a web app.

that the GUI interface would allow the user to drag and drop elements and delete them and add new ones but also allows the person to program their page without touching any code.

so that means conditions would be those if statements or switch statements.

but I want my scripts to generate that code and save it on a file that is stored on my server for each user.

then later on if they make changes or modified the elements or deleted a few elements then their changes should be saved in that file.


The problem is that I don't know how you can open a file and scan

for certain places inside the code to delete or overwrite on those certain areas.
hockey97 is offline  
Reply With Quote
Old 11-09-2011, 07:03 AM   #4 (permalink)
HersheysBlog.com
 
Hershey's Avatar
 
Join Date: Nov 2011
Posts: 15
Thanks: 0
Hershey is on a distinguished road
Default

Well, what it sounds like you want to do it pretty much build a framework. lol

Which is very advance. If you PM me or send me an email at hershey@hersheysblog.com we can make a project and actually finish this. I wouldn't call it exactly a framework, but it's a web application.

If we create something like this, we could sell it or just put it under the GPL and make it open source.
Send a message via MSN to Hershey Send a message via Skype™ to Hershey
Hershey is offline  
Reply With Quote
Reply



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 01:14 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