php

How to boost the performance of header('Location: '. $url, TRUE, $http_response_code);

header('Location: '. $url, TRUE, $http_response_code); Sometimes the above takes several seconds, is it possible to speed it up? ...

Generating PDF printouts from PHP

Hi, I have a PHP program that reads from the database and generated formatted sheets. The sheet is one for each person in the database. So, I thought the best way is to convert each into a PDF because this way I don't have to worry about headers, footers and the margins that the printer adds automatically. I have used DOMPDF for this...

is this chat script efficient?

i made a chat using php and ajax, and i am using a while loop to check the database for new messages. this is the code that retrieves the message: //retrive message function update(){ $(document).ready(function(){ $.ajax({ async: true, type: "POST", url: "listen.php", success: function(data){ $("#myp").before(data); }, comple...

dollar sign in associative array Index

I am using Google Analytics API in PHP. I am fetching JSON data which I am converting into Associative Array by using Json_decode however when try to access attribute dxp$dimension, it gives error since it evals $dimension as a separate variable. How do I evaluate whole thing as an Index for fetching data? Thanks ...

How to create or define class in PHP at runtime??

How to create or define class in PHP at runtime and defin its attribute and functions? Is it possible? ...

When I get a page via cURL, it is returned badly encoded

I've been trying to grab one page via Curl but fail to do it properly as the page returns badly encoded. Here's the page: http://www.movinsane.com/play13.php?vid=107628 Would you please tell me what how to do it with the help of PHP's Curl so that I can view it properly. Any help would be much appreciated. Thanks in advance! ...

Virtuemart breaking my js sliding submenu's

I am having an issue with a javascript sliding menu. It is for a joomla website using virtuemart. Please take a look at dev.indigoniche.com ... (this keep redirecting back to the live site because of a cookie issue but when that happens just go back to the dev area) If you use the + and - next to some of the menu items you will see the...

decrypt result from server

I'm trying to decrypt a variable that I've encrypted from my web server and haven't gotten any luck. I've encrypted the variable on the site using sha1(variable) in php, but am stuck trying to decrypt it once its passed back to the iphone. If you have any other code other than sha1 that works, im happy with that too. thanks ...

PHP: HTTP Basic - Log off.

I would to set it up where if someone sends in a request "logout" it will automatically take them to a page saying "successful log out". If the customer tries to press the back button or go to the restricted area, it will ask for HTTP auth again. What I have so far is this: example.com/restricted/index.php: <?php session_start(...

Pagination Class calculates incorrectly.

hi, ive written a pagination class and it looks like its not outputting the correct amount of rows. i have a table full of 51 records and instead it shows only 30 records and as for the pages it shows only page 1 where it should show page 1 and 2. the pages are viewed by going to page=1 as a browser param. when i try to view page=2 i see...

PHP passing variables to Perl, having issues with using spaces between variables method, is there another, better way?

I find myself needing to use Perl more and more since PHP's regular expressions leave me wondering what is going on half the time as they simply don't respond as they should (as they do when I use Perl, for example)... i had been using this method to call perl (before i started trying to do this with regular expressions).. passing in a r...

Display current URL of webpage (dynamic) in HTML

I have this code in my HTML: <h3 id="left">Lorem Ipsum </h3> <h3 id="right">[Current URL Here]</h3> I want to display (dynamicly) the current URL inside the <h3> tags. I've been trying to figure it out for a few days, but I'm really a mobile developer, not an HTML developer, so it's proven difficult. I need this for a...

What is a django-like framework for PHP with auto-generated CRUD pages?

I'm looking for a simple MVC framework for PHP and would like something that handles basic user auth (for the admin) and generates it's own CRUD pages out of the box. Edit: I'd really like something that creates these admin pages on the fly or "automatically" instead of the whole "baking" concept or having to manually update the CRUD pa...

Curl can't get a webpage properly.

I've been trying to grab one page via Curl but fail to do it properly as the page is returned badly encoded. Here's the page: http://www.movinsane.com/play13.php?vid=107628 Would you please tell me what how to do it with the help of PHP's Curl so that I can view it properly. Any help would be much appreciated. Thanks in advance! $c = cu...

how to get the position of sorted rows using mysql and php

I have a table which stores high-scores, along with player ids. I want to be able to extract a record by a players id, and then get the rank, or position of their score in the table. Means, Basically I want to be able to say "you are in Nth" position, purely based on the players score against all other scores. For Example: if i am at 46t...

How to install joomla on localhost:8080?

I am running IIS and WAMP on same PC. The IIS is running on localhost and Wamp is running on localhost:8080. Now the problem is that when i strat to install joomla in WAMP, the installation is not proceeding from database configuration step. I enter the host name as localhost:8080 on database configuration step. ...

PHP Memcached CAS (check and set) issue

Hey all, here are the version of my current setup Memcached (1.2.2) Pecl Memcached Client 1.0.2 (using libmemcached 0.43) Issue: I cant get a cas token returned during a get request Here is the code in question! 27 public function action_test() { 28 //phpinfo(); 29 $m = Model_Mem::getSingleton(); 30 $found = $m->get(...

PHP Data Base Connection help with mysql

i am new in php and want to know the code for php mysql database connection code ...

Transforming a url into a unique 32 character token

I am writing an affiliate system, and I want to generate a unique 32 character wide token, from the url. The problem is that a URL can be up to 128 chars long (IIRC). Is there a way that I can create a unique 32 char wide key/token from a given URL, without any 'collisions'? I am not sure if this is an encoding, encryption or hashing p...

unixODBC Freetds PHP Problem

I am using Debian. I have unixODBC installed as well as FreeTDS. I am using PHP I have read several How-Tos and am stuck on a problem. I tested FreeTDS by using tsql and it works. I tested unixODBC by using isql and it works. When I created a script in PHP and tried to access a database I get the following errors. Fatal error: Call...