Changing content of a website without using mysql [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
My client wants to update content in a website such aa "business opening hours" or other details of their business.
I was wondering whether there is a way to have them update the content without having sql entries for each of the fields and then providing a form for them to update.
Some of this info is hardcoded in a php page per language, as there is a routing script that will choose the corresponding page to pull info from depending on the chosen language.
Example of current info display:
$openingHours = "Our business opens from 9am to 3pm and then evenings from 6pm to 10pm";
$introText = "Welcome to ABCD, where we offer the greatest food in town";
The best would be to enable my client to update the php file but in a user friendly mode, not manual edit. Is there a way?

You can use config.php to make that and on it you can use like above:
<?php
$business = array();
$business['opening'] = 9;
$business['closing'] = 21;
?>
and you can include it and use on whereever u want. (Or u can make that config file via ini. But php is easier)

Related

How to access Windows Printer logs from PHP? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I would like to be able to view the Printer History in Windows using PHP.
The information I require includes:
Document name
Page count
Date printed
Is there any way to get this information in PHP?
In order to enable the print log on Windows 10:
You need to access the Event viewer. You can search for it in Windows search.
Once you have Event viewer open, expand Application and Services log>Microsoft>Windows>PrintService.
You will see two event types here; Admin, and Operational. If you’ve never enabled print logs before, right-click Operational and from the context menu select, Properties. On the General tab, enable the ‘Enable logging’ option, and you’re good to go.
Now, for viewing this file in PHP:
<?php
exec('wevtutil qe Microsoft-Windows-PrintService/Operational', $output);
var_dump($output);

How do I create and run the custom database? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
When I created my pet site and visiting it. I noticed money systems and pet systems all need database for them. But I'm wondering is there any way to create new rows for money system? I need money system for that to purchase virtual pets and itens.
So is there any codes when i click on a thing in the site that adds or removes from database date? Thank you a lot!
I thought that follows that code before I know DB:
<?php
$coin=50;
?>
There are no 'magic buttons' working out of the box - you can get that kind of button but you need to create DB structure, connection, write proper functions/methods (depends on your coding approach) and then bind it to that button.
Even if you are going to use some package/plugin or whatever you find useful - you need to have configured DB to be able to use that.
It is even hard to send you some links with examples/documentation as you did not give any kind of information regarding what (I guess) CMS or service you are using.
Deliver more info and then there is a chance that someone will be able to help.

Populating a part of the site with dynamic content [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am a newbie and have been programming this site for a school. And I have been stuck in a part where I have to show the logged in users the subjects he/she is currently enrolled in. I am thinking of making it appear using Ajax with a click of a menu button on the left side. So how do I populate this with a card for each subject he/she is taking? The subjects is stored in a MYSQL database. I am currently using Codeigniter Framework. Would you suggest using scripts like Angularjs? I am very new to this. Here is the sample site:
If you are very new to this, I suggest you first use regular GET/POST based interactions with the site so that clicking on a button will reload this page, or a new one with the relevant information.
Once you have moved from total newbie to a novice/rookie, you can start converting some of those areas to Ajax.
Once you become fully comfortable with that, only then should you think using JavaScript frameworks like angularjs or backbonejs.
Its an incremental skillset acquisition, and is always best done like that.
All the best!

how to show | hide links for certain time [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am writing one add on for my ptc website,using php and Mysql, with the following features:
1: user will click the link
2: user will copy the output url
3: paste it in the text field
4: if the pasted value matched with the existing value, it will credit the user account.
I have done above all:
what i want to ask is.
when a link is clicked , it should not appear to the same user for certain time , i.e. 1 hr or 4 hrs. or 24 etc etc
this is sort of manual surf for web sites.
Thanks for suggestions:
Making comment my answer, as OP seemed to like it:
You are going to have to keep a record (in the db) of when the user clicked the link. Then check against that when they come back. That's the most reliable way to track it...

Making separate pages for item, PHP [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a database of store names, and I want to make it possible that each store has its own personal page.
Would I have to make a separate page for each store or is there a way to have a single page that works as a template that when the user clicks on the store name the information just changes according to the store name.
If so could someone please set me in the right direction.
Thank you very much.
Yes, its possible to do this:
<?php
$store = 'abc'; // here make $store equal the store name out from the database
echo "Welcome to ".$store."'s store!";
?>
You could include further items, or even have images from the stores folder by using the $store variable as well. For example, to show the logo you could do the following:
<?php
echo "<img src=\"http://www.domain.com/".$store."/logo.jpg\">";
?>
At the end of the day, it depends how complex you want it. But as others will say, you'd better learn some of PHP's functionality and database features so you can get the result that you need.

Categories