php

Link to shipping tracking from website?

When a customer views an order. We show them the carrier and the tracking number. But based on this information is there a way to generate a link directly to the tracking page for that carrier/shipment? Thanks ...

Having difficulty with character encoding on website.

I have a website that allows users from around the world to submit profiles. Somewhere between storing/retrieving/displaying the characters, they are not rendering correctly. I'm not sure which step is having problems, but here is a breakdown of what is happening. When I do a SELECT from my PostgreSQL DB via the psql command line inte...

Remember object state in PHP between requests

I am writing an application and I will have some dictionary values in many different languages. I know I could use GetText, but AFAIR files have to be compiled after editing, and I want to let user edit dictionary, and I can't recompile .mo files on the server. I don't know how many languages will be used, so solution must be elastic. I...

Using CodeIgniter is it bad practice to load a view in a loop.

I just got started with CodeIgniter and am wondering will it slow things down if I put code like this in a loop. $data['title'] = 'the title'; $data['content'] = 'blah blah blah'; $this->load->view('result', $data); I'm not entirely sure how CodeIgniter handles things, or PHP itself for that matter. For example if I did th...

MySQL Query for Matching Items Help

Hello. I'm having a little trouble getting this query to work: $userId = mysql_real_escape_string( $_SESSION['user_id'] ); $userPassProvided = mysql_real_escape_string( $_POST['oldPassword'] ); $query = "SELECT user_id, AES_DECRYPT( user_pass, '".$db_aes_key."' ) AS user_pass "; $query .= "FROM users_tbl WHERE MATCH( user_id, user_pas...

Cannot Edit WordPress Themes - Various Errors

Our WordPress 2.8.6 installation is returning multiple different errors when trying to edit theme files via wp-admin. The errors are as follows: "Invalid index." "The data area passed to a system call is too small" "The parameter is incorrect." We've tried deactivating all plugins to no avail. We also tried creating a blank "plugins"...

HTML Redirect To Original Page.

I have a one page site that has PHP code in it. Once the user presses 'Send', this sends the information to my email, then displays a messagebox saying that the action was a success to the user - great. After the messagebox is closed, the website stays at website.com/report.php. Is there a way to redirect it back to the original page. ...

Check if a string is an email address in PHP

I am trying to do an SQL query, but I need to check somehow if the value is an email address. I need a way to check if $user is an email address, because I have user values such as this in my table. test test2 [email protected] [email protected] test392 [email protected] and so on... I need to make it so $useremail checks $user to find...

Run a PHP script every second using CLI

Hello, I have a dedicated server running Cent OS with a Parallel PLESK panel. I need to run a php script every second, that updates my database. These is no alternative way timewise, i have checked every method, it needs to be updated every second. I can find my script using the url: http://www.mysite.com/phpfile.php?key=123, and this ...

php multiple databases problem

Hi, i've set two database conections as below $con1 = mysql_connect("localhost", "root", "pwd") or die (mysql_error()); $con2 = mysql_connect("localhost", "wordpress", "pwd", true) or die(mysql_error()); mysql_select_db("lab_ancp", $con1) or die(mysql_error()); mysql_select_db("wordpress",$con2) or die(mysql_error()); and it works...

Is there any way to disable image downloads when scraping data using PHP cURL?

I just need text data. I can't find the answer to it anywhere. ...

ffmpeg-php - avi to flv, video length and audio

Hey. I'm trying to convert an .avi file to .flv using ffmpeg-php on a centos 5.4 server. This is my code: exec("ffmpeg -y -i " . $srcFile . " -ab 32 -ar 22050 -b " . $newBitrate . "k -vframes 2500 -qscale 7 -f flv -s " . $newWidth . "x" . $newHeight ." " . $destFile); For some reason the video length in the new .flv file is corrupt ...

how switch register globals off

Hi, my web hosting has the register globals on and I need to turn it off, when using a .htaccess with the following code in the root directory php_flag register_globals off I get the following error Internal Server Error, this is an error with your script, check your error log for more information. any ideas please. ...

Are there any webforum projects for ASP and IIS like there is for PHP and Apache?

I wonder if anything similar exists. If it does, I can't find it. Most webforums are written completely in PHP and are designed to run on Apache these days. Don't start any software argument here please. ...

"ghost" form submissions

I have a 3-part registration form using PHP: page 1 : collects info - has client & server side validation (for blank and invalid fields) page 2 : collect more info - has server side validation (for blank and invalid fields) page 3 : saves (db) and sends (email) the registration information More info: page 1 : saves all form informati...

Create an image of a div?

Hi all, I was wondering if it's possible to create an image of a div inside a page in php, jquery or javascript? Or even just a screenshot of the entire page (on my own server - not external).. What I want to do is create an image of a graph (drawn in via jQuery) and pass it onto a PDF, as I can't seem to get the jQuery to display in th...

PHP,preg_match,Regular Expression. What am I doing wrong?

Here is the pattern that I want to match: <div class="class"> <a href="http://www.example.com/something"&gt; I want to be able to capture this text</a> <span class="ptBrand"> This is what I am doing: $pattern='{<div class="productTitle">[\n]<((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)>([...

as3 - format a timestamp string from mysql

I'm receiving a date field from a php file, and I need to format it. I get this string: "2009-11-12 17:58:13" I want to convert to "November 12, 2009 5:58:13 pm" I tried to work with the Date class, but I get stuff like this: Type Coercion failed: cannot convert "2009-11-12 17:58:13" to Date. Anyone know of any good utilities for doin...

Configuring multiple methods in PHPUnit mock objects

I am trying to create a mock object in PHP and PHPUnit. So far, I have this: $object = $this->getMock('object', array('set_properties', 'get_events'), array(), 'object_test', null); $object ->expects($t...

form validation with javascript vs php

Why should I bother to use JavaScript for form validation when I still have to use PHP since the user could have JavaScript support turned off. Isn't it unnecessary? Update: Ok thanks for your answers. it sounds like a good idea to have it on the client side too. where can I download good JavaScript validations? Do you know where I c...