php

Image caching vs. image processing in PHP and S3

Hi guys! Here is the thing. Right now I have this e-commerce web site where people can send a lot of pictures for their products. All the images are stored at Amazon's S3. When we need a thumbnail or something, I check over S3 if there is one available. If not, I process one and send it to S3 and display it on the browser. Every differe...

php,xml,ups shipping: "Cannot view XML input using XSL..." Where's the bug?

Hey, so I'm deploying a shipping calculator using this function, and I'm getting this error only when I use IE. Firefox does just fine with the shipping calculator. I'm unfamiliar with this error, and google searches tell me that it's a problem with the xml format. Problem is: the XML response from UPS's shipping calculation server shoul...

Drawing pies using PHP ImageMagick

Is there a way to get GD's function imagefilledarc()'s result in using PHP ImageMagick? I've looked around but haven't found a satisfying solution so far. I want it to support transparency, and use it to draw pies. ...

Calling PHP variables from inside a MySQL Database

I'm currently in the middle of working on a CMS system that builds the website straight from information saved in a MySQL database. Here's the problem I'm having: Inside the CMS the user enters coding for a template the frontend of the site (frontend.php) calls the variable where the layout is stored ($template_header) The frontend a...

Whats the easiest way to determine is a user in online? (PHP/MYSQL)

Is there a way I can piggy back sessions to know is the user is online? I.e: use logs on, I set a $_SESSION variable, user times out- cookie Garbage collector updates the database to update their status as offline. EDIT: I want a solution that does not involve times or dates. I want something to ride on sessions or something similar. ...

Compare associative array with standard array values PHP

I have a set of ids and names in an associative array and in my other array I have my list of id's that I want to compare against the first list. I'd like to be able to perform an intersection type search function without losing the names from the associative array. I've though about doing a nested foreach, but it seems like this proce...

PHP AJAX proxy not returning body for POST requests

Hello, I am using this AJAX proxy for cross-domain AJAX requests: http://www.daniweb.com/code/snippet494.html. It works great when I use GET. But when I try to use POST, the body seems to get lost and is never printed out. I tried printing the log and studied the code but I cannot figure out what is going wrong. Thanks, Isaac Waller E...

multiple php installations

I am looking to see what it takes to have multiple installs of php in osx 10.5. I found this page that goes on to explain it for windows. I was looking for confirmation from someone that knows better than me, if the steps are very similar for 10.5. I am a novice user. Having only scripted with php, not actually building or installing ...

What is the best way to get jQuery/Ajax to work with CodeIgniter in this example?

I have a problem trying to get CodeIgniter and jQuery to produce ajax functionality. I have been coding all day, learning jQuery, and generally getting my butt kicked. Let me break down the situation, and hopefully someone will have the courage to help me. I have a trouble ticket system that displays many tickets on a page... each ticke...

Can a SHA-1 hash be purely numeric?

Is there any chance that a SHA-1 hash can be purely numeric, or does the algorithm ensure that there must be at least one alphabetical character? Edit: I'm representing it in base 16, as a string returned by PHP's sha1() function. ...

How do I write Routing Chains for a Subdomain in Zend Framework in a routing INI file?

Hi, I am trying to create a subdomain using the Zend Router, and then for each section under a subdomain, such as subdomain.site.com/section/ I am creating another route and then trying to chain it to the subdomain route. but I don't know how. I have read all the documentation I could find and all the forums, but it leads me to figure i...

How to insert Japanese text into a Postgres table using PHP?

Hi, i am tring to add "翻訳するテキストやWebページ " into a PostgreSQL table, but its shown like this: "& #32763;""& #35379;"&#12377;& #12427;&#12486;& #12461;& #12473;& #12488;& #12420;Web& #12506;& #12540;& #12472; How can I insert that in proper format? <?php $db = pg_connect("host=localhost port=5432 dbname=lang user=password=") or die(":(")...

PHP file storing on webhosting service?

Hi, I was wondering - is it possible to change files that are stored on some sort of webhosting service via PHP? I mean I have a URL say: "plist.atwebpages.com/action.php" will it possible for this method to write a file onto the ftp server on the web hosting service? e.g. http://www.batcave.net ...

PHP: direct call another PHP web applications without going through the usual HTTP call

I have two PHP web applications. All of the apps are located on the same computer. Each application will run independently. Now, can I do a direct API call from one PHP app to another? I don't want to go through either the webservice, or the usual HTTP call that involves HTML response. I want to call app A from app B, using direct metho...

Unix timestamp to days, hours, minutes

So, I have a field in my users table named last_active which updates every time a user reloads a page. It's stored in unix timestamp. I would like to output it like this: Last online: 4 d 18 h 19 m ago How would one do that? Can you do it with php's date()? Thank you. ...

Get multiple values through an AJAX query

Hey guys, I am very new to AJAX and and working on a rating script, but I want to be able to pass multiple values back into my ajax function : Right now it runs a to a php script called ratings, where it takes the total value of votes / votes and multiplies it by the width of each start to get an accurate current rating. What I'd like t...

Sql injection attempt PHP 5.2.6

Using PHP 5.2.6 in XAMPP : I read about sql injections here and tried that with the following login form : <html><body> <form method='post' action='login.php'> <input type='text' name='user'/> <input type='text' name='pass'/> <input type='submit'/> </form> </body></html> and php code : <?php $user = $_P...

building portal / blog like in iwannabemom.com using joomla

Hi, I need some recommendations ... I was asked to built a web portal/blog that looks like http://iwannabemom.com/(they use wordpress) the reason i am using joomla because i have some components that i need to implement on joomla instead of using wordpress. what is the components for (joomla 1.5): 1. top news (can be scrolled). I know...

file put contents with array

Hello, I am using file_put_contents($file, $data); function for putting contents in file, because these files are created on fly with name of sessions, $data is an multi-dimensional array, when i am echoing array it prints out fine but in file no contents get recorded except the word Array What should i do or is there any other functio...

Linux tar command: compressing a directory but exluding subdirectories

Scenario: I have a directory on a server that hosts my website that contains hundreds of user-submitted images. I am creating a backup script that takes all the images from the directory and compresses them into one .tar.gz file. The command I have so far is: tar -czpf /path/to/backups/my_backup.tar.gz path/to/images/ Problem: No inside ...