Jump to content

Question


hilda

Recommended Posts

I have a small website and I need people to update text on the site. I created text files for them to just type what they need and upload it then a simple PHP include would publish this and everything would work great.

 

My issues is that some dont know how to use a editor or even an FTP program. So i am thinking of making an interface to log into and just query this file, edit it and then save it. I was wondering if anyone had any ideas. It seems very simple and as I have taken on more role and duties I am not sure how much time I will have to create this. Is there anything I can search for or something out there I can buy for cheap or use.

 

Thanks for the help.

DJ

Link to comment
Share on other sites

Thank you for the update but I would rather stay away from CMS. I would rather find a way to simple edit these 5 files. I have to make sure that these users keep working on that one file not the entire page. I look at our dev site and it's a mess.

 

I would rather some admin panel that they can login and edit or upload to this text file.

 

Any thoughts?

 

Thanks

Derek

Link to comment
Share on other sites

revraz is right, it would be easier to just allow then to do it through a form. If you don't want to build a full out login system, you could allow those users to "share" a password and hard code it in a text doc or something to that effect.

 

That is really not a good way to do it, but it would work depending on your security needs.

 

Nate

Link to comment
Share on other sites

revraz is right, it would be easier to just allow then to do it through a form. If you don't want to build a full out login system, you could allow those users to "share" a password and hard code it in a text doc or something to that effect.

 

That is really not a good way to do it, but it would work depending on your security needs.

 

Nate

 

i would use an .htaccess/.htpasswd file instead of hardcoding a password in

Link to comment
Share on other sites

Sounds like you should read a bit more into php tbh but anyways:

So a user enters some text into a form and their comment/article is stored in the global variable $_POST (or $_GET).

 

$string = $_POST['article'];

stripslashes($string);

 

Now your string won't have the unnecessary \s.

Link to comment
Share on other sites

the slashes are probably coming from an OLD feature of PHP called magic_quotes. basically addslashes() is automatically run on all form data (for outdated security reasons). using stripslashes() will undo what PHP is automatically doing, but since magic_quotes is depreciated and won't be in PHP6, you should look into disabling it all together:

http://us.php.net/manual/en/security.magicquotes.disabling.php

Link to comment
Share on other sites

I guess we al start somewhere. I have been reading online and trying to learn this myself.

 

I did try that but it did not work. I posted my snippet of code below

 

<?PHP

 

$filename = "nfl.txt";

$text = $_POST['nfl'];

stripslashes($text);

 

$fp = fopen ($filename, "w");

if ($fp) {

fwrite ($fp, $text);

fclose ($fp);

echo ("The Update has been Posted");

}

else {

echo ("The Update has not been  Posted");

}

 

?>

 

Again thank you for the help

 

Link to comment
Share on other sites

Which is exactly what I said above :)

 

the slashes are probably coming from an OLD feature of PHP called magic_quotes. basically addslashes() is automatically run on all form data (for outdated security reasons). using stripslashes() will undo what PHP is automatically doing, but since magic_quotes is depreciated and won't be in PHP6, you should look into disabling it all together:

http://us.php.net/manual/en/security.magicquotes.disabling.php

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.