Questions tagged as 'php'

2
answers

What is faster to read and edited, a database or a .txt?

It would be to store and rewrite only 1 INT digit, deleting one and typing another, on condition that when it reaches 5, go back pro 1, and go doing that loop every time someone accesses. Whenever someone accesses the page, the value would...
asked by 28.11.2016 / 04:38
6
answers

How do I use a database in an HTML site?

I am interested in making a website that will use database, many told me that if you use MySQL to do this, however I have no knowledge about it, installation, use etc. I have knowledge in PHP, HTML, CSS and JavaScript, I do not know if it interf...
asked by 04.02.2014 / 19:57
3
answers

Convert a date to the name of the day of the week

I am receiving multiple dates entered by the user from the database (the field is of type data (yyyy-mm-dd)). What I want, is to grab on that date and convert it to the name of the week day. For example: <?php $data_da_bd = "2014-08-13";...
asked by 20.08.2014 / 17:05
2
answers

What is the function of the "??" operator (two questions) in PHP?

Looking at a script PHP at some point I came across this line $valor = $_GET['id'] ?? 1; What is the interpretation of this code? What does it do?     
asked by 20.09.2017 / 15:51
2
answers

Can I write in JavaScript within PHP?

Can I write the HTML tag <script> in PHP and write the script </script> using echo here? If I do for example echo("<script> var a = 'texto';</script>"); This is my code but JS does not wo...
asked by 30.09.2015 / 13:27
2
answers

What does it mean in PHP?

I came across the following calculation being assigned to a variable (1103515245 * $num + 12345) % (1 << 31) What do these << mean?     
asked by 04.03.2015 / 19:09
4
answers

What technique do you use to keep fields in a form filled or selected after $ _POST []? [duplicate]

I'm developing a real estate system and would like to ask how can I keep data for a form such as inputs , selects and checkbox selected after giving $_POST on the form. I do not know how to store this data for all...
asked by 18.11.2015 / 18:06
2
answers

How do I get the position of a user individually in a rank, if in the database I only have your score?

With the code below I can display all users, because I put DESC and variable $num and it increments the placement with $num++; . But what if I want to get the / rank from the guy who is logged in ($_SESSION) and n...
asked by 30.04.2014 / 18:24
7
answers

Check user's browser in PHP

How do I check if the user is using the Internet Explorer browser, version 10 down, so that I can display a message to update it before entering my site?     
asked by 15.08.2014 / 17:48
2
answers

How to destroy a specific session?

It's as follows: I have an application / game that uses sessions to memorize the data that the users have chosen. Whenever the user restarts the game I need to clear the information, so I was perfectly using the session_destroy(); Un...
asked by 03.09.2014 / 20:28