php

PHP: Fixing encoding issues with database content - removing accents from characters

Hi everyone, I'm trying to make a URL-safe version of a string. In my database I have a value medúlla - I want to turn this into medulla. I've found plenty of functions to do this, but when I retrieve the value from the database it comes back as medúlla. I've tried: Setting the column as utf_8 encoding Setting the table as utf_8 ...

PHP mail() - HTML shows up as an attachment once a file attachment is added

Hello, Had finally gotten all the bugs out of this and now they said "Oh, we'll need to add attachments..." So, this sends an html mail with a plaintext version and was doing just swell. Now that I have the attachments arriving the mail clients are showing the plaintext version inline and the html version as another attachment and the...

Having trouble limiting download size of PHP's cURL function

I'm using PHP's cURL function to read profiles from steampowered.com. The data retrieved is XML, and only the first roughly 1000 bytes are needed. The method I'm using is to add a Range header, which I read on a Stack Overflow answer (curl: How to limit size of GET?). Another method I tried was using the curlopt_range but that didn't wo...

desktop apps running on browser: XAMPP+sqlite+PHP. is it a good idea?

We are about to start to develop relatively small db desktop apps, running on a browser (analogous to a cashier system). We think the app could be distributed with a standalone webserver (XAMPP) + PHP + sqlite. Source code can be encrypted via ionCube. We already have web-apps and we wish to port them to be used locally, almost with t...

Echo 05000 ? PHP

Could some one please Explain why echo 05000 = 2560 ??? i don't get it , i tried to search over the net i didn't find it somewhere Thank you ...

PHP system calls and $PATH in OS X

I'm trying to get PHP to make system calls on OS X. However, it doesn't seem to be able to find anything that's included in the system path. When I run... putenv("PATH={$_SERVER["PATH"]}:/usr/local/bin"); ... just before the system call, it works. This is not a practical solution, since the code that executes the system call is a plug...

Zend Framework store images in Module

I'm creating a weather module for an application that uses weather.com's xml service. With the license from weather.com you get a couple folders of images to use with their xml service. Is there an easy or better way to store the images in the module itself rather than the public folder of the app? ...

php regex get stuff in side comment

<?php $test = "<!--my comment goes here--> Hello World "; echo preg_replace('/\<.*?\>/','',$test); ?> the code above echos hello world i want it to echo my comment goes here ...

Setting a cookie in an AJAX request?

Hi, I'm validating a login form with jQuery AJAX call to PHP. In php, I create a session and if they checked the 'remember me' checkbox, I want to create a cookie. Here's the php code: <?php include '../includes/connection.php'; date_default_timezone_set('GMT'); $name = $_POST['username']; $pass = $_POST['password']; $query = mysql_...

Rijndael 256 Encrypt/decrypt between c# and php?

UPDATED I have made the changes to the C# code so it uses a block size of 256. but now the hello world looks like this http://pastebin.com/5sXhMV11 and I cant figure out what I should use with rtrim() to get ride of the mess at the end. Also when you say the IV should be random, by this do you mean don't use the same IV more then once ...

get full client details in client

Hi, I want to get full details of a client who visits my site. I know I can get his/her ip by $_SERVER but I want to know where exactly his/her ip is reserved by. For example, I want to know which university visited my website. I used http://www.geobytes.com/IpLocator.htm but it just tells city, country and another things but it doesn't ...

How to keep same stylesheets and scripts url for seo friendly and non friendly url's using php

Hello, I am using php to develop an application, i have different set of url's if seo is enabled and different set if seo is disabled. ex: SEO Enabled = hxxp://www.website.com/page/about_us SEO Disabled = hxxp://www.website.com/page.php?about_us Stylesheet url = hxxp://www.website.com/style.css The problem is If seo is disabled i h...

What's a good practice to use forms in PHP? Can you use OOP PHP in a form?

Hello people, Right now i been creating a form for a comment section, a Login section, and sending email for a site i'm doing. The code I using was from a tutorial I learned and has too much HTML in it. It was the only way I knew how to create a form and valid the data. I wanted to ask if there was a better way to create forms and if t...

Why do I get "missing function" error? My function is right there!

Hi! I am getting "Fatal error: Call to undefined function getSContent()" with the included code but... as you can see: My function is right there! Please, help. I am sure I need some sleep. class InfoController extends AppController { var $name = 'Info'; var $helpers = array('Html', 'Session'); var $uses = array(); fu...

Facebook Graph - doesnt work with my cookies

The Facebook Graph is absolutely ridiculous... nothing works ! So I finally managed to get a connect button to show, and it to allow user login.. it would then show their facebook username and profile pic. The idea was that I'd allow users to login using MY sites login, then they can connect with facebook so actions can be displayed on...

Dynamic hide reveal

I'm working on a blog and I have it set up so you can leave a comment on an entry. I don't like how much vertical space all the comments and the entry form use, so I would like to have a link on each entry that you click and it reveals the entry form and comments. I'm thinking a link that's like "Comments (5)". I see this all the time on...

How can I remove all empty values when I explode a string using PHP?

I was wondering how can I remove all empty values when I explode a string using PHP for example, lets say a user enters ",jay,john,,,bill,glenn,,,"? Thanks in advance for the help. Here is part of the code that explodes user submitted values. $tags = explode(",", $_POST['tag']); ...

The browser shows me "???" instead of UTF-8 characters

The browser shows me "???" instead of UTF-8 characters. What is the cause and how can I fix it? Here is the HTML file: <HTML> <title>Search Engine</title> <form action='search.php' method='GET'> <font face='sans-serif' size='5'> <center> My Search Engine.<br> <input ...

Confused by PHP session problem (Rackspace)

My PHP session fluctuates between different values for no apparent reason. here is my test code that proves it: <?php //test.php ini_set('display_errors',1); error_reporting(E_ALL|E_STRICT); session_start(); print_r($_SESSION); ?> When I refresh that test.php, the $_SESSION has different values (about 3 different arrays in total),...

how to check depending on hour base

I have a field that has time and date in following format 2010-03-26 10:06:11 What I need is that if this time is within 4 hours of current time then show but if its over 4 hour then done show this record. thanks ...