php

Why fpdf library fail to work on production server?

Hi I am export pdf from my php page to 'pdf' in my localhost by using fpdf library.On my localhost the page is exported to pdf but when i host to the production server and work live ... The datas are not being exported to pdf Why it is not exported on live Actually i cant see any error also,,,,, but my page goes blank ...

assign a matched group values into the variable in php

Using php how to split the usernames,passwords,datadasename,hostname,etc into a variable. For Example: $db = "databasename://username:password@hostname/dbname" $ databasename = databasename $user = username $pass = password $host = hostname $dbname = dbname I have tried with grouping in regular expr...

facebook api (java or php): how to request the user to add the application when he opens it ?

Hiya. I've created a facebook application using flex. i tried server side both with apache-tomcat and tinyfbclient, and with php and using the php facebook api. i can't fetch the user info if the user did not add my application. how can i check if the user added my application to his facebook profile and if not, to open a window that a...

How to set id after creating new jstree node?

I'm using jsTree 1.0. And have this code : $(document).ready(function () { $("#folders_tree").jstree({ "core": { "initially_open": ["root"] }, "html_data": { "data": '<?= $folders; ?>' }, "themes": { "theme": "default", "dots": true, "icons": true, ...

Is it possible to (virtually) move a site from www.example.org/ to www.example.org/new/ with htaccess?

I'm wondering if it is possible to upload a site to the root directory, but not make it already visible for public (and Google for SEO reasons). And what is the best way for that? Is it possible with some rules in the .htaccess file to let it look like the site is www.example.org/new/ instead of www.example.org? Thanks ...

Why apache is recv()-ing something for 15 sec every time?

I have ZendFramework based application that is using XMLRPC communication to other ZendFramework app. Both are on the same server (for development). That communication is very slow, and I am trying to find out why. After profiling, I got to the point where there is a slowdown within fgets() of ZF Lib XMLRPC reader. While strace-ing Zen...

Monitor usage of a certain database field

Hi guys, I have a nasty problem. I want to get rid of a certain database field, but I'm not sure in which bits of code it's called. Is there a way to find out where this field is used/called from (except for text searching the code; this is fairly useless seeing as how the field is named 'email')? Cheers ...

pgSQL date field Conparison?

Hi all, I have a pgsql database , i want to compare two fields with there timestamp values. basic query select t1.valu1, t1.value2 from table1 as t1 where t1.valu1 == t1.valu2 With TimeStamp comparison select t1.valu1, t1.value2 from table1 as t1 where EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE t1.valu1 ) == EXTRACT(EPOCH FROM...

The use of globle in regular expression.

I used the regular expression (/\<+\/+\s+/gm,"</"). If i remove the g the regular expression don't work. Please let me know technical difference between 'g-global and m-multiple'. ...

Undefined index and 2 similar PHP files?

In this file (localization.php): <?php session_start(); header('Cache-control: private'); // IE 6 FIX if(isSet($_GET['lang'])) { $lang = $_GET['lang']; // register the session and set the cookie $_SESSION['lang'] = $lang; setcookie("lang", $lang, time() + (3600 * 24 * 30)); } else if(isSet($_SESSION['lang'])) { $l...

PHP Leftmost digit

Hi, let's say I have a variable containing an integer or a float (since integers might overflow into a float in PHP). I want to run some operation to get the leftmost digit and the rest of the remaining digits. To explain better: <?php $x = NULL; //this will hold first digit $num = 12345; //int /// run operation //outputs //$x...

How can I modify field value after Drupal webform sumission

I'm trying to modify value of the submitted field with php (server-side) to be send by mail and written to db: hook_form_alter(&$form, &$form_state, $form_id) changing of value looks easy, but nothing happens after I change it. Hook works. ...

why the fallowing error occurs when i am trying to export the data to pdf?

error: Could not include font metric file ...

Wordpress pagination

I have a wordpress page that shows the latest news. I want to paginate these news, and this is my code: <?php query_posts('posts_per_page=5'); ?> <?php while (have_posts()) : the_post(); ?> <div class="news"> <h1><a hr...

Variables are not being rewritten as page is processed.

I have a php script that checks to see if a particular file exists. This name of the file is defined by the 'compartment' variable. When the script is copied and pasted again into a separate block, changing only the compartment variable it runs into a problem... Say for example 1.jpeg exists but 2.jpeg doesn't. The first block displays ...

Insert created element at start of html tag using PHP DOM

Hi All, I'm trying to insert an HTML <base> tag immediately after the opening <head> tag of a page using dom. I've tried using appendChild which just inserts it before the </head> which is no good. Code im using: $head = $dom->getElementsByTagName('head')->item(0); $base = $dom->createElement('base'); $base->setAttribute('href', $url)...

php compile oci8 and stuck only at checking dynamic linker characteristics?? Why stuck?

./configure -with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client64/lib/ checking for egrep... grep -E checking for a sed that does not truncate output... /bin/sed checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling......

php / js facebook API Internet explorer fb_xd_fragment

Hi all, I'm debugging my website on Internet Explorer and, each time I try to use Facebook and connect with IE, it logs me in with Facebook, but in the popup it changes the URL to something beginning with "fb_xd_fragment" and it doesn't set the cookies for my domain... Any idea how to fix this? It only happens on IE, works perfectly on...

Can I have PHP redirect to an in-page link when I process a form?

I have a vertical scrolling website (lots of in-page links). I also have a contact form script I'm working on. I'm trying to set it up so when someone completes/submits the contact form, it redirects them to #contact_area (on the same page), but calling the header function after is throwing a "Cannot modify header information" error. ...

Any easy way to determine whether functions work on reference or call by value?

Hello, As i am reading manual of php for array functions, i see that some functions of arrays uses call by reference whereas some use call by value. Eg. array_slice uses call by value, array_splice uses call by reference. How do i remember these things without refering to the manual and thereby increase my productivity? What exact thoug...