php

AJAX and/or JQUERY form POST?

Hi Masters Of Web Programming, here I come with another stupid question, hoping someone will answer me. I'm not very good in AJAX programming but due some situations I must build a completely non-refreshable site. Next question is how to make this form to send a request and return the result, WITHOUT reload of current page? <?PHP f...

How to get the browser to cache images, with php?

I'm totally new to how to cache images. I output all images in a gallery with php, and want the images already shown, to be cached by the browser, so the php-script don't have to output the same image again. All I want is the images to show up faster. when calling an image I do like this: <img src="showImage.php?id=601"> and the sho...

Add Preprocessor to HTML (Probably in Apache)

I would like to add a preprocessor to HTML pages. Basically, I have a program that takes the name of an HTML file containing preprocessor instructions and outputs the contents of the file after preprocessing to stdout. This mechanism could change if it makes things easier. All I want to do is hook this into Apache so that all the file...

how to achieve the following ajax

I am working with php and want to have a page that has a drop down on top. elements in the drop down have some id associated with them. Underneath the drop down there is a text box and underneath the text box some images. so like the following <drop down box> ______________ <textbox _content_ loaded via ajax onchange of drop down box> ...

Streamlining Database/Login Process with PHP/MySQL

Hello all, I'm currently working on a small webapp where I work. I've created this for different departments. So, for example, let's say that: Marketing, Human Resources, and Sales uses it. Right now, as it stands, I have 3 completely different directories for each dept: http://mydomain.com/hr http://mydomain.com/marketing http://...

How to use Doctrine_RawSql for a fulltext search and sorting by relevance

I'm trying to get fulltext searches to be sorted by relevance in a Doctrine_RawSql query. This code will perform the search: $q = new Doctrine_RawSql(); $q->select('{p.*}') ->from('cms_page p') ->where('match(p.content) against (?)', $user_query) ->addComponent('p', 'CmsPage p'); This will execute. I would like the results to ...

Validating SQL query with PHP

The validation seems to fail for some reason. By the validation, I mean the "if ($result)" -part. How can I correctly validate SQL-query? $dbconn = pg_connect("host=localhost port=5432 dbname=heoa user=heoa password=123"); $email = $_POST['login']['email']; $result = pg_query_params( $dbconn, 'SELECT user_id ...

Creat temporay thumb image in PHP

Hey, i am looking for a method to creat temporay thumb file in PHP. Is there any way not to store the image on the server or delete them right after. What I am looking for is a solution like this: http://www.dig2go.com/index.php?shopbilde=772&amp;type=1&amp;size=120 Could some one explain to me how the php code behind this works? For th...

parsing and editing html in php

Can anybody tell me how to parse and edit HTML in PHP? ...

php wordpress query

I had posted this earlier on Stack Overflow, but couldn't get a positive result. I thought I should do this again. <?php require_once 'news/wp-config.php'; $howMany = 0; $query ="SELECT `ID`, `post_title`,'post_category', `guid`,SUBSTRING_INDEX(`post_content`, ' ', 100) AS `post_excerpt` FROM $wpdb->posts WHERE `post_status`= \"publish\...

php dns records

Hi there When I use dns_get_record within a php script to get a list of DNS records for a domain, a list of records are returned. But then if I run the script again it does not return all of the same results(ie it just returns the name servers) then if I run it again it works etc. This is the code I am using: $result = dns_get_record...

Visually Display Database Information with PHP/MySQL

Hi, I'm looking for a way to visually display my users' (schedules) at a glance. This is what my tables essentially look like: users: usrID usrFirst usrLast etc.. 22 John Doe semesters: id name year 1 Spring 2009 class_info: id name building ro...

OpenID Logout. I just need authentication not login to OpenID Provider.

Started with this question: http://stackoverflow.com/questions/1385082/openid-how-do-you-logout OK. So OpenID does not have single logout. I can see the uses but there are some situations that worry me: Single signon on is great for mobile devices and your personal computer. You sign on once and probably never need to sign out again (j...

Add form element dynamically using javascript -- not submitting

Edit: I fixed the problem by just starting from scratch. Sorry to waste y'alls time. Please vote to close if you feel so inclined. I'm having trouble getting the actual data in a form to submit when the input fields are added via javascript. The fields show up, and in the right place, but when I do a var_dump( fieldname) on the serve...

What's wrong with my Lucene query?

Hey SO, I'm running Zend_Search_Lucene, which is almost exactly the same as normal Lucene. I'm keeping stores in my Lucene index, and they're holding this: id of store for sql - 'store_id' of field type keyword name of store - 'name' of field type text latitude of store - 'lat' of field type keyword longitude of store - 'lng' of fi...

php print_r nice table

Hi there I'm looking to be able to produce a nicely formatted table with rows and columns from the contents of a print_r array statement? Any ideas? ...

Heavy sessions slowing website

Hi, I am programming in PHP mysql. I have recently got into OOP programming. So I need to serialize my objects and store them to SESSIONS. However I think the huge sessions are slowing down refreshing and loading of my webpages. Is there an alternative approach (than serializing deserializing) so that I can still share my objects from...

Is using "global" user in Drupal dangerous?

I always hear using global variables are dangerous. Does this apply to Drupal? Take a look at the following example: function myFunction($bla) { global $user; if (isAuthenticated($user->uid)) { print $secretCode; } } Can this be hacked? ...

Can echo size of SESSION?

Hi, I dont know if my sessions are too big. Is there a way to see the size of a session. Thanks, Rahul ...

PHP: how to limit the number of session files?

I periodically remove the tmp out of session files. Apparently, I mismanage sessions because of the huge number of sessions. How do you manage your sessions, not their amount becoming too large? How do you make sure you do not make a new session if one exists? Command I have used, not sure how they really work: ob_start (); session_sa...