Full Disclosure: There's a similar question here.
Is there any way I can test if a particular port is open and forwarded properly using PHP? Specifically, how do I go about using a socket to connect to a given user with a given port?
An Example of this is in the 'Custom Port Test' section of WhatsMyIP.org/ports.
...
I'm creating an MySQL call using PHP, I'm calculating distance using the haversine forumula:
SELECT name, id,
(6371 * acos(cos(radians(' . $lat . '))
* cos(radians(geoname.latitude))
* cos(radians(geoname.longitude) - radians(' . $lon . '))
+ sin(radians(' . $lat . '))
* sin(radians(geoname.latitude)))) AS distance
...
I have an issue where users on my web site have recently begun to receive the error message:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
I know that the connection strings in the code are correct, as users are able to query the database view pages that retrieve info from and submit user-generated...
Example: http://www.whois.net/whois/hotmail.com
When open in browser, output is shown.
When using curl call, it show nothing.
What's wrong? I want to return whole page result, then use regular expression to retrieve data at Expiration Date: 29-Mar-2015 00:00:00 line.
$postfields= null;
$postfields["noneed"] = "";
$queryurl= "http://...
how do i add values from arrays to an array so that it grows by time.
eg.
all values form array1 to myArray.
all values form array2 to myArray.
so now myArray contains all values from 1 and 2.
i want to do this in a cpu efficient way
...
<?php
mail("[email protected]", "My Subject", "Line 1\nLine 2\nLine 3");
?>
We don't need to specify the email/password/mail server address && port,but it can be sent .
...
I have a form to singup yourself in a mailing list.
I had set up the script to send me a mail for every singup and confirmation.
The last days I saw a bunch of empty submisions (rejected). Turns out filter_input is that good :-)
But I want to see the input of the malicious users, so I'm encoding the input and sending it to me by mail
...
I'm trying to load or better reload a DIV with content from an included php file. so the file is included in the webadmin.php from the location webadmin/pages.php. Then i alter some data in the DB through serializing.
Now I would like to reload the pages.php from the callback of the serialize POST with load();. This all works fine up u...
Is there a way to insert into MySQL database using PHP PDO and return its id? Or I will just have to search fot its id after insertion?
...
First of all, I am using PhpMyAdmin, is this okay or not?
Because when I have cache disabled, and do two queries after eachother, the second query always is faster, so I am thinking maybe there is an internal cache on PhpMyAdmin?
Secondly, is there any way to get the time of how long a query takes, into php, and echo it onto the browser...
I have been trying for a while now trying to figure out how to programmatically click a link using PHP and/or javascript. I have it setup so if the user clicks a link it will refresh a table. You don't really need to know why I want to do this b/c then it will go down a whole long road of confusion. Just know that there is a link to be c...
I am setting up cache in MySQL.
Could someone please explain query_cache_min_res_unit?
What does it do etc?
I have read the manual and it doesn't explain so good.
Details are appreciated... Or examples...
Thanks
...
This is the regex to validate email address in javascript,I'm not sure if I can just use it directly in PHP:
/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\...
Hello,
Having problems with this.
Let's say I have a parameter composed of a single character and I only want to accept alphabetic characters. How will I determine that the parameter passed is a member of the latin alphabet (a–z)?
By the way Im using PHP Kohana 3.
Thanks.
...
I am running nginx with PHP-FPM. My nginx configuration for handling php files looks like this:
location ~ \.php$ {
set $php_root /home/me/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $php_root$fastcgi_script_name;
include /etc/...
Hi all,
I am writing a web program using mvc php framework. I have index and another view which I want to render the view inside of my index. First I call view then I call index and put view into it. My problem is I want to save the whole view into a variable and do something like echo $view in my index. both require_once and include_onc...
Im working on a table that has 4 columns and the first one is an auto incrementing integer called id.
If im going to insert into this table using mysqli prepared statements I keep having trouble inserting a query that works. Using PHPmyAdmin It tells me to give it NULL. Ive tried this:
$query = "INSERT INTO tbl (id, col2, col3, col4) V...
Hey,
i'm having some troubles with UTF-8 encoding on a website. Calling my script using PHP5 all the umlauts (ä, ü, ö,...) look like this: ökflödsköl
Calling the script using PHP4 shows everything as expected...
both php.ini look the same an so my question would be:
is there an other file where i can change the output encoding?
T...
Howdy,
I'm trying to come=up with a regex string to use with the PHP preg functions (preg_match, etc.) and am stumped on this:
How do you match this string?:
{area-1}some text and maybe a <a href="http://google.com">link</a>.{/area-1}
I want to replace it with a different string using preg_replace.
So far I've been able to...
I've just discovered a setting on the server I'm developing a site for that is different from my localhost settings, however, I can't track down where to change it.
Here's a simple example of what's happening.
$_SESSION['Animal'] = "Dog";
echo "#1: ".$_SESSION['Animal']."<br/>";
echo "#2: ".$Animal;
On my localhost, the server return...