Call function in php without client-side library [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 3 years ago.
Improve this question
Is it possible to call a function without javascript/Jquery/Ajax in one PHP file.
<?php
$connect = mysqli_connect("localhost","root","","");
Permit
function permit_access() {
$permit = mysqli_query($connect,"UPDATE permittable SET confirm = 1 WHERE id = keyid");
return $permit;
}
?>

This is not possible.
I would recommend you read about "server side scripts" and "client side scripts".
They live on different planets. :)

Related

Passing data to function. What is the better way? [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 5 years ago.
Improve this question
Way 1:
public $foo = 1;
function(){
return $this->foo+1;
}
Way 2:
// with $foo = 1 in other function
function($foo){
return $foo+1;
}
Sorry for a 'dumb' question, someone can tell me what is the better way?
Second way is better and it is more canonical than first one. For more information please read this doc http://php.net/manual/en/functions.arguments.php

How to detect dns server and ip-adresses in 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 7 years ago.
Improve this question
I want to program a DNS-leaktester in PHP. Is it possible? or do I have to use other languages like python etc. to get the information.
You can do it as well in PHP like in other languages. As for PHP try with:
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$dnsRecords = checkdnsrr($hostname);

Is it possible to do form validation from a separate php script? [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 9 years ago.
Improve this question
What I'm trying is a php form validation from a separate file.(form.php & validate.php).
Is it possible?
Yes, you just have to include the scripts and you have access to functions inside of them. You really couldn't google this one?
include("validate.php"); //inside form.php

Can I declare a global function from namespaced code? [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 want to avoid creating another file just to escape the namespace.
Found the solution. For others interested see below.
namespace { function myFunction() { ... } }

PHP ajax chat without database at backend [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
Does anyone know where messages accesses without using database on php-ajax chat?
example can be found on
www.phpfreechat.net/
In files:
By default, you don't need a Mysql
database. The chat uses files to store
messages and nicknames.
Source: http://www.phpfreechat.net/required-config

Categories