Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6201363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:32:24+00:00 2026-05-24T04:32:24+00:00

I’m an iPhone developer who’s new to web development. I’m experienced HTML and CSS,

  • 0

I’m an iPhone developer who’s new to web development. I’m experienced HTML and CSS, but I’m new to PHP, and installed MAMP on my mac.

I’m writing a website for someone who needs a basic CMS (I think that’s the right term!). Basic info that they will need to edit such as home page text, about section, etc. I have set up as php includes on txt files. Like this (on the home page):

<?php include 'homeText.txt' ?>

I’ve also setup an admin.php page where admins can login to edit the site’s content. (When I say login I mean if (username == x && password == x) with hardcoded values).

In this page I’d like to have a drop-down, allowing the user to select a text file to open, and when they choose one, it opens up in a rich text editor. (Any formatting would be HTML, which the rich editor would parse, to show formatted text).

Does anyone know of a suitable, open-source rich HTML editor that I could easily embed into a PHP page, and send the resulting HTML off on a PHP post to write to the file?

Thanks in advance – sorry for asking such a beginner question!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:32:26+00:00Added an answer on May 24, 2026 at 4:32 am

    you are doing it wrong way, i highly doubt that you can develop the application so sooner, as you said you only started learning PHP from yesterday, your examples shows that you are very poor in understating the basics of server side language, you said you would check the login with if (username == x && password == x) this is totally wrong way of doing it, instead you should use database like MySQL to store and check the login credentials i.e via $_SESSION (Session Variable), to be more precise,

    Consider a Login Form

    <form action="checkLogin.php" method="post">
        <input type = "text" name="username"/>
        <input type = "password" name = "password"/>
        <input type = "submit" name = "submit" value ="login"/>
    </form>
    

    It is always better to have database, consider the following database with the following tables and values.

    CREATE TABLE `users` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `name` varchar(50) NOT NULL,
      `password` varchar(50) NOT NULL,
      PRIMARY KEY (`id`),
    );
    INSERT INTO `users` VALUES('First User', '6c049bc0f30da673d0a82c5bd1a13cde');
    INSERT INTO `users` VALUES('Second User', '6a6150f8eb2c263a31eb91487bebf1d6');
    INSERT INTO `users` VALUES('Third User', '2fd7e7348da8dd5f67103b15be525859');
    

    the second argument is hashed values of your password, i have used md5(), you can use sha1() or others too.

    Now to check the login credentials you need to write the following code in your checkLogin.php

    <?php
    if(isset($_POST['submit'])) {
        $username = mysql_real_escape_string($_POST['username']);
        $password = sha1(mysql_real_escape_string($_POST['password']));
        $result = mysql_query('SELECT id, username FROM users WHERE users.username = '.$username.' AND users.username =.'$password) or die('unable to select database');
        if(mysql_num_rows($sesult) > 0) {
            $row = mysql_fetch_array($result);
            $_SESSION['userId'] = $row['userId'];
        }   
    }
    ?>
    

    in other pages if you want to check if the user is logged so that you can give him access, then you simply need to check Session Variables

    if(isset($_SESSION['userId'])) {
        //Give Page Access to this user.
    }
    

    This is just a basic and rough idea about how PHP works, to get you started i would recommend you check out this tutorial for Novice.
    http://devzone.zend.com/article/627

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a French site that I want to parse, but am running into
Does anyone know how can I replace this 2 symbol below from the string
I have just tried to save a simple *.rtf file with some websites and
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.