php

How to save portlet positions

Hello, I will be using jQuery's functionality to create portlet widgets for my web application suit. I haven't started as of yet, but will do soon, so this is the planning Now, currently, the page loads, and the widgets load into their default positions. A user can move them around, change their settings, whatever. Now, my problem is t...

How can I select only one row for each ID in MySQL?

I have a MySQL table that holds many entries with repeated IDs (for various reasons) So you might have something like ID TIME DATA 1 xx xx 2 xx xx 3 xx xx 1 xx xx 3 xx xx What query can I run through PHP to select each ID only once? So I would like my result set to look like ID TIME DATA 1 xx xx 2 xx xx 3 xx x...

Stop Anyone From Viewing My Site Using an IFrame

I have looked and tried but don't see where I can stop some being able to browse my site through an IFrame or Thickbox? I want to stop banned members from accessing the site through proxy sites that give the end user the ability to browse through a IFrame. I know nothing may be full proof but it's still worth the question. ...

Highlight PHP syntax in .html extensions in VIM

I am working on a codebase that uses php within .html files. How do I tell VIM to highlight php correctly in .html files without renaming all of my .html to .php? ...

Make all form validation errors show up at top in symfony?

I think I may be missing something here that should be relatively common. How can I make all form validation errors, including field-bound errors, show up at the top of the form (global)? ...

Imagick Installation Errors - Class Undefined

Okay, Here's a breakdown of what's up: <? $foo = new Imagick(); ?> works without error when ran from the command-line (e.g., sudo php myscript.php However, when run via the web browswer I get Fatal error: Class 'Imagick' not found in /var/www/lhackwith_www/test_html/magic.php on line 1. magickwand is not installed extension=imagick.so...

Regex with multiple newlines in sequence

I'm trying to use PHP's split() (preg_split() is also an option if your answer works with it) to split up a string on 2 or more \r\n's. My current effort is: split("(\r\n){2,}",$nb); The problem with this is it matches every time there is 2 or 3 \r\n's, then goes on and finds the next one. This is ineffective with 4 or more \r\n's. I...

HTML templates in NetBeans

Is it possible to do template layouts which you can assign to all your pages within NetBeans. (The equivalent to Dreamweaver templates) Please note this is a PHP Project Thanks in advance! Any takers on this one? ...

PHP - POST and GET method on the same page

Hello, I would like to make a variable $find equal to $_POST['find'] if the user is landing on the page after using the POST method, but on the same page make $find equal to $_GET['find'] if the user is landing on the page after using the GET method. How do I do that? Thanks in advance, John $find = $_GET['find']; $find = $_POST['...

changing / maintaining regions in magento

does anyone know how you edit/maintain regions in magento - specifically adding ones for the uk. Thanks, Josh ...

how do i write a javascript alert box to give a yes or no question and integrate with php calls?

i am trying to figure out how to create a javascript alert box asking the user if they would like to delete a record (that their viewing) and when the user presses yes a query is called through php to delete a database row. and if the user presses no nothing will happend. wondering how this can be done thanks ps: this is what i did a...

php script gets two ajax requests, only returns one?

I'll start from the beginning. I'm building a wordpress plugin that does double duty, in that it can be inserted in to a post via a shortcode, or added as a sidebar widget. All it does is output some js to make jquery.post requests to a local php file. The local php file makes a request to a webservice for some data. (I had to do it thi...

How to force adodb php library to use lowercase field names

I'm trying to use adodb for db access in my webapp. However my hosting provider has mysql case sensitive, and I have all my fields in lowercase. But when I call getInsertSQL function, I got them in uppercase. Is there a way to force adodb to use lowercase? I tried with define('ADODB_ASSOC_CASE', 0); $ADODB_ASSOC_CASE = 0; But it se...

how do i write a javascript alert box to give a yes or no question and integrate with php calls? (repost)

i'm reposting this post i just posted a while ago. http://stackoverflow.com/questions/1035266/how-do-i-write-a-javascript-alert-box-to-give-a-yes-or-no-question-and-integrate/1035285#1035285 i wasnt getting anymore responses so i figured the post got lost in somewhere out there. what i tried doing was this <script type="text/javascript...

How can I not allow a user to go back after logout in PHP?

I just wrote a PHP login script, and what I'm trying to accomplish is that when the user click to the log out link, after they log out, regardless clicking the back button of the browser, they cannot access the page. Here is the logout function: //Start the Session session_start(); session_destroy(); header("location:login.php"); exi...

Symfony sfGuardPlugin session inconsistencies

Ok I have several modules in my application in symfony. I have only one module that is secure: on. I also have a layout.php that on top includes a tabbed menu to display links for each module in my application. This menu also has a part where the user is displayed link to 'sign in' if user is not logged in and 'log out' if user is logged...

Converting int to string in PHP

Is there a way to convert integers to string in PHP? ...

Counter won't work when I move it to another server

I set up a hitcounter so that each time someone goes to my site, one of 7 different sidebars loads up. There is a file called counter.php that writes to a text file called hitcounter.txt. All the references to files seem to be relative but when I moved them to a new directory at my new host I got this error instead of a happy hit count...

Looking for an Ajax or PHP trick to detect if they have Javascript...

I am looking for some kind of trick to determine if a user has javascript... I figure I could do it somehow by sending a ajax request at the top of a page, and in that ajax request, set a session variable, and then somehow reload the page, and see of it was set... Is there any tricks like this around in PHP/AJAX? ...

How can I get a list of arguments _expected_ by a function?

I need to be able to interrogate a function/method and get a list of the arguments which that function expects, from outside the function, before the function is called. So not argument values, but a list of expected argument 'slots' per say. Possible? ...