hi, I am looking for a way to get a response in a form of a javascript alert after a form has been submitted using a php script. I guess ajax should do this but Im not an Ajax guy yet. A simple sample code would help a lot. Thanks for reading
...
Is a class destructor in PHP predictable? When is the destructor called?
Like in many languages, will a class destructor be called as soon as the object goes out of scope?
...
What's the most efficient way to quickly check for telephone number format from a form input text?
...
I was wondering if there is a good tutorial or tutorials on how to build good RSS 2.0 and ATOM feeds?
...
Hi guys..
I am trying to figure out the difference between $a=&$b and $a=$b.
I know & make the variable to be a reference variable. But the following test gave me the same result. Can anyone explain the difference? Thanks.
$a=5;
$b=6;
$a=&$b;
echo $a; //6
$a=5;
$b=6;
$a=$b;
echo $a; //6
...
I'm looking for a tutorial which explains why and how to write useful unit tests. Specifically I'm interested in PHPUnit, however any more general might be a good one to explain that. Please note that I'm not looking for technical information on how to use PHPunit - rather the tutorial on the way of thinking!
...
is have 2 class
first
<?php
require_once( 'error/DisconnectedHandler.php' );
require_once( 'error/NoSuchRequestHandler.php' );
class NetworkManager {
public static final $RESPONSE_JUMP = 1000;
....
second
<?php
require_once( '../NetworkManager.php' );
class DisconnectedHandler implements Handler{
pu...
I'm currently using XAMPP for PHP development on my Mac. I just got handed a project that needs to use the Berkeley DB with db4 support, but I just can't seem to get it working. Can you even setup DB4 with XAMPP?
I successfully installed Berkeley DB and made the db4.so file and have set it the extension=db4.so line in the php.ini file, ...
Hello, is it possible to upload files to web page and then access file data on website using $_FILES['file'] in php?
...
How can I run PHP on JVM (akin to Jython and JRuby)? I am aware of the following:
Quercus, which appears to be dead alive and well.
Seems like I've been visiting the wrong website.
webSphere sMash, that appears to have no documentation
Is there a more mature project for this?
...
I am developing a PHP/MySQL e-commerce site with some social aspects, and am looking to integrate it with Facebook. I already have a native user registration/session handling system. I have managed to include the iframe "Social Plugins" such as a "Like" button. But I really would like to offer users the option of registering with the sit...
Hi guys.
I am trying to check a date format to see if I can check the data variable has certain format like MM-DD-YYYY. if not, then exit(). I am not sure how to check the format and would appreciate if any one can help me about it. Thanks...
$date=05/25/2010;
if(XXXXX){
// do something....
}
...
I made a while loop in php:
<?php
include_once("connect.php");
$search=mysql_query("SELECT * from chat ORDER BY id DESC LIMIT 1");
$row=mysql_fetch_assoc($search);
$type=$row['type'];
$id=$row['id'];
while($type!='n'){
usleep(10000);
$search=mysql_query("SELECT * from chat ORDER BY id DESC LIMIT 1");
$row=mysql_fetch_assoc($searc...
A couple of years ago, before I knew about Stack Overflow, I was working in an office with a lot of competition between the programmers. There, I had to code a web page in PHP with Drupal, that needed to get data from another site by RSS. What happened was that there was no way to get the data beforehand: the data depended on the content...
OK let's say I want to take this piece of text:
text ex 1.
6, 6, 6, 6, 6, 6, 6, 6, 95, 95, 95, 51,
6, 60, 60, 60, 60, 60, 60, 6, 95, 95, 95, 51,
6, 60, 35, 35, 35, 35, 60, 6, 6, 6, 95, 95,
6, 60, 35, 35, 35, 35, 60, 60, 6, 6, 6, 6,
6, 60, 35, 35, 35, 35, 35, 60...
Overview
Around the end of 2009, I wrote a simple templating system for PHP/HTML to be used in-house by our designers for brochure-ware type websites. The goal of the system is to allow templating in otherwise pure HTML via custom tags that are processed by PHP. For example, a templated page might look like this:
<tt:Page template="tem...
I have a "Coming soon" page but i want to add an "insert your e-mail" option and the e-mail to be inserted on a csv or txt file. What i have is an ajax validate e-mail address and the input field:
function isValidEmailAddress(emailAddress) {
var pattern = new RegExp(/^(("[w-s]+")|([w-]+(?:.[w-]+)*)|("[w-s]+")([w-]+(?:.[w-]+)*))(@((?:[w-...
I'm interested in the best/standard way to find the execution time of my Zend Framework app. Currently I'm starting the timer on the public/index.php then registering it in Zend_Registry, for a later call, which the layout then uses to calculate the total time.
Is there a better way to do this? I know this isn't even entirely accurate, ...
Given a username and password, I need to check if there's a user on the local system with said username and password.
I'm aware of posix_getpwnam and using the PAM package, but both of these methods require that the PHP script have access to /etc/shadow. I'd rather not mess with permissions of system files or daemon users.
I imagine th...
$r = mysql_query ( "SELECT guid FROM characters" );
if (mysql_num_rows($r) != 0) {
while ( $row == mysql_fetch_array ( $r ) ) {
$cap = rand ( 0, $char );
if ($row ['guid'] != $cap) {
$captain = rand ( 0, $char );
}
}
} else {
$captain = rand ( 0, $char );
}
This code should return me the...