I was wondering if ASP.NET is more efficent than PHP with sockets. Ive frozen a server several times doing relatively few connections on PHP. I was wondering if any server side programming engines are capable of hosting a reliable and efficient socket server.
...
Why is it that when I pass parameters through encoded URL and GET method in HTML form, the URL encoded parameters are dropped?
e.g. Setup:
<form action="process.php?hello=world" method="GET">
<input type="text" name="foo" value="bar">
<input type="submit">
</form>
Result: the variable hello will not be recognized in process.php.
Is ...
Hi,
I encountered some problems with the shell function in php. I want to execute a java program on the server by running a php function on a php webpage.
The java program writes some chars to a local file on the server.
test.php
<?php
$WshShell = new COM("WScript.Shell");
$cmd = ' "C:\\Program Files\\Java\\jdk1.6.0_14\\bin\\...
How can I display Arabic characters in web page using php and sql server? The Arabic data is stored in the database (sql server). Now I want to use php to display that data on the web page. How can I do this?
...
Hi,
I know there are two main unit-testing frameworks in PHP :
PHPUnit
SimpleTest
I am using PHPUnit, and was searching for PHP (Open source would be great ; but I'm also interested in non-OSS ones, if they are big / well-know / from big companies) projects, be it applications, libraries, frameworks, ... that would use PHPUnit as U...
Hi all,
I currently have a MySQL SELECT statement that pulls information from two tables to display a "Sent Messages" field for private messaging.
I'd like to know how I can do add a COUNT to my query to count the number of "receivers" in one thread.
Here's the basic gist of my table structure, (NOTE: the relational tie between the ...
Is there a good way to identify a cell phone or any other mobile device (which may be subject to a limited data plan) through the user agent or similar, easily accessible methods?
...
I am trying to send email using PHP mail. I get the following error:
Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
Fatal error: Unknown: Failed opening required '/home/webtest/help/ask_us.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0
The PHP code is as follows:
<?php
$...
I am using a function to spit out my main and sub menu's for me. Basically I feed it a page ID and it gives me the menu with the menu item properly highlighted through CSS.
What I'm asking is: How do I improve this code (and others like it that I have laying around)? Lowering the amount of lines of code and decreasing repetition of cod...
I'm using Ubuntu on the server and I'm using Putty to access. I want to create cronjobs for my php site. How can I do this?
...
In my Main application I used label (like id=firstname) so we can use in main used firstname.text for databinding. But I have created canves custom component and load in main application using viewstack.
In canves custom component how can I Bind label(id=firstname).
I tried:
var username:string = firstname.text but not show undefine f...
Hi,
I want to update my site every 5/10 minutes using cron. I'm connecting to my server (Ubuntu) using PuTTY. I edited the crontab file but it doesn't seem to work... What should I do?
...
Hi all, I am really new to online web application. I am using php, I got this code:
if(isset($_GET['return']) && !empty($_GET['return'])){
return = $_GET['return'];
header("Location: ./index.php?" . $return);
} else {
header("Location: ./index.php");
}
the $return variable is URL variable which can be easily changed by hacker.
E...
Everyone here should know the 'or' statemens, usually glued to an die() command:
$foo = bar() or die('Error: bar function return false.');
The most of the times we see something like:
mysql_query('SELECT ...') or die('Error in during the query');
However, i cant understand how exactly that 'or' statement works.
I would like to thr...
i've tried searching everywhere but there's seems to be no implementation available other than having the client use a file (batch/exe of some sort).
...
Well, i need to do some calculations in PHP script. And i have one expression that behaves wrong.
echo 10^(-.01);
Outputs 10
echo 1 / (10^(.01));
Outputs 0
echo bcpow('10', '-0.01') . '<br/>';
Outputs 1
echo bcdiv('1', bcpow('10', '0.01'));
Outputs 1.000....
I'm using bcscale(100) for BCMath calculations.
Excel and Wolfram ...
I have a login system requiring a username and a password. I want to display a captcha after a certain amount of failed login attempts. What is the proper way to implement this? I've read around on this site and some solutions suggest having a 'failed-attempts-count' added to the users table. However, I need the failed attempts to no...
Hello,
I've a problem with setting cookies in php. I've to say that I'm not very experienced with php, so maybe is a very stupid problem.
I've an ajax rating system that should check a cookie to see if the the photo has already been voted.
The page called with ajax check for the cookie, add the id of the photo you are voting to it and...
Hi,
This was working fine yesterday with no changes to the code.
echo date("M", strtotime("-3 month", time()) );
echo date("M", strtotime("-2 month", time()) );
echo date("M", strtotime("-1 month", time()) );
echo date("M", time());
The output it was producing yesterday was as you would expect- i.e. Apr, May, Jun, Jul
Today it echoe...
What is the cost of parsing a large XML file using PHP on every page request?
I would like to implement custom tags in HTML.
<?xml version="1.0"?>
<html>
<head>
<title>The Title</title>
</head>
<body>
<textbox name="txtUsername" />
</body>
</html>
After I load this XML file in PHP, I search for the cus...