Via JavaScript, PHP, or HTML.
I want to do this to check if a username is allowed (on our side).
Sorry for not elaborating too much.
If the username is too short, a message will appear next to it (I will do this part) saying that it is too short, but for this to be done automatically I would need for it to be detected.
<script type="te...
Does anyone know where I can find documentation or a tutorial that shows how to write a mod for phpprobid?
...
I know, I know, title is quite bad, but I'll try to explain what I mean here. So, I ask my members to show their photos. They upload it somewhere, then paste their photos' URL into input and I save it to my database (MYSQL). Then, the photo is being seen on their profiles. I get the URL from database and do something like that: <img src=...
Bizarre bug: in a PHP script that serves video files, I have a few test conditions (authenticate token, make sure file exists, etc.) before sending a "video/mp4" header and outputting an MP4 file.
If any of the tests fail, $fail is given a non-false value.
At the end of the tests there's this if statement:
if ($fail) {
exit;
}
T...
I'm using CakePHP and I have a component I wrote that uses a component called "Users" to handle users login, logout, registration, etc. I would like to render that on the default.ctp layout in a sidebar. How can I do this?
I tried:
<div id="leftNav">
<div id="login-block" class="block">
<?php echo $this->element...
The site I'm renovating writes session data to their database using the session_set_save_handler function as follows:
session_set_save_handler (array(&$ses_class, '_open'),
array(&$ses_class, '_close'),
array(&$ses_class, '_read'),
array(&$ses_class, '_writ...
Very simple question. Why php can't be totally safe? Is it really not possible to create a web language which can't be broken?
...
I've got a version of the A* algorithm that builds a graph of the
UK road and cycle network in Python lists. It takes about 30 seconds
to initialise, but once done can very quickly find the shortest route
between any two vertices. The start and finish vertex ids are provided
by PHP.
I'm trying to work out the best way of communicating b...
I'm wondering what more experienced developers think about how to handle almost identical processes, such as a user creating a profile and a user editing their profile. At the moment I have a single controller method and single view which handle the distinction between a new user and existing/editing user, just by passing around an $edit...
In Running on CentOS5 + DirectAdmin.
I own a VPS, but for security reasons I just want to give all managenent only to 'reseller' user.
With a resseler user I have script, which connects to ressellers DA and creates an user.
My problem is - how to copy a directory tree with ~10000 of files, which is located in 'resellers user' ftp, ex....
I really like the Kohana cascading file system.
Do any other PHP frameworks feature this? I want to learn another framework besides Kohana, but I'd love to be able to use the awesomeness of the file system.
...
Hi,
I was wondering whether or not I've to call the $stmt->free_result() for after I've stored it's result with $stmt->store_result()? Could I rather just call $stmt->close() on the end?
The reason why I'm asking it is because when I call the $stmt->num_rows I've to call the $stmt->store_result() as said here: http://www.php.net/manual...
Hi guys. I recently purchased a flash blog on Flashcomponents.net : http://www.flashcomponents.net/component/advanced_xml_flash_blog_with_cms_and_rating_system.html
There is the blog and the blog "editor", for wich you have to log in. The password is defined in a Php file named 'admin.php'.
The problem is that, whatever password I type, ...
Hi,
I've been looking at some code and am having a hard time working out variable declaration in php classes. Specifically it appears that the code i'm looking at doesn't declare the class variables before it uses them. Now this may be expected but I can't find any info that states that it is possible. So would you expect this:
class E...
I have a project I checked out in Kohana and I'm trying to get it running on a local server and I'm getting the issue here: http://djaffry.selfip.com:8081/
The permissions for the logs folder is the same as for everything else,
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 12:37 cache
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 15:21 config
drwx...
I'm working on an online PHP application that has a need for delayed PHP event. Basically I need to be able to execute arbitrary PHP code x many seconds (but it could be days) after the initial hit to a URL. I need fairly precise execution of these PHP event, also I want it to be fairly scalable. I'm trying to avoid the need to schedule ...
I have noticed that most PHP-based libraries or frameworks have classes that don't explicitly return the keywords TRUE and FALSE, instead:
if(condition)
{
$this->boolean_property = FALSE;
return $this->boolean_property
}
does this mean anything or is it just another "purist" move which does not present any advantage over the other...
Strict Standards: Declaration of childClass::customMethod() should be compatible with that of parentClass::customMethod()
What are possible causes of this error in PHP? Where can I find information about what it means to be compatible?
...
$arr = array(25,41,120,...36);
How to group values in $arr to specified integer range $start ~ $end ?
For example , if the level range is 1~5(1,2,3,4,5), how can I specify a level for each element of $arr ?
The only principle is that larger value should map to larger level, and should cover the entire level range as possible.
UPDAT...
I am working on a PHP script that needs to read log files in reverse line order.
I currently do the following:
<?php
shell_exec("tac logfile.log > tmpfile.log");
$rFile = fopen("tmpfile.log", "r");
while (!feof($rFile))
{
//logic
}
unlink("tmpfile.log");
?>
This works nicely as it switches the order of the lines in the file and ...