how do we display data on the front end like a chemical formula for sugar

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amitsaha
    New Member
    • Jul 2007
    • 2

    how do we display data on the front end like a chemical formula for sugar

    how do we display data on the front end like a chemical formula for sugar when entered via the admin panel. like a CMS
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    Originally posted by amitsaha
    how do we display data on the front end like a chemical formula for sugar when entered via the admin panel. like a CMS
    I'm sure your solution will involve a database. Perhaps you could better explain what you are looking for for an answer?

    Comment

    • amitsaha
      New Member
      • Jul 2007
      • 2

      #3
      Originally posted by Motoma
      I'm sure your solution will involve a database. Perhaps you could better explain what you are looking for for an answer?
      Dear Motoma,
      thanks for replying! What i need is that suppose like an Content Management System(admin section) i need to enter something into a text box which when saved goes and gets changed into the front end website. how do i enter something like a chemical formula of sugar in its original form and get it to display at the front end in the correct form. Eg. c6h12o6

      Comment

      • Motoma
        Recognized Expert Specialist
        • Jan 2007
        • 3236

        #4
        Originally posted by amitsaha
        Dear Motoma,
        thanks for replying! What i need is that suppose like an Content Management System(admin section) i need to enter something into a text box which when saved goes and gets changed into the front end website. how do i enter something like a chemical formula of sugar in its original form and get it to display at the front end in the correct form. Eg. c6h12o6
        I am assuming you would have a database back end containing the lookup values for your input related to the corresponding output.

        I'm afraid I don't fully understand what you are aiming for. Perhaps if you gave sample input and output, as well as how the system should be able to relate the two, I could give you better insight.

        Comment

        • tscott
          New Member
          • Jul 2007
          • 22

          #5
          Easy if you don't want to use MySQL...
          I'm assuming you have an admin panel/password verification.
          [php]
          <?php
          $password = 'randompass';
          $checkpass = $_POST['passsword'[;
          if(!$password == $checkpass)
          {
          echo 'Incorrect Password';
          exit;
          }
          function edit($data , $file)
          {
          //Creating Connection to file//
          $connection = fopen($file , 'w');
          //Making sure there is a connection//
          if(!$connection )
          {
          echo 'Please CHMOD your directory or create the file';
          }
          //Write Data to the file//
          fwrite($connect ion , $data);
          if(file_get_con tents($file) == $data)
          {
          echo 'Successfully updated your front end';
          }
          }
          $data = $_POST['data']; //Data from your form//
          $file = $_POST['file']; //File From your form(Can be anything//
          edit($data , $file);
          //Okay now include the file you just created where you want your data to be using//
          //Example : include('front. php');//
          ?>
          [/php]
          This is a relatively simple way to do it, You could use a database. Kind of a pain in the butt to do if you ask me. Be sure if you use this to set a pass at the variable above labeled password which is set to random. If you would like a form ask and I'll make one for you.
          ~Tyler

          Comment

          Working...