Hello,
I have PHP page where users can upload photos (using Ajax & PHP script). Those uploaded photos (thumbs) are shown after upload in DIV below upload field and fancybox plugin (I'm using it for popup window for photos) is working ok then.
Then, after hitting send button I want to clone that DIV at that same page at message board, b...
Hi I'm a relative newbie.
Have a mail contact form set up with a captcha image generator.
When the captcha is verified, on submitting the form, a php page is actioned which further validates the input data (checking against spam).
Challenge: would like to retain form data in case of error in enterred capthca code and needing to return ...
I have a page that needs to load several dynamically generated images. Everything works fine 90% of the time, but sometimes some of the images are not generated (I just get the missing image icon instead). Since most of the times it works, and the missing images are not always the same, I think that maybe it has something to do with the ...
Hi,
I am creating a lightweight, single-file database administration tool and I would like to bundle some small icons with it. What is the best way to embed images in a HTML/PHP file?
I know a method using PHP where I would call the same file with a GET parameter that would output hardcoded binary data with the correct header, but that...
Zend framework is pretty fast growing, we all agree and we all had been surprised while trying out the modular structure of Zend Framework, if to be concrete the bootstraping of the modules - all the bootstrap files of the modules are executed in the beginning no matter if we are using/accessing that module or not. As far as I remember t...
Hello,
I'm writing a PHP system and I need to get the system time. Not the GMT time or the time specific to a timezone, but the same system time that is used by the CRON system. I have a CRON job that runs every day at midnight and I want to show on a webpage how long will it take before it runs again.
For example:
Right now it is 6pm ...
hey all, i use array_map from time to time to write recursive methods. for example
function stripSlashesRecursive( $value ){
$value = is_array($value) ?
array_map( 'stripSlashesRecursive', $value) :
stripslashes( $value );
return $value;
}
Question:
say i wanna put this function in a static class, how would i use...
Hello,
I have a file hosting site and users earn a reward for downloads. So I wanted to know is there a way I can track whether the visitor downloaded whole file so that there are no fake partial downloads just for rewards.
Thank You.
...
What are aliases in ldap (referenced for example here php.net/ldap)
Are they pointers to other objects in the system not directly under the object where the alias is found?
...
This is the most optimal way of dealing with a multilingual website I can think of, right now (not sure) which doesn't involve gettext, zend_translate or any php plugin or framework.
I think its pretty straight forward: I have 3 languages and I write their "content" in different files (in form of arrays), and later, I call that content ...
Hello
Im using Sphinx 0.9.9-release (r2117) and sphinxapi.php (http://code.google.com/p/sphinxsearch/source/browse/tags/REL_0_9_9_RC2/api/sphinxapi.php).
When I testing searching in command shell: "search -i INDEX_NAME test" everything is
perfect, but when I connect to Sphinx by sphinxapi.php this error occur.
sphinx.conf is configure...
What I am trying to do is I have a selected date formatted as below:
$selectedDate = 2010/02/24
I want to check it is both todays date and it is past 9pm on the server and set a value if it is.
I can get a time by using the following:
$checkTime = date("H:i");
I want to create something like:
if ($checkTime > 21:00 && $selectedD...
In my previous question on this topic, what would the implications be if I removed the dynamic variable and instead replaced it with a static one like you see below...
$source = 'http://mycentralserver.com/protected/myupdater.zip';
I've included the code below for convenience...
<?php
// TEST.PHP
$source = 'http://mycentralserve...
I would like to define a class constant using a concatenation of an existing constant and a string. I can't predefine it because only scalars are allowed for predefining constants, so I currently have it as part of my constructor with a defined() function checking if it is already defined. This solution works but my constant is now unnec...
I am trying to get expose_php to off with ini_set, except it seems to not be working. I tried the value 0, and Off, but neither work.
ini_set('expose_php',0);
help?
...
Hi! I am developing a Web and want that the user could create some stuff POSTing xml data. For that propose there is a < textarea > where the user can write (copy/paste) xml and submit it. The problem is that I am loosing data, characters such as '<','>' and i think others too get lost.
Maybe it is a framework problem, not sure, I am u...
Hello.
I have this:
$scCost = $row["gpsc"];
mysql_query("
UPDATE member_profile
SET points = points-$scCost
WHERE user_id = '".mysql_real_escape_string($userid)."'
") or die(mysql_error());
That takes do the user´s points - scCost.
How do i check if the user can afford it or not? So, if the user...
I am building a site that is permissions based. The user can add or remove read permissions to the public for pages as well as files.
What is the best way to serve files that are protected, using php? I have seen things like www.mysite.com/download?file=filename.jpg or something like that, but I prefer clean paths.
Also, if my files ...
Hello all,
I am using codeigniter and its pagination class. It works perfectly and it looks something like this:
« First < 1 2 3 4 5 > Last »
Here is my code:
$this->load->library('pagination');
$config['base_url'] = base_url().'controlpanel/';
$config['first_link'] = 'First';
$config['total_rows'] = $count;
$config['per_page']...
Hy guys.
I want to analyze the result of each function that I call. If this result is a exception or is false then the script ends. I can do this manually, but it is a big waste of time to call a control function for each new function.
Something like this:
http://codeviewer.org/view/code:c5c
Can I configure PHP to set this error ...