php

Wordpress Hooks

Hi, How does wordpress implement hooks internally? ...

Split data to multiple columns

This is the data currently located in one column: "Title Info - Company Here - City Here, ST" ST represents state ie GA Sometimes my data looks like this: "Title Info - Company Here - United States" Data is on column named "title" and is without quotes. How do I split this using php, for 4 new columns named: "New_Title", "Compan...

How shall i get my friends of friends using mysql and PHP

Currently I am in need to find the friends of friends in my application using PHP and MYSQL For example : Database structure is like this. Table Name : tbl_friendlist Ident mem_id friend_id 1 2 1 2 1 2 3 1 3 1 4 1 5 1 8 How can i achieve this I am...

Javascript messing up POST-request for PHP-file?

Hey everyone, I got following scenario: A site is sending a request to a php-file to hand me some data. For this request I am selecting an item - here is the code for that part: <form action="?modul=transaktionen&subModul=monitor" method="post"> <input type="hidden" name="suchVal" value="1"> <input type="hidden" name="action" value="1...

Disable Apple PHP on Mac OS and use XAMPP instead

Hi I've installed XAMPP and I want to use the PHP that comes with it from the command line. So I'm looking to disable the Apple version of PHP and related tools. Anyone know a clean way of doing this, while allowing Apples PHP to be re-enabled again relatively easily? ...

Is there any way to echo out <p> styles in PHP?

Basically, i would like to echo out something along the lines of <p style="color:FFFFFF">, or possibly a class, but it seems the parser isn't really liking the fact that it contains quotes, and it quickly destroys my site. Is there any hack to get around the parser rules, alternatively a better solution? Cheers. ...

Efficient way to communicate between Flash and MySql?

What is the best/fast/efficient way of communicate between Flash and MySql? I have a multi-players online game using Flash-php-MySql, it seems like when I reach 5 or more players, the game is laggy. And I believe that problem is because of request and response from MySql through php. I am using URLRequest, Post method in AS3 file. I tri...

Parsing URLs using PHP

Hi, I have posted a similar question here. However, this was more about getting advice on what to do. Now that I know what to do, I am looking for a little help on how to do it! Basically I have a website that is pretty much 100% dynamic. All the website links are generated using PHP and all the pages are made up of php includes/code. ...

Retrieve an image and load it in a html page

Hi friends, I am working with php and ajax. I'm able to retrive an image from a database, but I would like to show the image in 100px x 100px size, but it just retrieves the original image size and spoiling the aligning work that I did. How can I fix the width and height for a retrieved image. I have used the following code for retrivin...

How to send to view $data and $data2 at same time?

Hi friends, I use codeigniter and issue about how to send to view $data and $data_cat2 at same time? $data['records'] = $this->gallery_model->get_all(1); $data_cat2['records'] = $this->gallery_model->get_all(2); $this->load->view('gallery/index.php',$data); I tried to put an another load->view for $data_cat2. and it just repeated...

Push questions and help

Hay guys, I'm looking into reading about 'push' technology, but i think i may have heard about it in the wrong way. Is there are interesting things i should know about it? How can it be done in PHP? Can it be done in PHP? What's the general idea behind push? Thanks ...

Resolve IP to Hostname using PHP

How can I resolve an IP address to a hostname using PHP? ...

Get interval seconds between two datetime in PHP?

2009-10-05 18:11:08 2009-10-05 18:07:13 This should generate 235,how to do it ? ...

preg_match_all [200932]

Hello everyone i want to preg_match [200932] this from a string. I tryied some pattern but didnt help, any idea? ...

Track where users come from in PHP?

Is it possible to find out where the users come from? For example, I give a client a banner, and the link. The client may put the banner/link to any website, lets say to a site called www.domain.com. When the user click the banner, is it possible to know where he coming from(www.domain.com)? ...

Problems with replacing text in a text file

I have the following scenarion. Everytime my page loads I create a file. Now my file has two tags within. {theme}{/theme} and {layout}{/layout}, now everytime I choose a certain layout or theme it should replace the tags with {layout}layout{/layout} and {theme}theme{/theme} My issue is that after I run the following code if(!file_exis...

Preg_match_all <a href

Hello i want to extract links <a href="/portal/clients/show/entityId/2121" > and i want a regex which givs me /portal/clients/show/entityId/2121 the number at last 2121 is in other links different any idea? ...

How do check if a php session is empty?

Is this bad practice? if($_SESSION['something'] == '') { echo 'the session is empty'; } Is there a way to check if a its empty or b it is not set? e.g something better than... if( $_SESSION['something'] == '' || !isset($_SESSION['something']) ) { echo 'the session is either empty or doesn't exist } OR does !i...

PDO looping throug and printing fetchAll

I'm having trouble getting my data from fetchAll to print selectively. In normal mysql I do it this way: $rs = mysql_query($sql); while ($row = mysql_fetch_array($rs)){ $id = $row['id']; $n = $row['n']; $k = $row['k']; } In PDO, I'm having trouble. I bound the params, then I'm saving the fetched data into $rs like above, wi...

get renamed file names of multiple upload form [js array] in codeigniter

Hi friends, I use codeigniter. I have a multiple image upload form. The code below is working well for uploading, but I also need to save file names to database. How can I get the names in here? I spent hours & hours :/ but could not sort it :/ Appreciate helps!!! uploadform.php echo form_open_multipart('gallery/upload'); <inpu...