php

jQuery ajax problem with div refresh and new content

I would like to refresh the #calendar div with the new content sent to calendar.php I'm getting a success alert, but the content isn't refreshing. How do I get the new calendar.php to show up with the POSTed data? $(document).ready(function(){ $('#next').click(function() { $.ajax({ type: "POST", url: "calendar.php", ...

Address bar input vs. Link

Is there a way to interrogate a request to determine the method of navigation ? (using a LAMP configuration, PHP) In other words... I would like to know whether the entry was hand typed into the address bar, or a link/bookmark was used. ...

What is the correct format for a blowfish salt using PHP's crypt?

I have read the information provided on the PHP Manual Entry for crypt(), but I find myself still unsure of the format for a salt to trigger the Blowfish algorithm. According manual entry, I should use '$2$' or '$2a$' as the start of a 16 character string. However, in the example given later, they use a much longer string: '$2a$07$uses...

Why does crypt/blowfish generate the same hash with two different salts?

This question has to do with PHP's implementation of crypt(). For this question, the first 7 characters of the salt are not counted, so a salt '$2a$07$a' would be said to have a length of 1, as it is only 1 character of salt and seven characters of meta-data. When using salt strings longer than 22 characters, there is no change in the ...

Grouping items from mysql by the day they were posted

So, I'm having a problem building a feed-style list of posts efficiently using PHP and Mysql. I want to output the posts organized and grouped by the day they were posted, showing the date as a header. For example: February 9th ----------- Posts that were posted on Feb 9th Feb 8th ----------------- Posts that were posted on the 8th ...

How do I make an automatic javascript function call from php function?

I am trying to create an auto-refresh for a table using ajax/jquery, php/html, and Drupal 6. Code once the database insert has finished and was successful: echo "<script type='text/javascript'>autoRefresh()</script>"; Code for the link that eventually calls the javascript code that actually performs the refresh of the table: $b...

php extension, how!!?

I need this library http://svn.arabeyes.org/viewvc/projects/itl/ports/php/. It is a php extension, and I want to know how I can use this. Do I need to compile this, and if so, how can I compile it? I've never compiled anything .. I need it to work for both Windows and Linux. ...

How to add filters to this pagination script properly?

Hello, I am currently working on this tutorial and would like to add a filter button to it. I am using jquery to make an element clickable: <p id="marketing">MARKETING</p> and the jquery for the element: // Sort content Marketing $("#pagination p").click(function () { Display_Load(); //Loading Data var ...

Whats the most efficent way to scrape data from a website (in php)?

Im trying to scrape data from IMDB, but naturally there are a lot of pages, and doing it in a serial fashion takes way too long. Even with I do multi-threaded CURL. Is there a faster way of doing it? Yes I know IMDb offers text files, but they dont offer everything, in any sane fashion. ...

Submitting POST data to a different site and then extracting the output with PHP

I'd like to use the snoopy class, but I don't have the proper server permissions with my shared hosting to install it. Any easy to use alternatives? I need to submit this POST data: hash = $_POST['hash'] Submit = Submit to this site: http://milw0rm.com/cracker/info.php And extract the output in the -::PASS column from http://milw0...

Elegant solution to read and transform query string in php?

I have a query string such as this: file.php?search=keyword+here&genre1=1&genre4=1&genre19=1&genre181&director=436&actor=347&search_rating=3 I need to extract all the genres mentioned in the string, in this case its genre1, genre4, genre19 and genre18 and output them into a string such as ge1_ge4_ge19_ge18 What would be a good ...

Zend_Cache vs cronjob

I am working on my bachelor's project and I'm trying to figure out a simple dilemma. It's a website of a football club. There is some information that will be fetched from the website of national football association (basically league table and matches history). I'm trying to decide the best way to store this fetched data. I'm thinking ...

calendar in php

How can I make a calendar in php so that the users will not have to input the date manually. ...

What is the color format to use with imagerotate() in PHP?

In PHP; what format is used for the background color option in the function imagerotate(). $color = "???????"; imagerotate($image, $degrees, $color); I have tried: $color = "#FFFFFF"; $color = "255255255"; ...

How to Cast Objects in PHP

Ive some clases that share some attributes, and i would like to do something like: $dog = (Dog) $cat; is it posible or is there any generic work around? Its not a superclass, or a interface or related in any way. They are just 2 different clases i would like php map the attributes from a cat class to a dog and give me the new object. –...

need to print labels from a ecommerce website

Im a wiz with php but i have a challenging client- who wants sandwich labels printed automatically as they are ordered from their website. what is the best solution for this- the e-commerce website is a php/mysql website i can do a call to some sort of service running but i have no idea how to print the info? what hardware is required.....

php sql code, foreach warning

Hi everyone, I have the following code, not written bymyself, but I am wondering if you could spot anything wrong with it? $query = "SELECT * from #__properties_type where published = 1 AND parent = ".$Category_id." OR parent = 0"; $db->setQuery( $query ); $types = $db->loadObjectList(); $nP = count($types)...

Simple Facebook HipHop Performance Question

If I write a hello world app using a PHP web framework such as CodeIgniter and then I compile it and run it using HipHop. Will it run faster than if I write the same hello world app in django or rails? ...

Comparing 2700+ filenames against 29000+ rows in a db table (PHP/FTP/MySQL)

I have a ftp repository that is currently at 2761 files (PDF files). I have a MySQL table (a list of those files) that's actually at 29k+ files (it hasn't been parsed since a recent upgrade). I'd like to provide admins with a one-click script that will do the following: 1) Compare the "existing" filenames with the rows in the database ...

php - mktime or strtotime?

I'm trying to convert 2010-02 to February, 2010. But, I keep getting December, 1969 I've tried using mktime, strtotime, and some combination of the two, but still haven't been able to do it... This is what I tried most recently... $path_title = date('F, Y', mktime(0,0,0,2,0,2010)); ...