how do we display data on the front end like a chemical formula for sugar when entered via the admin panel. like a CMS
how do we display data on the front end like a chemical formula for sugar
Collapse
X
-
Originally posted by amitsahahow do we display data on the front end like a chemical formula for sugar when entered via the admin panel. like a CMS -
Originally posted by MotomaI'm sure your solution will involve a database. Perhaps you could better explain what you are looking for for an answer?
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. c6h12o6Comment
-
Originally posted by amitsahaDear 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'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
-
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.
~TylerComment
Comment