I'm writing a script in PHP that compares people together based on the number of same answers in a survey. I use an array like this:
[person ID]=>number of answers same
to store the 10 people closest to the one I am comparing with.
I need to figure out how to find the lowest of the 10 number of answers same and overwrite a higher ...
I have a page that is accessed via a URL like this:
http://power-coder.net/Test/something.php?id=3#Page1
I know how to access the id parameter using $_GET, however is there a way for me to access the #Page1 part? I have looked at the $_SERVER array and the REQUEST_URI ends at ?id=3.
I know that I could also change the #Page1 to be an...
I mod_rewrite my pages very similar to how SO does it. I have www.example.com/users/login/ which will internally use users.login.php which acts as a controller. I want to pass in a parameter as a page to redirect to once the login is complete.
If you pass in a relative URL you end up with a very peculiar looking URL because you are pass...
So here is the deal. I want to call a class and pass a value to it so it can be used inside that class in all the various functions ect. ect. How would I go about doing that?
Thanks,
Sam
...
I'm working on a facebook app and there's something I'm just not understanding about how their authorization system works.
Our basic setup is this
canvas URL = domain.com/facebook
This is a simple page with an FBML Iframe element that points to domain.com/facebook/app which is an HTML page that serves up a Flash Application.
The Fla...
I am using PHP 5's scandir($dir) function to iterate through a directory and print out an xml list of files. Only, when the directory has a single quote in the name, scandir returns no items! It doesn't return false (as it would if it failed) or generate warnings or errors - just empty. Any ideas?
$items = scandir(stripslashes($dir)); /...
I have a forum on a website I master, which gets a daily dose of pron spam. Currently I delete the spam and block the IP. But this does not work very well. The list of blocked IP's is growing quickly, but so is the number of spam posts in the forum.
The forum is entirely my own code. It is built in PHP and MySQL.
What are some concrete...
Hey all,
I'm pretty new to php and i'm trying to decide the best way to organize the pages and, using PHP, deliver them. The two (basic) ideas I've had are:
A bunch of individual pages all with PHP includes to have the header, footer, and menu.
A single main page that has the menu, header, and footer, along with an include for the mai...
Are there any existing tools for applying an arbitrary lint to PHP code? I know about the command line flag (-l) and pecl extension that will check an input file for valid syntax. What I want is a tool that will let me reject something if it has a certain valid but undesirable syntax.
For example, the lint might reject this
if ($foo) ...
This situation arises from someone wanting to create their own "pages" in their web site without having to get into creating the corresponding actions.
So say they have a URL like mysite.com/index/books... they want to be able to create mysite.com/index/booksmore or mysite.com/index/pancakes but not have to create any actions in the in...
What is the simplest way to suppress any output a function might produce? Say I have this:
function testFunc() {
echo 'Testing';
return true;
}
And I want to call testFunc() and get its return value without "Testing" showing up in the page. Assuming this would be in the context of other code that does output other things, is t...
I have a table and I am displaying its contents using PHP and a while(); I have about three fields in the table that are NULL but can be change, but I want them to still display all the results in my table.
But, it only shows the records with data in EVERY field. Anyone how I can display it? I get a count of the table and it gives me 2,...
Hey, I have a field called STATUS and it is either 1 to show or 0 to hide. My code is below. I am using an edit in place editor with jQuery. Everytime you update it creates a new ROW which I want, but I want only the new one to have STATUS = 1 and the others to 0. Any ideas on how I would do that?
<?php
include "../../inc/config.inc...
I'm trying to get mod_rewrite to work on a client's website who insisted that we use Godaddy web hosting. She's got a shared linux hosting account. Will mod_rewrite work (using .htaccess) and if so, how? I'm not sure if Godaddy uses Apache or not.
...
Hi,
In magento, I have SEO url rewriting enabled, and it is working fine - apart from:
tags (showing as site/tag/product/list/tagId/1/)
reviews (showing as, for example site/review/product/list/id/1/)
RSS feeds (showing as site/rss/catalog/category/cid/3/sid/1/)
How come this is not SEO’d? and what will be the solution for this issu...
I have learned how to use classes in PHP and so far I have only really found one useful application for them. I created a user class to preform various tasks relating to users in my web application such as output the avatar, show number of messages ect.
Aside from this example, what are some other useful ways to utilize classes in a pra...
I have a controller build for a web application with a web presentation.
But now I need to create a iphone (mobile phone) version of this application.
Basically this is a blog application with comments.
In the regular version comments are loaded at the same time as the entry.
But on the mobile application I want to comments to be load o...
HI..........
i have to generate a xml file dynamically at runtime........So plz help me.
<?xml version="1.0" encoding="UTF-8"?>
2. <xml>
3. <track>
4. <path>song1.mp3</path>
5. <title>Track 1 - Track Title</title>
6. </track>
7. <track>
8. <path>song2.mp3</path>
9. <...
I am working on a fairly large system developed by another programmer who no longer works here.
And since i am the manic serial killer who is maintaining it and knows where he lives.
But fun things aside, the system is kinda developed as a class system and kinda not and i have already setup a developer version and can deploy new versi...
Hello,
I have the following part of an AJAX application, which gives no errors, but also nothing is displayed to the screen, so I am unsure of where the problem lies. Calling this page directly from a browser with ?cmd&id=1 should return, or even calling it without ?cmd should return the cmd error message.
edit: added test cases: I do ...