php

How to receive XML data produced by a website in PHP?

I have been trying Simple XML but I can not navigate through the structure of the file. This is the URL I am trying to parse. https://ws.brreg.no/lod/data/982463718 ...

How can I sort a multidimensional array using php?

Hi I have to sort this array in desc. order on the basis of ratingVal using php. How can I do that. Array ( [0] => Array ( [rating_postid] => 26 [raCnt] => 6 [sRate] => 18 [ratingVal] => 3 ) [1] => Array ( [rating_postid] => 714 [raC...

pdf header footer append

Hi, I want to change pdf files. I will erase header and footer from pdf, but more important than that I want to write pane number, etc. to the pages. I saw a pdf tool, that just renders page as jpg and you manuplate pdf in that way. But I want users to select text from pdf. I dont want to disturb internals of orginal pdf much. ...

Hidden value is passing while the div's display style is none using PHP

Hi all, Here is my JS: <script type="text/javascript"> function display(action, id) { if (action == 'show') { document.getElementById("explanation"+id).style.display = "block"; document.getElementById("link"+id).href= "javascript:display('hide', "+id+")"; document.getElementById("link"+id).innerHTML = "Close"; } if (action =...

Php question about news menu plugin that may not be displayed

I am not realy a php programmer myself, so any help would be appreciated. I run a website on cms e107. Now I have installed a menu plugin called "Recent news menu" This will display the latest news articles in the selected menu area on the site. Now my problem is that it also displays news that is set to "Not display" (see picture) ...

How to receive data of an HTTPS website in a string PHP?

Is there a function to which you give the URL of a website and it returns back the source in a string? ...

Is there a hosting that is best suited for Symfony deployment?

Hi all, I'm going to put a new application I created the last few weeks in production. Is there a hosting company that is best for Symfony or doesn't that matter at all? Or are there hosting companies you recommend or don't recommend in my case? It's a very small application written in php (Symfony 1.4) and a db mysql with phpmyadmin. ...

PHP echo() MySQL result containing <> characters?

I am retrieving data from my SQL database... data exactly as it is in the DB = (21:48:26) <username> some text here. is it ok? when i try and echo $row['log']."<br>"; it displays it as = (21:48:26) some text here. is it ok? i assume this is due to the <> brackets making it think its an HTML opener... would this be the case? and if so...

Size of database . PHP - MySQL

Hello. I want to know the size of my database using php. How to display the size in megabytes entire database? Size in megabytes a specific request? ...

Is there any good tutorial on PEAR HTML_QuickForms2?

Hello, I've been searching for good tutorials on Pear HTML_QuickForms2 but so far I was unable to find any... I found a tutorial which claims to be able to teach you complex forms, however apart from being a good starting point doesn't get as deep as I would like.. Also, I know PEAR Docs have some reference documentation but I would ...

How to parse a variable?

I have the following test line in my PHP which works fine as a way of posting to Twitter from within my PHP code. $oauth->post('statuses/update', array('status' => "hello world")); However I want to post the contents of a variable as opposed to Hello World If I change the code as follows, then all that gets posted is $message $oauth...

Picking the nearest value from an array reflecting ranges

I have an array that reflects rebate percentages depending on the number of items ordered: $rebates = array( 1 => 0, 3 => 10, 5 => 25, 10 => 35) meaning that for one or two items, you get no rebate; for 3+ items you get 10%, for 5+ items 20%, for 10+ 35% and so on. Is there an elegant, one-line way to get the correct rebat...

best E-Commerce Shopping Carts for Zend Framework developer

What is the easiest, most friendly and robust E-Commerce Shopping Carts for a Zend Framework developer. I want invest my time in somethink forward-looking. I'm also interested in a solution with a big tutorial base. It should be free. I found this solutions for PHP/MySQL : Magento Commerce Opencart PrestaShop OsCommerce Zen Cart Digis...

mysql count row occurances in a date range, but convert null to 0 so it shows

This is my current query SELECT DAYNAME(date_created) AS Day, COUNT(*) AS my_count FROM sometable WHERE (@date_created >= '2010-10-20 21:02:38' OR @date_created IS NULL) AND (@date_created <= '2010-10-27 21:02:38' OR @date_created IS NULL) GROUP BY DAY(date_created) It only returns data for that day if the count exists. I was muc...

Redirect to non-https pages

Hi, I have come accross many solutions similar to what I need but I have tried changing them and have had no luck, it seems to be ignoring them sometimes and not other times. Essentially I have a site which I need to have https on only on certain pages or all php pages if that is easier but not for friendly urls e.g. /womens/skirts/ S...

Query to WP db not working on regular PHP page

Hi, Wonder if anyone has any thoughts on this, I'm putting a Wordpress theme toegther - As it's very custom requirements and I'm using a gallery fro one part I put together from a combination of other scripts (jcarousel etc) which does the job. This all works fine and dandy however I would like to query some of the tables in the WP data...

PHP Print and Echo HTML

very simple question. Lol i am embarassed to ask this cause i am usually very good with php but what are the ways to display html inside of php? for example: <? if($flag): ?> <div>This will show is $flag is true </div> <? endif; ?> OR <? if($flag) echo '<div>This will show is $flag is true </div>'; ?> I know that ther...

I need to strip dynamic information from a html/php file with PHP

Hi there, I have been trying to strip information out of a dynamically generated page and then insert the information into a database, this is only a one time thing. to explain the layout: I have a list of 700 IP addresses in my database currently but they have no location linked to them, I am using the following code to retrieve the ...

Remove HTML special charcters

How do i remove “ , ” , ° like special characters from a string in PHP Actually i need to read the contents from a text file and need to remove the html special characters except the alphabets and digits from it ...

Why is base64_encode so slow on PHP on IIS6 via FastCGI?

I'm trying to encode a PDF to attach is to an email, and the script I'm using requires the following lines of code: $headers .= "Content-Transfer-Encoding: base64\r\n"; $headers .= "Content-Disposition: attachment; filename=\"".$license_filename."\"\r\n\r\n"; $attachment = chunk_split(base64_encode(file_get_contents($license...