php

Extract text and put into array with PHP

I have the following string and need to extract the text inside the div's (EDITOR'S PREFACE, MORE CONTENT, etc) and put them into an array with php. How could I do this? Thanks in advance. <div class='classit'><a href='site.php?site=1&filename=aname4'>EDITOR'S PREFACE</a></div> <div class='classit'><a href='site.php?site=4&filename=a...

Load view passing two arrays

Hi! I have two dropdownlist in one view but i don't know if i can load the view passing the two arrays like this: $this->load->view('primerPaso',$data,$data2); To be more specific i'm doing everything like this: Model /* * Método encargado de consultar las ciudades * donde existen agencias. */ function ConsultarCiudadesAgencias()...

Why is my Facebook Connect button taking me to the wrong URL?

I'm trying to link my website with Facebook. If I call the method in the PHP SDK called getLoginUrl(), it returns the correct login URL. This URL contains a number of parameters, one of which is my API key and it is correct. This is the URL that my Connect button is supposed to take me to. However, when I actually click the Connect but...

C# wysiwyg editor for a custom language.

Hi, I need to build a visual editor in C#. Given a piece of PHP and/or HTML code, the software will display them in the form of an editable webpage. At the same time it will display a dialog box from where the user should be able to edit options for the selected component. It is pretty like Adobe Dreamweaver's HTML editor but it needs t...

how to get text of item checked in dhtmlx using`getAllChecked()`

Hi, I am using dhtmlx to populate mysql data in treeview in php. Everything was fine, except, when I use getAllChecked() to get all the items checked as array, it shows identificators instead of text of the nodes. Is anyone of you have used dhtmlx, can you please help me out in getting the text of node instead of id please? ...

printing restaurant opening hours from a database table in human readable format using php

i have a table that lists the opening hours of restaurants. the columns are id, eateries_id, day_of_week, start_time, and end_time. each eatery is represented in the table multiple times because there is a separate entry for each day. see this previous question for more details: http://stackoverflow.com/questions/3070295/determine-if-a-r...

How to find larges file in a directory tree, in php?

I have a folder, that contains other folders, which may or may not contain other folders, where the files might reside. I want to scan the entire dir structure, and find files larger than 100MB, and move these files to the top level directory. Whats a good way to accomplish this, in php? For example: /data/1/subfolder/id33/big_file.av...

Fetching Facebook "likes" data from a user's profile using old rest api

Is it possible to fetch the "likes" data from a user's profile using the old rest api ? Specifically FB has launched this new "Likes" feature recently, where a user can Like a page, etc. This information is visible under the "interests and likes" section of the Info page of a user. I am looking for a way to fetch this information using ...

What object oriented design pattern would you use to implement a class that can only be instantiated once?

Thank you for your replies! ...

Is it possible to send an email from PHP without using the SMTP server

I need to send a newsletter to several thousands of subscribers with PHP. The hosting service I am using allows me to send 300 mails/hour tops with their SMTP server. They told me that if I send email with PHP without authenticating or using the SMTP server I won't have any problems with limits. Is that even possible? Doesn't the mail(...

select restaurant table entries within a certain distance from current location using php

i have a database table with a list of restaurants including their names, latitudes, and longitudes. i would like to select all the restaurants that are within a certain distance from my current location. the current location is determined in the php file (right now i'm just using a static lat & lng). i found code for calculating the dis...

mssql_connect in php does not exist

I've been struggling with this for a while now and I dont know what I'm missing. The error is "call to undefined function mssql_connect()" Having looked into it already I've done about everything I can. I moved the php.ini file to c:windows. In the ini I changed the extension_dir to "c:PHP\ext" and uncommented extension = php_mssql.dll. ...

Is it possible to hide a value in a form drop down list (PHP, JavaScript)?

Hi all, I have a form drop down box (for the 50 states) that is populated via a PHP for loop (see code below). The user selects a residential state, then later in the form also has to select a mailing state (in case the two are different). I have provided a check box in JavaScript that, when checked, populates all the mailing informati...

Jquery with PHP problem.

Let me post the code first. function alertCallback<?=$position_info['id']?>() { var id = <?=$position_info['id']?>; var itemname= '<?=$na?>'; <?PHP if($position_info['name'] == $wposition){ ?> var reward = '<?= $itmname ?>'; $('#selected_item').html(''+itemname+reward); <?PHP item_add($_SESSION['use...

In PHP, how many parents may a single class have, and what is this process called?

Thanks for your replies. Appreciate it alot! ...

Sorting a multi-dimensional array by the sequence of another array

Consider the following array: $main_array = array(); $main_array[0] = array('location'=> array('France', 'Germany'), 'random_number'=> array('6520')); $main_array[1] = array('location'=> array('Italy', 'Switzerland'), 'random_number'=> array('3245')); $main_array[2] = array('location'=> array('Portugal', 'Spain'), 'random_number'=> arra...

How to return a HTML file as the response to a POST request?

I send a POST request to a PHP page, and depending on what the contents are I want it to return one of two independent HTML pages I have written. ...

Is it possible to have a javascript function in php

Hi everyone, I have a program which records the time when user clicks the button I have written the timer script in javascript now i want to include this function inside php how can do this. Thank you, Swarna ...

PHP yes or no form

What is the code for a PHP form that matches a user input to a correct response and if it is not equal, it returns an error and if it is it shows a successful message. Example: If the proper string to insert is 1234 and the user enters 3948, it should return an error, but if the user enters 1234 it should go to a new page. ...

Use of URL Fields in Doctrine

I am building the site and planning on implementing OpenID. I can get an OpenID URL back from Google, but Doctrine appears to do funny things with URLs in the where clause of my query. How can I fix that? Here is the function /* This function queries docrtrine for a user OpenID URL * and returns the user object. */ function getUserBy...