php

How to display category link layout question?

I was wondering how would I be able to display my categories in steps 2 - 4 when I click a link so that all the parent and sub categories are displayed like in steps 2 - 4? All my parent and sub categoris should take me to another page. I genereate all my links using PHP. I use PHP, CSS, xHTML and JQuery. Step 1 Arts & Humanities A...

How do I create a product attribute out of my custom module in Magento?

How do I create a product attribute out of my custom module in Magento? I'm working on a "record store" in magento and I've created an "artists module" to store artist information. Now I want to have an "Artist" dropdown attribute for the catalog items that is fed from this module. I understand how to create custom attributes in the m...

change date into words in php

I have an array of dates which are in the format 20100808 (YYYYMMD). How can i change this into August 08 2010? I am using php. I cannot change the date array format. It will be in 20100808 only. ...

Getting id from pretty url as an intval

Alright, I have my urls set up to rewrite "news_item.php?id=1" to "blog/1/Title-of-post". This works great apart from when a title has numbers at the start for example "blog/23/12-days-to-go" it can't find the right id. Here's how I have it setup, maybe someone can make sense of it. Rewrite rules RewriteRule ^blog/([0-9]+)/([a-z-]+)/...

So Many Frameworks use Server Side Form and Javascript Processing ?

Symfony .NET Framework Zend Framework and all other Frameworks have various View Helpers to process Forms and Javascript on the Server and Server spits out HTML and then it comes to Browser. Doesnt this make things Slow and puts unecessary burden on Server when We have the CLient Computer to handle all Rendering. Things can become fast a...

variable is not set & form submission error question

Having a little bit of trouble with this section of code: if(!empty($_POST['RemoveRequest']) && isset($_POST['RemoveRequest'])){ $action = $_POST['RemoveRequest']; } echo '<form method="post" action="'.$page_name.'"> <input type="submit" value="[Remove Request]" name="RemoveRequest" /></form></td>' .'</tr></table>'; if($action == 'Rem...

median and max for an array in php

I am trying to set lower limit and upper limit for an array. The lower limit is always constant, which is 0 but i want the upper limit to be varying based on the array values. some times the array values are 1,2,3,4,5 and sometimes the array values are 100,200,300,400,500 and sometimes in thousands as well. So i do not want to set a co...

Javascript seems to be altering form field style

Hello, The form with the class="checkMax3" below displays text a few pixels lower than it should. In Chrome, letters like lower-case "p" and "q" extend below the bottom of the field. In IE 8, the bottom portion of these same letters does not display. If I recall correctly, this problem started after I applied the Javascript below to ...

Redirect to a sub folder using .htaccess

I moved a website over to a sub folder and I added a htaccess file to the root of the site. For some reason it is not redirecting to the subfolder. below is my code Options +FollowSymLinks # # mod_rewrite in use RewriteEngine on RewriteBase /public_html/corp/ i also tried Options +FollowSymLinks # # mod_rewrite in use Rewrit...

Creating Javascript function called from PHP

I have a piece of Javascript that invokes a social publishing widget overlay. When you load the page the overlay will popup and this is the script that calls it: <script type="text/javascript"> RPXNOW.loadAndRun(['Social'], function () { var activity = new RPXNOW.Social.Activity( "Share your comment", "commented on '...

PHP include chain not working

Here's the folder structure of my project: /ping --/Controller ----Ping_Conntroller_Main.php ----Ping_Conntroller_Db.php --/Model ----dbCredentials.php --/View ----output.html.php 'ping' is the folder that contains my project and it sits inside the 'xampp/htdocs/' directory on my computer (C:/xampplite/htdocs/) Here is the initia...

jquery / WordPress: apply infinite scroll effect to new content loaded via AJAX

So I am trying to use jQuery infinite-scroll plugin in combination with some custom jQuery that loads a new loop from a different PHP file with AJAX. The infinite-scroll works on the initial page content, but I can't get it to work with the newly loaded content. Here's how the AJAX logic works: click on a category Get category ID which...

PNG encoder/decoder for PHP

Is there any implementation of a PNG encoder/decoder written in PHP? Something similar to this one: http://packages.python.org/pypng/png.html I know there is GD and other ones, but as far as I know, you cannot have greater control over png chunks since they are png specific. Thanks, Nano. ...

Interspire shopping cart - Custom variables?

I'm trying to add some custom variables which can be accessed in the templates using Interspire. I'm not sure how to do this without touching the core. Anybody know the best practices for this? ...

how do i format text properly after using mysql_real_escape_string?

hi there, so i use mysql_real_escape_string to sanitize some user input before entering it into the db, i would like to know how do i go about "reversing" this function so that when i output to the screen all escaped characters like /n /r get converted to actual new lines...thanks! also, what is the difference between /n and /r? ...

How do I use NetBeans and SVN @version tag in the PhpDoc docblock?

I use NetBeans as my php ide and I have seen @version tags in the docblock that look like this: @version $Id someinfo and timestamp Does NetBeans have a way to automatically update this with each commit? Or am I missing the point entirely of this tag? ...

How to remove subfolder from url

I moved my site to a subfolder called /corp/. So to get to the site you type in mywebsite.com/corp/index.php I would like to remove the /corp/ so it looks like mywebsite.com/index.php Thanks for all the help! ...

.php extension not being parsed by apache on mac os x 10.6

I wanted to use postgres with php, and the default install of mac os x, doesn't have the postgres php modules installed. I tried using the entropy.ch install not realizing that it was incompatible with mac os x 10.6. After removing the entropy code, attempts to render php files responded with a textual representation of the php file. ...

How do you customize/style codeigniter errors?

I'm trying to customize the CSS/HTML for error message displays in codeigniter so I can apply a tag too each and style them up. I tried to Google this and search the manual but must have been searching for the wrong terms - can anyone help me out? ...

Guessing User's TimeZone in PHP.

As of PHP5.3 (I think) it became a requirement for the date.timezone to be set in the php.ini file, or to be set at runtime via the date_default_timezone_set() function. When you don't set this value you get, an error, something along the lines of this: PHP Warning: date(): It is not safe to rely on the system's timezone settings. Yo...