virtual pages using PHP only? [closed] - php

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 working on a project that I need to let users to create pages on my server. however, I do not want to let users clutter my mysql database by storing the stuff in there so I cannot use mysql database for creating the pages.
I did research this topic and there seem to be a some sort of a plugin for WP that will allow virtual page creation.
is this possible using pure php WITHOUT the use of any database ?

It's possible, but wrong.
You can use php to write a html file to your web directory, sure. But that
solution is in no way cleaner or less cluttered than putting stuff in your
database, for a few reasons:
It's easier to have structured information in the database
It's a good thing conceptually to separate user data from your program
It's easier to control access to your database in a safe way, compared
to writing user data to the file system
"I really do not want to use mysql database" is not a good reason to give this
up. You might have a good reason, but it's not easy to guess what that is, which
makes suggesting alternatives very difficult.

Related

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.

How to make HTML interact with a 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 8 years ago.
Improve this question
Hello everyone, I have a project and I want to create an MVP: Minimum Viable Product.
And I have html pages ready but I don't know how to make them interact with databases, preferably MySQL.
I need the simplest way to be able to POST and GET data from a database, PHP or Rails.
IF there's just one simple tutorial or a small ebook to read, I'll be so thankful.
I have to the end of the month to create the MVP, about 20 days or so, and I really want to make that happen and I was gonna learn the whole Rails just to do that, but it'll take time you know!
Thanks for your time and I hope that you might help me :)
You can't make HTML directly interacting with database. You should create server-side application, which answer queries generated by HTML forms, JS queries, etc. I am PHP developer, I like this language, so I recommend you using it in your solution.
You can read about connecting PHP to MySQL database here:
http://www.w3schools.com/php/php_mysql_connect.asp
There you have basic information about handling data sent by POST:
http://www.w3schools.com/php/php_forms.asp
If you have any troubles during develop proccess try Google before, then if didn't find answer ask specific and well described question on Stack Overflow.
Best luck!

Login system: sql vs secondairy php file [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 don't really like using sql databases. I want to make a login system. Is there any security problem with having a passwords.php file with the passwords in it rather than having them in a database? I figure since php is server side, nobody should be able to access php code in passwords.php but what do I know?
Nope, no problem at all. In fact this is how .htpasswd stores its passwords.
But it makes adding, removing or editing them much, much harder than it needs to be.
Databases are quick, simple, and easy to use. You should probably use one.
So to sum up, if you have a small, unchanging set of users (for instance, you're making something for yourself and your friends only), then a file-based password storage is probably okay (assuming proper encryption and stuff). Otherwise, use a DB.

Multilingual website, translations stored in a local.php file or in the database? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have a simple question! I want to create my website with multilingual content, but i have a doubt about which is the right way to do this.
Option 1: Create a .php file called for example lang.en.php (where there is an array of all the strings I use on the page) and include it in the header.php file, so that to add a new language i only have to create new files like lang.es.php
Option 2: Store the strings in a database table and take them with a query.
Now my question is this: when i will upload the website on a real server, which one is the faster method? which one slows down less?
There is also an option 3 use mo/po files which are specialized for the task and also kinda nicely handle singulars / plurals for you.
However being sanely able to edit those files you would need to provide a GUI. But that should also be the case when you are using the array in a php file approach.
It's pretty hard to tell which way is the way ™ so I think I might close your question as too subjective.
When you are going for the database approach I would personally have a way to export the texts to either a po file or a array in a php file to prevent having to query the database for those mostly static texts.
To answer you question po files might be faster, however with opcache it might be pretty close to eachother. If you really want to know it the best thing you can do is do some tests with either approach because I just simply pulled the speed of po vs static array in a file out of my arse :-)
P.S. when you are benchmarking both methods also please keep in mind that whichever method you are going to choose performance is most likely not going to be the bottleneck so choosing one or another for performance is probably a bullshit reason.

retrieving datatbase information on a web page [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 9 years ago.
Improve this question
This will be a total novices question, but I am looking for advice.
My apologies, In the post as I failed to mention that the database that I am working on is MySQL.
I know absolutely nothing in regards to any technologies that retrieve or get information from a database. The only 3 facts that I know is that it can be done by either PHP or HTML5, I should be able to pick it up and that I will make many mistakes
Could the community suggest which would be the better technology to learn and would any be able to suggest a starting point?
Yours in advance
Keith
In order to retrieve database information, you generally only need a database such as MySQL - and a client to perform your queries (fetching data from the database).
Your client could be anything, a commandline tool or a PHP script opening a connection to your database and performing the desired queries.
Fetching data alone will not get you very far unless you can display that information somewhere, or even provide access to it or (if desired) allow users to interact with it.
Basically, if you want to retrieve database information and show it on a website, your minimum requirements would be HTML, a database server, a database (preferably with some data to run some tests with) and some kind of scripting language (such as PHP).
There are numerous tutorials out there on how to make your first steps with this.
Here is one.
Start with PHP + MySQL. There are a lot of manuals and examples over the Internet. Google it.

Categories