php

Fedora Server Allow download link to PDF files

Hi, I have a website hosted on Fedora and I need my users to beable to download PDF files, is there any mod_rewrtie I can use to only allow PDF's to be downloaded, at the moment it just goes to 404 page. Cheers J ...

How to save friendly urls in my browser history?

Hi all I use friendly urls in my site, But my browser does'nt save all urls in the history browser??? this is my .htaccess: Options +FollowSymLinks RewriteEngine on RewriteRule category/(.*)\.html index.php?inid=3&id=$1&%{QUERY_STRING} RewriteRule products/(.*)\.html index.php?inid=4&id=$1&%{QUERY_STRING} ...

beginner to regex needs to change url using regular expressions

i have a url: /events/details/16-righteous-turkeys.html that i need to change to /turkeys i have no idea how to go about doing this...and would really appreciate the help. ...

Sphinx. Set of queries. PHP API

Hello. With little sign of the Sphinx. I have 5 pages. At one should look at the entire base. This is done next. config: source logs { type = mysql sql_host = localhost sql_user = root sql_pass = sql_db = bot sql_port = 3306 sql_query_pre = SET NAMES utf8 sql_query = SELECT * FROM logs sql_attr_uint = host s...

Send HTML Texarea content to XML File

I'm wanting to use an XML file to show some messages in a flash application. I'm wanting to populate this XML file using a simple HTML form with a textarea and when a user submits the content it will post it to the XML file. The XML file looks like this: <messages> <msg>This is a sample message</msg> </messages> I'm presuming this req...

EOD not ending?

<?php // Page class class Page { // Declare a class member variable var $page; var $title; var $year; var $copyright; // The Constructor function function Page($title, $year, $copyright){ // Assign values to member variables $this->page = ''; $this->title = $title; $this->year = $year; $this->copyright = $copyright; // Call the ad...

SQLite, PDO, and PHP: New inserts not being saved

I have a few PHP (version 5.1.6) scripts and an sqlite3 database. For a while, everything was working fine, including inserts, updates, selects, and deletes. Now: Select statements still work fine Inserts, deletes, and updates all fail without an error that I can see. A -journal file is created in the same directory as the database, ...

Filter query_posts by two custom fields?

I'm trying to filter my posts to only show the ones with that have a custom value for the field "Model" while sorting the posts by another custom field called "Price." Here's the function I'm using (not working): <?php global $query_string; query_posts( $query_string . "&meta_value=Model&orderby=meta_value&meta_key=Price&order=ASC");...

php/mysql help needed no error being outputed

can some assist me with my code, everything looks correct checked each line at least 10 times. I've even hardcode in the user/pass for the query and still nothing. <?php include "database.php"; $sql = "SELECT UserName, Password, Language, Editor FROM admin_login WHERE UserName='".$_POST['username']."' AND Password='".$_POST['pwd']."'";...

sqlite journal file location

Curently sqlite is writing journal file in the same directory where is placed database file. It makes a problem with the directory permission (it has to be writable). Is there any method to force sqlite to write journal files in other directory? ...

Problem data truncated in mysql-PHP

I have this problem: Warning: #1265 Data truncated for column I got a form with a value coming from a text field : price. When I put a decimal like : 45,56 ( French format) My MySQL column type is a float. Could someone help please ? ...

Alternative to file_get_contents?

$xml_file = file_get_contents(SITE_PATH . 'cms/data.php'); The problem is that a server has URL file-access disabled. I cannot enable it, its a hosting thing. So the question is this. The data.php file generates xml code. How can I execute this and get the xml data without doing the above method? Is it possible? ...

PHP mail() contact form not delivering to Gmail - advice needed

I'm using a PHP contact form and it is sending mail to non gmail addresses, however when I set it to send to a gmail address, it doesn't get delivered (it doesn't even appear in junk mail). I've heard of issues like this before - I'm not a web developer/expert so can anybody suggest code/configuration changes to my PHP contact form belo...

PHP/MySQL show last updated/most recent date

Hi, I have a mysql query that brings in a list of results, say 10, each with its own 'last edited' date, and was wondering if it was possible to display/echo/print ONLY the most recent of these dates using php? Now I know I could do this with a mysql query, but I need to display all of the available results, but only 1 date, (the most ...

How to check if a string can be used as a variable name in PHP?

In PHP one can use variable variables... For example... class obj { } $fieldName = "Surname"; $object = new obj(); $object->Name = "John"; $object->$fieldName = "Doe"; echo "{$object->Name} {$object->Surname}"; // This echoes "John Doe". However, $fieldName string may contain some characters not allowed in variable names. PHP will s...

Zend application and bootstrap as non mvc

Is it possible to use zend_application and zend_bootstrap as non mvc? I'd like to use them but without the zend_view. ...

Multiple HTTP GET parameters with the same identifier

Let's say I am getting requests such as: http://www.example.com/index.php?id=123&amp;version=3&amp;id=234&amp;version=4 Is it possible to extract these in a simple way inside my php code? I realize I could get the entire querystring with javascript using window.location.href and handle it manually but I'm looking for something more ele...

php with oracle on IIS ...

yep, it sounds like an unholy alliance but I need to configure how to do it... for starters I have on my PC installed Oracles PL/SQL environment, with latest client (11g, I think) ... I can work in theirs IDE w/o any problems. I even can code desktop apps with C# and Oracle connector (etc.) Now, from MS site I can click on that Web Inst...

setting smtp server in php geekmail

http://github.com/NeilCrosby/multi-level-vcards/blob/master/via-email/geekMail-1.0.php That's a link to the class. How can I set the smtp server? My current code looks like: require_once( 'assetform/geekMail-1.0.php' ); $geekMail = new geekMail(); $geekMail->setMailType('html'); $geekMail->from('[email protected]', 'no-reply'); $geekMail->...

Variables from URL are loaded in random order

I'm have an issue loading URL variables into Flash where the variables are loading in random order each time the SWF is loaded. The way the variables are: var1=value1&var2=value2&var3=value3 but because it's loaded in a random order, the first variable will sometimes get omitted because of the way the & are placed. Here's the AS I'm...