I have an image uploading script in which i use the following setup to assign names to uploaded images;
$saltdate = date( 'U' );
$saltuser = $_SERVER[REMOTE_ADDR];
$saltname = md5($saltdate.$saltuser);
// Recieve, Process, Save uploaded image
// Update database with image name
The problem that i encounter is ...
Hi,
I have a website in php which is using 4 frames(top, left, middle and right). The middle frame
contains the web user control coded in asp.net. Now, in the right frame( which is coded in php ) some javascript contains the id of the items selected in right frame. I need to get those ids to the middle frame on asp.net user control. Ho...
i have two pages one in php(index.php) and another one in Perl(dbcon.pl).
basically i want my php file to show only the UI and all the data operations would be done in Perl file.
i have tried
in index.pl
<?php include("dbcon.pl");?>
<html>
<br/>PHP</br>
</html>
and dbcon.pl has
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
...
I noticed, that sometimes (especially where mod_rewrite is not available) this path scheme is used:
http://host/path/index.php/clean_url_here
--------------------------^
This seems to work, at least in Apache, where index.php is called, and one can query the /clean_url_here part via $_SERVER['PATH_INFO']. PHP even kind of advertises t...
Pls suggest me any inbuilt command or package?
...
I want to keep only numbers and remove all characters from a variable.
For example:
input: +012-(34).56.(ASD)+:"{}|78*9
output: 0123456789
...
Hello,
I've just listened to http://www.zend.com/webinar/PHP/70170000000bAuS-webinar-php-performance-principles-and-tools-20100218.flv (Zend webinar about PHP performance).
I can't understand what this phrase means "Try to make you architecture more horizontal rather than vertical" (see screenshot)
Thank you.
...
Can anyone tell me the difference between using mod_deflate and zlib output_compression?
I understand that zlib is done in PHP and mod_deflate is done in Apace, my .htaccess file looks like:
php_flag zlib.output_compression On
or:
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-...
Hi guys, I am having endless troubles with duplicate entries, so I need to check the database, and if a user has already entered that day, their entry will not be submitted and they will be redirected to a landing page that tells them they have already entered that day, and that they may only enter again tomorrow.
The field I would like...
Hi, im creating profile pages based on a subdomains using the wildcard DNS setting.
Problem being, if the subdomain is incorrect, I want it to redirect to the same page but without the subdomain infront ie;
if ( preg_match('/^(www\.)?([^.]+)\.domainname\.co.uk$/', $_SERVER['HTTP_HOST'], $match)) {
$DISPLAY_NAME = $match[2];
$query = "...
I am having trouble getting the Auth component do the redirects I want in a CakePHP 1.2.6 app.
I have a login form that appears on all pages and I want to keep the user on the page he logs in on. For example, if he is viewing another user's profile, I want to keep him there after logging in, not redirect him to the $this->Auth->loginRe...
Hello,
I have a news site containing an archive with more than 1 million news.
I created a word definitions database with about 3000 entries, consisting of word-definition pairs.
What I want to do is adding a definition next to every occurence of these words in the news.
I cant make a static change as I can add a new keyword everyday, ...
Hi everybody...
I need to use crystal reports with php... I googled around for a long time but was not able to find a good tutorial or book that will explain the process easily and efficiently...
Can anyone point me towards a place where i can get a simple tutorial about using crystal reports with php....?
Thanks a lot for your sugges...
Suppose you want to get a record from database which returns a large amount of data and requires multiple joins.
So my question would be, is it better to use a single query to check if data exists and get the result if it exists? Or do a more simple query to check if data exists then id record exists, query once again to get the result...
I have integrated CKeditor with my admin panel (php)
I have writtien a function for calling editor:
function editor(){
$txt = '<script type="text/javascript">
CKEDITOR.replace( "kabst",{
filebrowserUploadUrl : "'.UPLOAD_SCRIPT.'" });
</script>';
return $txt;
}
and define:
...
Hi,
I'm developing my first ever MODx site and I need to have three blocks on the frontpage that contain headline, picture, image caption, long text and a short text.
For these I would like to create a custom template that allows me to create sub-resources of "Home" with only these five fields (of which one will allow me to upload imag...
I have a PHP script on a server
<?php
// retrieve POST vars
$comment = $_POST['comment'];
$email = $_POST['email'];
// remove trailing whitespace etc
$comment = trim($comment);
$email = trim($email);
// format date accoring to http://www.w3schools.com/php/func_date_date.asp
$date_time = date("Y-m-d-H-i-s"); // i.e. 2010-04-15-09-45-2...
I have a string which contains only numbers. Now I want to remove all leading 0s from that string
For example:
input: 000000001230
output: 1230
input: 01000
output: 1000
Is there any function in PHP/Zend for this?
Thanks
...
I have a link within a block. At the moment it goes to a list of newsletter nodes:
<p><a href="<?php global $base_url; print $base_url;?>/news-events/newsletter">Read our latest newsletter</a></p>
What I would prefer is to have it go to the latest node of the content type 'newsletter', is this possible?
...
Is it possible to make nested table fit height of its parent cell in TCPDF?
My code:
<?php
require_once('tcpdf/config/lang/eng.php');
require_once('tcpdf/tcpdf.php');
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetFont('times...