php

PHP access data of an object

I have an object of which I am looking to get a piece of data from, the object looks like this, Product Object ( [name] => Simon Test Cup [code] => 123456789 [category_id] => 3 [range_id] => 26 [price] => 10.00 [price_logo_add] => 0.25 [image_id] => 846 [rank] => [special_offer] => N [cartPr...

Eclipse PDT - how to debug the $_SESSION, $_GET, $_POST variables...

Hi, I'm stepping through code using Eclipse PDT. When I mouseover an array it says e.g. "$_SESSION = Array [0]", but won't show me the data. This is fine for local varaibles as I can see them in the "Variables" window, but it means that I can't see the contents of $_GET, $_POST, $_SESSION. How do I fix this? ...

\r\n Replace not working while sending Emails using PhpMailer Library

I have been trying to send emails, using the PHP Mail Library and have been partially successful. The only problem that I am facing is, when the Mail is received by the receiver, every new line is shown as \r\n . I have tried this: $body = str_replace("\\r\\n", '\n', $body); but it shows a '\n' instead of a new line. I have also tried th...

Excel, Php, and sessions

Hi! I want to export an Excel table with PHP. That table contains links to the actual website. The problem is that these links can only be seen by an authenticated user. When I click the links in the Excel file, even if I've logged in to my website (so technically there is a session already started), the page won't open, but instead redi...

PHP - Patterns within Arrays

I am trying to create a function which maps a recurring pattern of integers using an array. As an example if I have a starting array of (0,1,3) and I know that I want to stop the pattern when I hit 15. The pattern gets incremented by a fixed integer each time (lets say 4) so my final pattern should be.. 0 1 3 4 (0 + 4) 5 (1 + 4) 7 (2 ...

$_COOKIE['cookiefoo'], try to get a cookie

Hi, I'm newbie with webapps and PHP. I'm trying to get a cookie that it's not created yet, I mean, when I try to load a page that looks for a non-existent cookie I get an error, I tried to get rid of this with a try/catch but not success. This this the code I'm trying: try{ $cookie = $_COOKIE['cookiefoo']; if($cookie){ ...

Determining the hostname/IP address from the MX record in PHP

Hi there, have a basic email domain validation script that takes a user's email domain, resolves the IP address from that and then checks that against various published blacklists. Here is how I am determining the IP: $domain = substr(strchr($email, '@'), 1); $ip = gethostbyname($domain); The problem is that some email address do...

Servlet container; What is it and do I need it in my case?

I have just ordered a VPS from my provider. I have some Q however... My website uses Solr, which requires the following according to their website: "Solr requires Java 1.5 and an Application server (such as Tomcat) which supports the Servlet 2.4 standard" I also need php 5, MySql, and the usual javascript etc... The OS is Ubuntu 9.10...

method for creating PHP templates (ie html with variables)?

I'm designing my html emails, these are to be a block of html containing variables that i can store in a $template variable. My problem comes with the storing in the variable part. putting all my html into php makes it a pain in the bum to work with. for example, the below code is fine for a simple email but once i start getting neste...

PHP regex:Find all 6 digit numbers in a string that do not end in 00

Hello all I'm trying to find all the 6 digit numbers in a string that do not end in 00. Something like that /([0-9]{4})([^00])/ //i know this is wrong so the string asdfs dfg_123456_adsagu432100jhasj654321 will give me results=[123456,654321] and not 432100 Thanks Have a good day ...

Facebook.streamPublish does not write on wall...why?

$titleData = json_encode(array( 'gname' => $giftName, 'url' => $appCanvasUrl, )); $bodyTemplate = '<a href="{url}">One gift</a> to {actor}!'; $bodyData = json_encode(array( 'url' => $appCanvasUrl, )); $bodyGeneral = '<BR>Send the exclusive gifts to all your...

Unified data representation and form generation in PHP

Hi, I'd want to start using a new system for this project and I was looking for some tools to achieve my goals. Those would be: Data represented under only one form ( only the database schema, or the database itself or whatever) Possibility to easily generate and update other data representations (ex: SQL code & forms from DB schema) ...

I have two problems about tcpdf

Hi i am using tcpdf in my application and i have two question about that.I am able to get pdf output of a html page when i click specified button. My first question is:How can i download that html's pdf output when i click that button?($pdf->lastPage() didn'work). My second question is:How can i set character encoding for Trkish?(I am us...

setlocale to fr-FR in PHP and number formatting

Hi, I am trying to create a French version of one of my sites. I have set setlocale(LC_ALL, 'fr_FR'); at the top of my page, and using strftime I am displaying dates correctly in the French style. However I am having some problems with a number. Part of the page uses data I am getting from a Web Service. I am assigning a returned value ...

Jetty 6: Unknown Error 99

The system I'm developing is comprised of a jetty server (v6.1.2rc4) and a php frontend that sends http requests to jetty via curl_exec. The server and the client are on the same machine. The requests I send can be both POSTs and GETs, I get the same error for either which is: Failed to connect to 127.0.0.1: Unknown error 99 This is ...

Why would a Drupal form not be cached in cache_form?

My form, lets call it organize_issue, is a form in a custom module being called from the menu using the page callback drupal_get_form function. The form works perfectly well. I'm trying to implement some AHAH type functionality now, and need to get the page from cache using form_get_cache($form_build_id, $form_state) but, oddly enough, ...

keeping single-quotes in http_build_query()?

I'm wanting to use http_build_query to change an array to html tag properties. Problem is, it's changing my single-quoted values into %27. So if I have http_build_query( array("type"=>"'hidden'", ... ), '', ' ' ); I get <input type=%27hidden%27 ...> How can I get around this? ...

How come, diffrent text files become diffrent sizes after compression ?

I have file of some random text size = 27 gb and after compression it becomes 40 mb or so. And a 3.5 GB sql file become 45 Mb after compression. But a 109 mb text file become 72 mb after compression so what can be wrong with it. Why so less compressed, it must 10 mb or so , or i am missing something . All files as i can see is Engli...

PHP - Language Data

What's the best way to store language data? Keep it as variables in some kind of lang.php file... $l_ipsum = 'smth'; $l_rand = 'string'; Or select them from a database? I'm in search of your advice. ...

Where can I find free PHP forms?

Hellow! There is a question concerning PHP. Whether there is a product similar on a functional liks PHP forms but is more cheaper? Thanks! ...