php

How to display after 4 week date from now?I want to pass an argument.

echo date( "F jS, Y" , strtotime("now +3 weeks") ); It gives the result as July 2nd, 2010 . Fine.Now I want to pass the argument like this. The original print_r($originalamount) give the result like this Array ( [0] => 4 Months [1] => 3500 ) My code $text=trim($originalamount[0]); $text1="now +".$text; echo date...

Update MySQl table onDrop?

Hi all. I am writing a PHP/MySQL application (using CodeIgniter) that uses some jQuery functionality for dragging table rows. I have a table in which the user can drag rows to the desired order (kind of a queue for which I need to preserve the rank of each row). I've been trying to figure out how to (and whether I should) update the data...

Add data in bulk.

Hi all, I need your suggestion for this. I need to add data to mysql database through the admin interface, at initial i need to add data in bulk, so i thought of using csv upload but how to add images with csv i.e. when doing single add i insert name , description and a image via a form, but how to do the same for bulk. Thanks in adva...

PHP: File exists and is in a certain sub-directory

I get a file path to a user file and I want to make sure that this path is to a valid existing user file and not to something bogus or a system file or something like that. I know I can use file_exists to check that it exists, but I'm not sure how I should make sure that the file is in a certain sub-directory... ...

How to write mod_security friendly PHP code?

Hello people, I made a theme in WordPress which hit the mod_security rule on HostGator and gave 403 error. I contacted people there(at HostGator) and they fixed it for me. But I don't want my theme to work like this. I just wanted to know if there are any guides/blog post/tutorials telling about writing PHP code which is mod_security ...

Expand my knowledge in DB programming

Hi there, my name is Tal, Im working on a PHP Application the should have lots and lots of records, what DB should I use, and are there guides on the web that explains how to build efficient dbs and tables? Tnx! ...

PHP - not sure how to ask - regarding variables and $_POST

I have a PHP form. The form works but I'm trying to test to see if a value other than the first item has been selected. I can't figure out how to write the If statement. $products = array( '' => 1, 'Item 2' => 2, 'Item 3' => 3, 'Item 4' => 4, 'Item 5' => 5, 'Item 6' => 6 ); $html = generateSelect('products', $products); function...

how i can make a sort system depend on Character

i mean i have songs table ok?? i want to make some things like that a | b | c | d click on a select from the database the songs that start by a Character how i can do that by the mysql??? ...

How to create a search system in Website using PHP?

Hi, I am pretty new to web development and I want to create a search system on my webpage, but I dont have any idea how to? This search system must be able to search everything that is displayed on the webpage. Please help me. ...

Zip multiple database PDF blob files

I have a database table that contains numerous PDF blob files. I am attempting to combine all of the files into a single ZIP file that I can download and then print. Please help! <?php include '../config.php'; include '../connect.php'; $session = $_GET['session']; $query = "SELECT $tbl_uploads.username, $tbl_uploads...

Ajax call file or files

I have a module setup that uses ajax calls, should I have one file for all my ajax calls or should all the calls have their own file? Example of what I mean: index.php ------ With the ajax calls Should I have one file such as 'ajax.php' that has functions for update, delete, and edit. Or should I have update.php, delete.php, and edit....

How to find out how many times a file been downloaded?

I have an image that send to affiliate for advertising. so, how can I find it out from my server the number of times that image been downloaded? does server log keep track of image upload count? ---- Addition ---- Thanks for the reply.. few more questions because I want to do ads rotation, and tracking IP address, etc. so, i think I ...

Get the final key of an array in PHP

I have a standard associative array in PHP. what's the simplest way to get the last key in that array? example: $foo = array('key1' => 'val1', 'key2' => 'val2', 'key3' => 'val3'); and i would like to get 'key3'; ...

Ajax / PHP communication

Hey Im trying to make my ajax chat slightly more effective by only loading the chat script when an update occurs thus it doesn't need to keep loading it if nothing has changed in the database. So i was wondering if you could help explain how to do this. Currently my logic has: JS function to get chat logs setinterval calls the functi...

Making a Login Work After Cache, Cookies, etc. Have Been Cleared

Hello, I am using the code below for a user login. The first I try to login after cache / cookies, etc. have been cleared, the browser refreshes and the user name is not logged in. After that, logging in works fine. Any idea how I can make it work the first time? Thanks in advance, John index.php: <?php if($_SERV...

Facebook oAuth needs secret key?

Facebook oAuth requires your secret key? I thought you weren't supposed to share that. Am I using the wrong secret key? ...

Using nodereference + views to create combined view

I'm trying to set up a relational View but not sure how to do it. Here's an example of what I'm going for using the node types Artist and Song. Artist Song Length Bob Dylan Like a Rolling Stone 2:00 Bruce Springsteen Atlantic City 4:00 Burce Springsteen Born to Run ...

MySQL PHP | "SELECT FROM table" using "alphanumeric"-UUID. Speed vs. Indexed Integer / Indexed Char

At the moment, I select rows from 'table01 and table02' using: SELECT t1.*,t2.* FROM table01 AS t1 INNER JOIN table02 AS t2 ON (t1.ID = t2.t1ID) WHERE t1.UUID = 'whatever'; The UUID column is a unique index, type: char(15), with alphanumeric input. I know this isn't the fastest way to select data from the database, but the UUID is ...

are there any ajax for php like zk or vaadin for java

are there any frameworks for php that follow the style of vaadin, in vaadin you can define web forms using java with touching javascript or any client scripting in swing style ? ...

overwrite the search function in wordpress (sql and php)

Is there a way to overwrite the default search function in wordpress? I have tried using the filters, but they only allow adding to the query... or possibly rewriting the whole query using posts_request. If I overwrite that though, no other querys will work. I have the following code function my_posts_request_filter($input) { if ( i...