php

stop and continue JavaScript execution

Hi i am trying to create an application for in PHP such that after the submission, the system should retrieve all the applications which he had done earlier and ask him whether to continue or not. the logic is in such a way that i hav a div (id : confirmation) whose display is none. when the execution is on progress, we fetch all the d...

Exact string replacement in php

Hi, I'm looking for a way to replace a string in php that exactly matches with the subject. For example I got a file named 'hello-world.txt' having three lines: 'http://www.example.com/' 'http://www.example.com/category/' 'http://www.example.com/tag/name/' and I need to replace the 'http://www.example.com/' with 'http://www.example2....

Manipulating preg_replaces's 'replace' value

I'm trying to alter the match value from preg_replace with an uppcase copy but cant seem to figure it out... I've tried: preg_replace("#\[name=((?:keywords)|(?:description))\]#is", "[name=" . strtoupper($1) . "]" ,$str ) and preg_replace("#\[name=((?:keywords)|(?:description))\]#is", "[name={strtoupper($1)}]" ,$str ) but none work...

open id or single sign on like stackoverflow

Hello friends, I m very impressed with the idea of stackoverflow, the way they provide the options to login to the users is very easy for any user. And if I have to do the same thing in my website then how its going to be. what will be the coding structure and coding snippets for the same in php , mysql and javascript (ajax). http:...

How do I install Sphinx on a CentOs 5.5?

Newbie here.. Hello there I want to install sphinx search to my CentOS 5.5. I just need to know the commands, for the full installation. If you could write a simple numbered manual that would be appreciated. ...

How to make "index.php#foo" load properly.

I am new to deep linking, so not sure how to do this. In order for the web site to be crawl able by all crawlers, I am using Hijax method which basically means all my links are tagged as follows: <a href=”index.php?foo=32” onClick=”navigate('index.php#foo=32'); return false”>Link</a> Due to this schema all of the pages on the web ...

Variables not carrying over to included file in different directory

So, I have a Wordpress theme. In the functions.php file, I'm writing a function that looks something like this: function my_function(){ $var1 = 'apple'; $var2 = 'orange'; include get_bloginfo('stylesheet_directory').'/lib/fruits.php'; } And the fruits.php file looks like this: <?php echo "My brother's favorite fruit i...

Need help deciphering PHP error message

How to overcome from below error: Notice: Use of undefined constant temp_members_db - assumed 'temp_members_db' in /var/www/signup_ac.php on line 10 Cannot send Confirmation link to your e-mail address Below is the Code: <?php ini_set('display_errors',1); error_reporting(E_ALL|E_STRICT); include('config.php'); // table name $tbl...

What skills should I focus on improving so that I may be considered a good web designer/programmer?

I ask this question as I have a lot of free time coming up and want to further myself in web design and web programming. I want to know how I can MOST EFFECTIVELY achieve a high level of skill and expertise for designing, maintaining and creating websites. I believe in learning by doing, and that's how I have been progressing so far. I...

big values for strtotime()

I tried echo strtotime('129:00'); but it will have an empty output. This echo strtotime('03:00'); will have 1288339200 as the output. I guess strtotime() won't accept huge values?? What's the alternative for strtotime() that will accept 129:00. ...

Processing large JSON files in PHP

Hi, I am trying to process somewhat large (possibly up to 200M) JSON files. The structure of the file is basically an array of objects. So something along the lines of: [ {"property":"value", "property2":"value2"}, {"prop":"val"}, ... {"foo":"bar"} ] Each object has arbitrary properties and does not necessary share them with...

Open Source PHP accounting/inventory module/script

Hi, i m working on a shopping cart in Zend Framework and looking to integrate some open source accounting/inventory module in it. Please suggest which will suite with Zend Framework best. ...

looping through a session array

Hello i got a question, i have a session array called 'addToCart', in there are multiple arrays with various id's, i would like to loop through these arrays with a foreach regardless of what the id name is. Does anyone know how i would approach this? ...

Embedded Youtube videos slowwww things down

I'm creating a site with a lot of embedded Youtube videos, but it seems the video players take a while to load. Is there a way I could speed things up? If this is not possible, then how do you embed just the thumbnails and load the videos when a user clicks on the thumbnail? ...

How to create a UUID in php (without a external library)

I'm using uniqid() in PHP to generate a UUID however, the returned string is something like: 4cca63b0d4be4 I thought UUIDs are suppose to be something like: 550e8400-e29b-41d4-a716-446655440000 How do you create a UUID in PHP? Usually I use auto-increment in MySQL to get my unique IDs, however, sometimes I want to generate a UUID when...

REGEX to find and replace IMG elements

Possible Duplicate: I'm looking for a regular expression to remove a given (x)HTML tag from a string I have a long HTML file and I need to remove all the <img /> tags inside it and all the <a><img /></a> anchors. What I'm thinking of is writing a PHP script that does the job. But each image and link has different number attri...

What is wrong with this conditional statement?

Hi I am trying to have the navigation highlights determined by what category or page you are looking at using wordpress. Can someone tell me what is wrong with a statement like this: <?php if (in_category('b')){ ?> <ul> <li><a href="#">A</a></li> <li><a class="current" href="#">B</li> </ul> <?php } else { ?> <ul> <li><a class="current" ...

PHP recursive function to get breadcrumb

Spent a few hours on this and need some expert help. I have a table like this: [id] [name] [parent_id] 1 fruits 0 2 orange 1 3 lemon 2 4 steak 0 When I go to lemon, I want the breadcrumb to be like: Home > Fruits > Orange > Lemon And lemon not to be a link but the rest to be a link. Any suggestions? The best I f...

codeigniter get time zone offset

i need to get the timezone offset value from the timezone data in codeigniter. Timezones i have are UM12, UM11, .... UTC.... UP10 UP11 UP12..... i need exact offset values. is there any direct method? ...

Using PHP Sessions

Hi All, So, I've been playin' around with sessions in PHP today, and after procrastinating over whether I should use sessions or not since I started PHP about 6 months ago (it looked scary), I've found it to be quite simple. But I am using time() as a session id, I'll explain why... I found a page on session reference in php.net websit...