php

Force "implied AND" instead of "implied OR" in mysql boolean match?

In mysql boolean match, if no operators are present, OR is implied. If you want AND, you need to add + to each keywords. So query "word1 word2" is equal to "word1 OR word2", "+word1 +word2" is equal to "word1 AND word2" I don't want users to have to enter + before each keyword, what are my options? Suggested option 1: Is there some...

Nearest thing to PyParsing in PHP

I'm looking for a PHP library that provides similar functionality to PyParsing, a simple but powerful parsing engine for Python. Does anyone have a suggestion? I want create a wiki-syntax parsing and a search expression parsing without re-inventing the wheel... Thanks ...

XSLT 2.0 PHP support. When?

What are the chances to see XSLT 2.0 processors like saxon for php in the nearest future? ...

How to create a snapshot or clone of PHP, MySQL page... Inspiration needed

Hi, We have a web application that creates a dynamic PHP page with all the MySQL stored details a user has entered via a number a forms. So far so good, but we want this information stored some how to be refereed to at a later date, as an administrator can make changes to the data, which reflects on calculations that are worked out fro...

only image uploading and displaying that from database

Hi frnds really i dont know how to vote today i came to know,dont neglate my que thinking i have not accept...i am begginer to development i want to upload only image to database and that i need to fetch and display..i should fetch directly image and display can anyone please help me out thank in advace ...

Setting a custom system date on the fly for PHP script

Hi, We have a script that needs to function between two dates, so to test the script we need to change the UNIX system date to simulate the date conditions. PROBLEM: The problem is we have other systems running on the same server so we can't just change the UNIX system date. QUESTION: Is there a way to set the system date on the fly w...

Using post array from paypal

I am using paypal to process payments on my site. Paypal returns the post array like [item_number1] =12 [item_name1] = My product name [quantity1] =3 [item_number2] =14 [item_name2] = My product name2 [quantity2] =5 [num_cart_items] 2 Insert step here now im just going in circles getting nowhere And then run the for loop for($i = 1;...

why MD5 collision failed?

The two data blocks are from this site,but failed to produce the collision : var_dump(md5('d131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab4004583eb8fb7f8955ad340609f4b30283e488832571415a085125e8f7cdc99fd91dbdf280373c5bd8823e3156348f5bae6dacd436c919c6dd53e2b487da03fd02396306d248cda0e99f33420f577ee8ce54b67080a80d1ec69821bcb6a8839396f9652...

php regex too strict

Just wondering why this is too strict, I can send very simplified emails to say [email protected] or [email protected] but if I make the email any longer ([email protected]) it does not get sent. Instead it echos back my error message:Invalid Email Address Supplied // Create a function to check email function checkEmail($email) { // A...

undefined offset when using php explode()

I've written what I thought was a very simple use of the php explode() function to split a name into forename and surname: // split name into first and last $split = explode(' ', $fullname, 2); $first = $split[0]; $last = $split[1]; However, this is throwing up a php error with the message "Undefined offset: 1". The function still see...

Possible to add value to an existing cookie in PHP ?

I have a classifieds site, and on the main page I want the last visited ads by the existing user to show up. How would I do this? Basically, it has to be something like this: User clicks on an ad. The ad ID gets saved in a cookie. Then, when clicking on another ad, that ad ID gets saved also. Then, whenever visiting the main page, th...

How was a URL like http://stackoverflow.com/posts/1807421/edit created in PHP?

When you edit a question on stackoverflow.com, you will be redirected to a URL like this: http://stackoverflow.com/posts/1807421/edit But usually, it should be http://stackoverflow.com/posts/1807491/edit.php or http://stackoverflow.com/posts/edit.php?id=1807491 How was http://stackoverflow.com/posts/1807421/edit ...

Where does pg_lo_write store its contents?

There is a function in our system that writes a file to a postgres BLOB, the function is pg_lo_write, our system uses PHP, ADODB and PostgreSQL. What I would like to know is where is this data stored, is it a file in a postgres directory, in a table? Many thanks! Answer Information Thanks to Ben Fransen for the answer, the BLOB is in...

How to access php variables in Javascipt or Jquery rather than <?php echo $variable ?>

How to access PHP varibles in Javascript or Jquery? Do I have to write <?php echo $variable1 ?> <?php echo $variable2 ?> <?php echo $variable3 ?> ... <?php echo $variablen ?> I know I can store some variables in cookies,and access these values via cookies, but values in cookies are relatively stable values, moreover, there is a limit...

PHP Driver: If I KIll a PHP process will it also kill SQL Server Process (query)?

Hello all, I am using PHP SQL Server driver - is there a way to kill the last query sent by sqlsrv_query function? If not, if I kill the PHP process will it also kill the query in turn? I appreciate any help. ...

resending information problem

hi! i've a search bar from where users can search for videos.. after the search, the user goes on to click and watch a video(from the search result)..when the user hits the browser's back button it displays the following To display this page, Firefox must send information that will repeat any action (such as a search or order c...

php - transfer $_SESSION var's to local var's?

What is best practice with regards to using session variables? Is it best to just refer to them as session variables or is it better at the beginning of the script to transfer them to local variables of the same name? I am also a little stumpped on the best folder/file structure for my application if anyone has a useful link with regar...

printing a UL from an array of images

I am trying to print a UL list of images ending with _th.jpg returned from a specific folder. All i get back is array() <?php require '../../config.php'; $conn = new PDO(DB_DSN, DB_USER, DB_PASS); $id = (int)$_GET['id']; $q = $conn->query("SELECT * FROM cms_page WHERE id=$id"); $project = $q->fetch(PDO::FETCH_ASSOC); $q->closeCursor(...

What is .tpl files? php, web design

Hi guys! A man wants me to redesign a site run in PHP (VideoCMS). But when I asked him to send me the source he has given me *.tpl files instead of *.php. There is some code inside them: {include file='header.tpl' p="article"} <br /> <table width="886" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="150" valign="top...

How to ensure that a file handle is closed if a php script times out?

Hi Guys, I have a caching system build within php that stores the results of a mysql query in xml. I lock the cache when building by creating a lock file with an exclusive write handle, and then remove it once the cache file is completed. However, there are times when the script either times out or halts mid execution, leaving the loc...