very simple one line cms?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • 1

    very simple one line cms?

    hi all
    i need to have a page on a clients site that has a competition question that
    changes weekly.
    they need to be able to change the question through some kind of admin page
    (i was going to make a separate page that was password protected for this
    purpose).
    now i am thinking using MySQL etc will be like using a sledghammer to crack
    a nut open, and am wondering if there is some simpler way of implementing
    this using maybe basic PHP and an external text file or something? or maybe
    i dont even require PHP?
    any ideas appreciated.
    thanks


  • Perttu Pulkkinen

    #2
    Re: very simple one line cms?

    "1" <1@1.com> kirjoitti viestissä news:2n92i8Fu0k imU1@uni-berlin.de...[color=blue]
    > hi all
    > i need to have a page on a clients site that has a competition question[/color]
    that[color=blue]
    > changes weekly.[/color]

    If its okay, why not include a textfile inside pre-tags or you can also put
    string trough this kind of php-function

    function html_inclusion( $file)
    {
    - open that file into string
    - put string trough htmlspecialchar s (maybe do striptags first)
    - str_replace \n with <br>
    - echo that string
    }

    then they can use ftp to update that textfile


    Comment

    • Gregory Toomey

      #3
      Re: very simple one line cms?

      1 wrote:
      [color=blue]
      > hi all
      > i need to have a page on a clients site that has a competition question
      > that changes weekly.
      > they need to be able to change the question through some kind of admin
      > page (i was going to make a separate page that was password protected for
      > this purpose).
      > now i am thinking using MySQL etc will be like using a sledghammer to
      > crack a nut open, and am wondering if there is some simpler way of
      > implementing this using maybe basic PHP and an external text file or
      > something? or maybe i dont even require PHP?
      > any ideas appreciated.
      > thanks[/color]

      I use www.mamboserver.com for my personal site (see signature).
      Its a Content Management System based on PHP.

      Mambo allows for website content to have a start date & end date. So a new
      question would appear at the appropriate time


      gtoomey

      Comment

      • 1

        #4
        Re: very simple one line cms?

        yup i do too, but its way too much just for this system.
        i need a really simple form with one text field, when they hit submit it
        publishes to the page...
        thanks


        "Gregory Toomey" <nospam@bigpond .com> wrote in message
        news:2n94fkFt9t qsU1@uni-berlin.de...[color=blue]
        > 1 wrote:
        >[color=green]
        > > hi all
        > > i need to have a page on a clients site that has a competition question
        > > that changes weekly.
        > > they need to be able to change the question through some kind of admin
        > > page (i was going to make a separate page that was password protected[/color][/color]
        for[color=blue][color=green]
        > > this purpose).
        > > now i am thinking using MySQL etc will be like using a sledghammer to
        > > crack a nut open, and am wondering if there is some simpler way of
        > > implementing this using maybe basic PHP and an external text file or
        > > something? or maybe i dont even require PHP?
        > > any ideas appreciated.
        > > thanks[/color]
        >
        > I use www.mamboserver.com for my personal site (see signature).
        > Its a Content Management System based on PHP.
        >
        > Mambo allows for website content to have a start date & end date. So a[/color]
        new[color=blue]
        > question would appear at the appropriate time
        >
        >
        > gtoomey
        > www.gregorytoomey.com[/color]


        Comment

        • Steve

          #5
          Re: very simple one line cms?

          In news:2n95a1Fuf6 sgU1@uni-berlin.de,
          1 <1@1.com> said:[color=blue]
          > yup i do too, but its way too much just for this system.
          > i need a really simple form with one text field, when they hit submit
          > it publishes to the page...
          > thanks[/color]

          I would allow this form just to write to a text file, and the webpage can
          just pull the content from the text file using PHP or server-side includes
          or whatever you have at your disposal.


          --
          Steve


          Comment

          • 1

            #6
            Re: very simple one line cms?

            yup that would be exactly it.
            any pointers on how to accomplish this? i am a bit of a newbie as far as php
            is concerned.
            thanks

            "Steve" <steve@somewher e.invalid.com> wrote in message
            news:zxJPc.2105 8179$Of.3498241 @news.easynews. com...[color=blue]
            > In news:2n95a1Fuf6 sgU1@uni-berlin.de,
            > 1 <1@1.com> said:[color=green]
            > > yup i do too, but its way too much just for this system.
            > > i need a really simple form with one text field, when they hit submit
            > > it publishes to the page...
            > > thanks[/color]
            >
            > I would allow this form just to write to a text file, and the webpage can
            > just pull the content from the text file using PHP or server-side includes
            > or whatever you have at your disposal.
            >
            >
            > --
            > Steve
            >
            >[/color]


            Comment

            • Geoff Berrow

              #7
              Re: very simple one line cms?

              I noticed that Message-ID: <2n92i8Fu0kimU1 @uni-berlin.de> from 1
              contained the following:
              [color=blue]
              >hi all
              >i need to have a page on a clients site that has a competition question that
              >changes weekly.
              >they need to be able to change the question through some kind of admin page
              >(i was going to make a separate page that was password protected for this
              >purpose).
              >now i am thinking using MySQL etc will be like using a sledghammer to crack
              >a nut open,[/color]
              Maybe, but you could do other cool stuff like put in a load of
              questions and having them change each week automatically. I've used a
              database for a list of events and found it worth its weight in gold.
              Set it and forget it. Of course you can charge the client for weekly
              updates..:-)

              But if you just want to write to a text file, I posted a script a few
              days ago that allows you to do just that. You'll have to hack it a bit.



              To edit the file:


              Let me know if you want it.
              --
              Geoff Berrow (put thecat out to email)
              It's only Usenet, no one dies.
              My opinions, not the committee's, mine.
              Simple RFDs http://www.ckdog.co.uk/rfdmaker/

              Comment

              • Toby Inkster

                #8
                Re: very simple one line cms?

                1 wrote:
                [color=blue]
                > i need to have a page on a clients site that has a competition question that
                > changes weekly.[/color]

                Do you also need to collect the answers to the competition? Or are those
                collected by e-mail or something?

                --
                Toby A Inkster BSc (Hons) ARCS
                Contact Me ~ http://tobyinkster.co.uk/contact
                Now Playing ~ ./dido/life_for_rent/02_-_stoned.ogg

                Comment

                • BasherB

                  #9
                  Re: very simple one line cms?

                  This may help, may not:
                  Hope it does.

                  PAGE 1
                  *************** ADDS NEW QUESTION FORM AND WRITES THE TO QUESTION.TXT
                  PAGE *************** ******


                  <?php
                  $filename = "question.t xt";
                  $seperator = "/ENDOFLINE/";
                  if (isset ($_POST['Submit'])){
                  $new_question = sprintf ("%s$seperator\ r\n%s$seperator \r\n",
                  addslashes($_PO ST['question']), addslashes($_PO ST['answer']));
                  if (!$handle = fopen($filename , "r+")){
                  echo "cannot open file to edit question";
                  exit;
                  }
                  fwrite ($handle, $new_question);
                  fclose ($handle);
                  header ("Location:view question.php");
                  exit;
                  }
                  ?>

                  <form action="<?php echo $_SERVER['PHP_SELF']; ?>"
                  method="post">q uestion:<input name="question" type="text"><br >
                  answer:<input name="answer" type="text"><br >
                  <input name="Submit" type="submit" value="Submit">
                  </form>



                  PAGE 2
                  ********* WILL PLACE ALL OF THE QUESTIONS AND ANSWERS INTO AN ARRAY
                  ******
                  **** >SPLIT THEM UP INTO A QUESTIONS AND ANSWERS ARRAY IF YOU WISH<
                  ******

                  <?php
                  $filename = "question.t xt";
                  $seperator = "/ENDOFLINE/";

                  if (!$handle = fopen ($filename, "r")){
                  echo "cannot access question file";
                  exit;
                  }
                  $contents = fread ($handle, filesize ($filename));
                  fclose ($handle);

                  $all = explode ($seperator, $contents);
                  foreach ($all as $question){
                  echo stripslashes($q uestion).'<br>' ;
                  }
                  ?>

                  Comment

                  • 1

                    #10
                    Re: very simple one line cms?

                    yeah collect the answers too
                    undecided if this will be by email or not

                    "Toby Inkster" <usenet200408@t obyinkster.co.u k> wrote in message
                    news:pan.2004.0 8.03.18.10.40.2 74694@tobyinkst er.co.uk...[color=blue]
                    > 1 wrote:
                    >[color=green]
                    > > i need to have a page on a clients site that has a competition question[/color][/color]
                    that[color=blue][color=green]
                    > > changes weekly.[/color]
                    >
                    > Do you also need to collect the answers to the competition? Or are those
                    > collected by e-mail or something?
                    >
                    > --
                    > Toby A Inkster BSc (Hons) ARCS
                    > Contact Me ~ http://tobyinkster.co.uk/contact
                    > Now Playing ~ ./dido/life_for_rent/02_-_stoned.ogg
                    >[/color]


                    Comment

                    Working...