php

What's the technical reason why class constants can't be arrays in PHP?

Anybody knows the technical reason why this constraint is placed on PHP classes (at least in v5.1x)? ...

how to send data in url in a different way then by using get method

I want to my adress look like this: www.example.com/112112/example Where 112112 is a data, that I want to work with in a php script. How to do this? For some reasons, I dont want to the adress look like www.example.com?id=112112 ...

Invalid Form Submissions-- what to do with them?

I've been doing a lot of reading lately about best practices when it comes to Web App design. My language of expertise is PHP/MySQL. When creating an MVC architecture for an application I'm developing, I always come across the problem of where to store invalid form submissions (so that the user doesn't have to re-enter the data, and help...

Using Wordpress, can some one tell me the best way of sanitizing input?

Hi, I'm developing an application using Wordpress as a CMS. I have a form with a lot of input fields which needs to be sanitized before stored in the database. I want to prevent SQL injection, having javascript and PHP code injected and other harmful code. Currently I'm using my own methods to sanitize data, but I feel that it might b...

when i successfully login a extra function.session-start is displaying and how to check session for sign-in-action page..plz tell me aabout this

I have a sign-in-action-form page which accept username and password from sign-in-form.Now most of things are working fine like on sign-out if i press back button logout display and session is destroyed..But i am facing a very starnge problem..When i login and if login is successfull a link function.session-start is shown on this page.I ...

PHP magic_quotes_gpc vulnerability

I've been assigned to one of my company's legacy webapps, and after a day or two of poking around the source, I've found an SQL injection vector similar to the following: mysql_query("SELECT * FROM foo WHERE bar='" . $_GET['baz'] . "'"); I've tried to perform an SQL injection test against this, but it fails, due to PHP's magic_quotes_...

Some images only showing alt text in Firefox but load fine in Safari or Chrome yet other images on the same page load fine

I'm making a simple website for myself using wordpress and some hacking to try and teach myself a little about web coding for fun. I've set up my website and http://jonhocking.co.uk and I'm using a series of 4 squares on the front page to navigate around the site. Three of these link to categories and these images display perfectly fine....

utf-8 problem in using jquery autocomplete tags

hey mates . recently i used jquery auto-complete tag http://devthought.com/projects/jquery/textboxlist/ everything goes fine except utf-8 tag suggesting , only English tags are suggested i guess something goes wrong with script lines it works fine with English tags but not with multi byte languages like Persian ...

What's the standard way to generate a url like stuff?

$arr = array('key1'=>'val1','key2'=>'val2'); $str = ''; foreach($arr as $k=>$v) { $str .= '&' . $k . '=' . urlencode($v); } echo substr($str,1); Or $arr = array('key1'=>'val1','key2'=>'val2'); $str = ''; foreach($arr as $k=>$v) { $str .= '&' . urlencode($k) . '=' . urlencode($v); } echo substr($str,1); Does the $k need to be...

Autoloading modularity/widgets in PHP, CodeIgniter/Kohana

Hello, I was looking on many template libraries, som I have fair mess in general idea what is out there ready to download/use and what I want to use, so maybe you could help me with this. I'm currently learning CodeIgniter, thinking about moving to Kohana later. I would like to include controllers/modules(/module function maybe?) based...

What's the term for calling a function this way?

unset $arr[$key]; Shouldn't it be : unset($query[$key]); ...

Double Not (!!) Operator in PHP

Hi guys, does anybody know what the double not operator does in PHP ex: return !! $row; What would the code above do? Thanks ...

htaccess mod_rewrite:- products.php?cat=1 to /myfolder1/myproduct1/

I've got a url type:- http://www.example.com/products.php?cat=1 which I am able to rewrite to:- http://www.example.com/myproduct1 using the following .htaccess rule:- RewriteRule ^myproduct1$ products.php?cat=1. What rule would I need to enter if I wanted to rewrite to:- http://www.example.com/myfolder1/myproduct1/? ...

search&replace array key using PHP and CakePHP Set Class

hi, i need to write function that searches & replaces key in multi-dimensional array in following manner: input array: [0] => Array ( [Foo] => sometext [Foo2] => Array ( [lorem] => 1 [Avatar2] => Array ( [meta_key] => avatar2 [...

support new facebook API instead of $facebook->api_client->profile_setFBML($profileContent);

Hi, I looked at Facebook page, and they not supported with the PHP Api: $facebook->api_client->profile_setFBML($profileContent); can anyone help me with another possible API to use. Thanks ...

What's your all-in-one web resource optimizer?

I'm working with SmartOptimizer: minify js and css, use css data uris, add far expire headers and other features. (http://farhadi.ir/works/smartoptimizer) It works fine, but i don't know if exists a similiar application with similar or best tools (like Google Closure, CSScaffold,..) If you're not sure witch is better, what's your favour...

no value from $_POST

No value is sent to $_POST['addEdit'] variable :(, pls help HTML code: <form name='frm' method='POST' action=''> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr class="heading"> <td style="width:5px;"><input type="checkbox" name='check_all' onClick='checkAll();' /></td> <td class="head">App Name</td> . . <?php //som...

how to run php scripts without using php extension in an adress

As in title. I want to run example.com/bar.php by using example.com/bar as adress, but it doesn't wrong. How to set it? ...

creating & Inserting image thumbnail in oracle through php

Will some one please help me with the code of creating & Inserting image thumbnail in oracle through php. ...

Serious help needed - client's website, which I have spent hours and hours on, completely fails...

Hello y'all. I'm a bit miffed. Actually, a bit more than that, but never mind. The problem revolves around a jQuery gallery called 'Galleria'. You may have heard of it. It's quite aesthetically pleasing and since my client is a Photographer, I thought I'd display all of his images in a Galleria gallery. You can see the site, in it's t...