473,394 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Let users create a html/php page

13
Hey everybody

I'm very new to the php and mysql stuff, but know the basic of it..

My qusetion:

Is it possible to let people make their own pages (like html/php) on my site?

With that I mean users who are registered and have posted their text (with form) to an mysql table..

I want the layout to be simple as possible and I hope it can be stored under a special folder on the server..

So do anybody know how I can create this code, or can someone give me some advise?

Thankful for any advises..

Skuer
Feb 11 '08 #1
5 1759
ronverdonk
4,258 Expert 4TB
Of course you can do that. But there are some questions to be answered and some precautions you have to take.

1. I would not allow my users to use server-side execution code, like PHP.
2. Nor would I allow them Javascript or any nother code in the html pages.

Assuming that you do not want a bulletin board but just html only pages, some thoughts:
1. Do you want to allow users to use make-up of the page, like BB tags, smileys, images etc?
2. Have you thought about filtering all page content for bad words, advertisements, links?
3. Have you planned to filter all content in order to prevent malicious code attacks?

Ronald
Feb 11 '08 #2
skuer
13
Of course you can do that. But there are some questions to be answered and some precautions you have to take.

1. I would not allow my users to use server-side execution code, like PHP.
2. Nor would I allow them Javascript or any nother code in the html pages.

Assuming that you do not want a bulletin board but just html only pages, some thoughts:
1. Do you want to allow users to use make-up of the page, like BB tags, smileys, images etc?
2. Have you thought about filtering all page content for bad words, advertisements, links?
3. Have you planned to filter all content in order to prevent malicious code attacks?

Ronald
Well I have thought about the questions you asked me

I want the page to be as simple as possible, that means plain text and perhaps 1 picture..

And when you mention the two last quetion I havent thought much about it..

My site is more like a hobby site, but I will give it a thought..

If you could help me with a simple code from the mysql table (or from the text box), to the "make html page"...I would really be thankful for that
(sorry for the writing mistakes)

Skuer
Feb 12 '08 #3
ronverdonk
4,258 Expert 4TB
Start coding and we'll help you along here. The following checklist could help you to make up the ultimate html text:
  • Remove all embedded (possible) code
  • Filter all 'dirty' and not-allowed words out
  • Replace bb-code tags by HTML tags (incl. imgage placement)
  • Replace free-format URLs with <a href...> elements
  • Replace \n and \n\r line breaks with <br />

Ronald
Feb 13 '08 #4
skuer
13
Start coding and we'll help you along here. The following checklist could help you to make up the ultimate html text:
  • Remove all embedded (possible) code
  • Filter all 'dirty' and not-allowed words out
  • Replace bb-code tags by HTML tags (incl. imgage placement)
  • Replace free-format URLs with <a href...> elements
  • Replace \n and \n\r line breaks with <br />

Ronald
Thanks, trying my best to come up with the right code..

I acctually found a code, but it's in asp.net:(..

Trying too look at it, figure how I can write the code in php..

[HTML]<%@ Import Namespace="System.IO" %>

<script language="C#" runat="server">
void ProcessButton(Object sender, EventArgs e) {
string f = Server.MapPath(theFile.Text);
StreamWriter sw = File.CreateText(f);
sw.Write(theContents.Text);
sw.Close();
theMessage.Text = "Created file: <a href=\"" + theFile.Text + "\">" + theFile.Text + "</a>";
}
</script>

<html>
<body>

<h2>Create an HTML File</h2>

<form runat="server">
HTML Text:<br>
<asp:TextBox id="theContents" runat="server"
TextMode="MultiLine"
Columns=50
Rows=10
/>

<br>
<br>

File Name: <asp:TextBox id="theFile" runat="server"/>
<asp:Button id="theButton" runat="server"
OnClick="ProcessButton"
Text="Create File"
/>

<br>
<br>

<asp:Label id="theMessage" runat="server"/>

</form>

</body>
</html>[/HTML]
Feb 14 '08 #5
ronverdonk
4,258 Expert 4TB
You cannot use that. It simply reads a textbox and makes it a file. Why not start some code yourself and we'll help when you get along.

Ronald
Feb 15 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: scmiles | last post by:
I am trying to write an asp or aspx page that will create a virtual ftp directory to the users Active Directory home directory. That way a user can interact (drag/drop, copy/paste) via IE with...
16
by: Jonas Smithson | last post by:
I'm going to say something now that may seem to completely contradict a previous post of mine, in which I basically said that taking a "who cares" attitude about certain browsers (because of their...
10
by: Don Munroe | last post by:
This one has me stumped. I have three web applications running on two different servers. The first that works fine is hosted by a .Net hosting company. Everyone that uses it has no problems...
2
by: pv | last post by:
Hi everyone, I need help with following scenario, please: Users are accessing same web server from intranet (users previously authenticated in Active Dir) and from extranet (common public...
2
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
8
by: barb | last post by:
So that the world at large benefits from our efforts, here is one fully documented way to use Windows Irfanview freeware to create thumbnail web galleries (http://www.irfanview.com). STEP 1:...
3
by: Neil Steventon | last post by:
Hi, Im after some advise on how to go about this problem. I have a master page with nice header and side bar setup. I then have various aspx pages that use this master page. I want one of the...
2
by: j.m.osterman | last post by:
I haven't found exactly what I've been trying to do. All I am trying to do for now is just display usernames from Active Directory into a ListBox control on a page. I have found some code...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.