php

Search Engine way to take .ASP pages to .PHP

I have basic .ASP pages running on a windows box. I want to migrate them over to a Linux host and of course have to convert them to .PHP and keep like Google happy. If my site's fairly popular in the search engines how is the best way to do this? There's a lot out there on the net about this, I just want to make sure I'm going at it t...

How do I update multiple tables using prepared statements with mySQLi?

I have a form with two fields with the name attribute of 'photo_title' and 'photographer_name', and a hidden field named 'photo_id'. When the user pushes the submit button, i want it to update two separate tables in the database. I can get it to update a single table, but as soon as I try to leftjoin the second table, it doesn't like it....

mysqldump.exe in php

i tried the solution of Ngu Soon Hui and it works. how about the mysqldump. i tried using the same solution. $cmd = $mySQLDir1.' -h '.$mydbserver.' --user='.$username.' --password='.$password.' > "'.$file2.'"'; exec('"'.$cmd.'"',$out ,$retval); where $mysqlDire1 = $mySQLDir1='"C:\\Web\\WebServer\\mysql\\bin\\mysqldump.exe"'; $file2 =...

Why is my Update command updating all of the fields that have the same ID?

Using the update command, I want to change the type_name for a specific entry in the database, but it is changing the type_name for all the entries with the same type_id. I need it to only change that individual entry's type_name, and not the type_name that is associated with all the entries with the same type_id. I have an update quer...

How do I grab just the parsed Infobox of a wikipedia article?

Hi guys, I'm still stuck on my problem of trying to parse articles from wikipedia. Actually I wish to parse the infobox section of articles from wikipedia i.e. my application has references to countries and on each country page I would like to be able to show the infobox which is on corresponding wikipedia article of that country. I'm us...

How to get DOCUMENT_ROOT to work on both localhost and web host?

I have a WordPress plugin that I would like to work on localhost as well as in deployment without modification, but I can't seem to set the location for a directory using one statement. I would like to do this: $feed->set_cache_location($_SERVER['DOCUMENT_ROOT'] . '/wp-content/cache'); While that works on the web host. On localhost i...

Is there too much Magic with Rails for a beginner?

Let me start by saying I know that both Ruby and Php are great languages and this is not intended to start a flame war. My question involves learning web development fundamentals and I have heard that Ruby on Rails can allow too much to be done in the background via Magic. I have so far done some learning in both Php and Ruby and while...

DOMPDF problem with Cyrillic characters

I am using the DOMPDF library to create an invoice in PDF. This document can be in French, Russian or English, but I am having trouble printing Russian characters. First, I tried to use UTF-8 encoding and placed the meta tag in the head of the HTML page to be converted: <meta http-equiv="Content-Type" content="text/html; charset=utf...

How to find the non-SEF URL whilst SEF is enabled (Joomla 1.5)?

I know you probably don't get many questions like this... I am working on a component that I want to be able to deal with the non-SEF URLs whilst SEF is enabled, whether it be the built-in SEF or something like sh404sef. Does Joomla store the ORIGINAL non-SEF URL anywhere ie. index.php?com=com_fred&view=homepage? I've found that any ...

move_uploaded_file hangs?

I seem to have a bizarre error I just can't quite figure out. My website was working on one server, but when I transferred it to a new one it stopped working. I believe I've narrowed the error down to this line of code: $ret = move_uploaded_file($tmp_name, $orig_path); This is executed through an AJAX call so it's a little bit tricky ...

How to make the thumbnail go to /tmp/thumb/ and keep the original image on /tmp/ with Image Resizer ?

I'm trying to play with image resizer and I got the following code if (is_uploaded_file(@$_FILES['ulimage']['tmp_name'])){ $targetfilename = ImageHelper::treatFilename(uniqid() . "_" . $_FILES['ulimage']['name']); move_uploaded_file($_FILES['ulimage']['tmp_name'], dirname(__FILE__) . "/tmp/" . $_FILES['ulimage']['name']); ...

Building quicksort with php

I recently read about quicksort and was woudering whether it would be smart to build my own function to sort things with quicksort or if it would be inefficent. What do you think is the built in sort function better than a selfbuilt quicksort function? ...

Encoding problems in PHP / MySQL

EDIT: After feedback from my original post, I've change the text to clarify my problem. I have the following query (pseudo code): $conn = mysql_connect('localhost', 'mysql_user', 'mysql_password'); mysql_query("SET NAMES 'utf8'; COLLATE='utf8_danish_ci';"); mysql_query("SELECT id FROM myTable WHERE name = 'Fióre`s måløye'", $conn); ...

PHP: intval() equivalent for numbers >= 2147483647

Hello! In PHP 5, I use intval() whenever I get numbers as an input. This way, I want to ensure that I get no strings or floating numbers. My input numbers should all be in whole numbers. But when I get numbers >= 2147483647, the signed integer limit is crossed. What can I do to have an intval() equivalent for numbers in all sizes? Her...

Generating ZIP files with PHP + Apache on-the-fly in high speed?

To quote some famous words: “Programmers… often take refuge in an understandable, but disastrous, inclination towards complexity and ingenuity in their work. Forbidden to design anything larger than a program, they respond by making that program intricate enough to challenge their professional skill.” While solving some mundane pro...

How do you track files in SMB with an application?

I have built an application with PHP which shows all the files in the home directory of a user this directory is also available via samba so you can access it from the native explorer in windows, mac and linux. I wanted to give every file an ID so that I can asign tags to every file how would you go about doing this? Would you make hashs...

Why when printing GBP symbol using Zend_Currency I get an accented A returned??

Hi, I have a a strange problem that I can't seem to identify the cause of. When I use Zend_Currency to format a value to to GBP I get an accented A before the £ symbol. If ask it to return any other curreny such as USD the accented A disappears. The code that is generating this is: $currency = new Zend_Currency('en_GB'); $amount = $...

Zend_Validate_Between strange error message

I am experimenting with the Zend_Validate_Between class. I set it up thusly: $scoreBetweenValidator = new Zend_Validate_Between(-3, 3, true); so the validator should only accept values between -3 and 3, inclusive. On an invalid value I got a '%value%' was not found in the haystack error message, which I think belongs to the Zend_Val...

Only allowing selection of one radio button in a form with PHP

A very basic question... How can I only allow the selection of one option in a list of radio buttons? <form action="process_repair.php" method="POST"> <label for "repair_complete">Repair complete</label> <input type="radio" name="Yes" value="true"> <input type="radio" name="No" value="false"> </form> When this code runs, it's po...

PHP Object return value

Hi, Currently I'm programming a database class which makes a little bit use of PHP's PDO class, but I'd like to add some simple features for making programming a certain application a bit easier. Now In the following piece of pseudo code you can see where I'm going. The only problem in this example is that the $result variable is an ob...