php

Search Engine Friendly POST in php and MySql

i have one blog where users come and post their views. i store all information in mysql Data Base, when i use following syntax to retrieve information Datasbe using PHP viewpost.php?pid=12 but after Google many tips for SEO, i found that this syntax is not good, i need to change it to some other way which is readable to search engine....

Finding bytes in strings with PHP's mbstring.func_overload on

I have PHP configured with mbstring.func_overload = 7, so all the single-byte-string functions are mapped to their multi-byte equivalents. But I still sometimes need to treat strings as byte arrays; for example, when calculating their size or doing encryption. What's the best approach here? Can I just use the multi-byte functions and pa...

PHP/MySQL Timezone Clarification

Hello all, I'm currently having an issue wrapping my brain around the notion of converting my MySQL time to a specific timezone, depending on the user's settings. All of my MySQL times are stored in UTC time, in the following format: 2009-11-08 17:06:40 Once I query the time, I'm not quite sure how to convert it to the appropriate...

simplexml + foreach +twitter with unexpected results

Im using the following code to output all the nodes from the xml shown. $cursor = "?cursor=-1" $xml= new SimpleXmlElement($to->OAuthRequest('http://twitter.com/statuses/followers.xml?$cursor')); foreach ($xml->xpath('/users_list/users/user') as $user) { $id = $user->id; $names .= $user->screen_name; $profimg = $...

How did PHP 5.3 break your application?

PHP 5.3 has been released some time ago and the developers tried to keep the number of backwards compatibility breaks low. What issues did you find while testing/migrating your code with PHP 5.3? ...

Prevent controller from trying to autoload model

I am a beginning Cake user and trying to do some work on an already existing application. Running into a problem when I create a new controller. I have created StoreController and when I try to call methods inside it I get the error below. There is no table 'stores', but it seems like it's trying to automatically load a model relating to...

How to get unselected checkbox?

Hello! I have three checkboxes like ch[0], ch[1] and ch[3] (sometimes i have more, or less, it's dinamic) and in PHP i want to get the unselected items also, like this: 0=yes,1=no,3=yes and so on. Can I solve this somehow? ...

Checking if a domain name is registered

How would I go about checking if a domain name is registered? I was thinking about checking if it has a corresponding IP but it doesn't seem to work as well as I had hoped. Is there a solution in either PHP or Python that can check? ...

check for error

I have my own AppCotroller and using the beforeRender method to make changes to $this->viewPath based on the desired output format. Is there a way I can check if Cake is currently outputting an error message? If I change the viewPath and then it's displaying an error (like can't load model, etc) it will error on the error :) ...

Alternating Colors in UL in php Joomla mod_feed

I am using Joomla 1.5 for my site and want to make the RSS Feed Module (mod_feed) display alternating rows in a different color, hoping somebody here can help out! Here is the main code for the module layout (I removed the top <div style="direction: <?php echo $rssrtl ? 'rtl' :'ltr'; ?>; text-align: <?php echo $rssrtl ? 'right' :'left'...

When automatically updating WordPress, how does it grab files from another server and store them on my server?

When I automatically update WordPress, how does it grab files from another server and store them on my server? It doesn't have ftp access rights. Does anyone know? ...

MD5 implementation in PHP - where am I going wrong?

I know that this might be a long stretch, but could someone possibly tell me where my current implementation of the MD5 algorithm in PHP is going wrong? I just can't seem to work out what's wrong with it. It returns a 32 character hex string (25% of the time it produces a string less than 32 characters though), but it isn't producing th...

PHP Calendar - How to make it send an email notification for new events?

I'm using http://phpcodeworks.com/pec/index for a nice User Generated Calendar but it doesn't have the function of sending an email to me when someone posts an event. I'd really like this feature and I really like this calendar. It's all open source, so you'll be able to play with the code and look at it all. ...

change the absolute position from left to right on a span tag depending on class.

Hi. This is my first question here but I'm sure there are many more to come. I have a small position problem that I would like to know if it's even possible to achieve. I have an unordered list (<ul>) with floated <li>s, for the main options i float these left, and for the contact and support options I float them right, so far so good....

Which popular rapid web development frameworks follow the "Rails paradigm"?

I'm trying to compile a list of notable web frameworks in wide use that follow the "Rails paradigm", which in the context of this question is defined as web frameworks following these key principles: Convention over Configuration (CoC) Don't Repeat Yourself (DRY) Sensible defaults Easy scaffolding: automatic generation of CRUD interfac...

Suggestions for gateway please

I almost completed my first shopping cart with Codeigniter(PHP/MySQL). I want to connect to payment systems. I've never developed a shopping cart before. I do not have any intention to develop my own gateway and I don't have any knowledge and skills to do it. Could anyone give me suggestions about the best way to connect my shopping ca...

can php return a boolean? => return $aantal == 0;

hi very short question can php return a boolean like this: return $aantal == 0; like in java you can public boolean test(int i) { return i==0; } or do you Have to use a if contruction? because if i do this. $foutLoos = checkFoutloos($aantal); function checkFoutloos($aantal) { return $aantal == 0; } echo "foutLoos = $foutLoo...

Flash socket server only works on local machine

Hi, I have created a basic flash socket server in PHP, it all works fine on my local machine (both in the browser and in the flash sandbox) but as soon as I get another machine to connect to my computer's Site directory, they can't get a connection open to the server! In flash: mySocket.connect("localhost",9999); In PHP $address = '...

Cannot instantiate a PDO object in PHP MVC framework

Hello, Can anyone help me with this? I have this function in a singleton class. The error it is giving me back is that it cannot find the class. First I thought it had something to do with the autoloader, but I did spl_autoload_unregister('libloader') and it still gives the same error? The host is running php 5. public static functi...

Adding Up Values From A SQL Query

I have a table like this (using wordpress) +---------+----------+------------+ | meta_id | meta_key | meta_value | +---------+----------+------------+ | 1 | views | 3 | | 2 | blahh | a value | | 3 | smthn | boo | | 4 | views | 4 | | 5 | views | 5 | | 6 ...