Hello, I am trying to create my first FB application and it doesn't seem to work. I am new to PHP but I have followed the instructions to the letter. I have installed the facebook client library on my server. Then I copied the example code provided by Facebook and all I get is a blank page. However, if I only include simple PHP commands ...
I'm having trouble translating a subroutine from Perl to PHP (I'm new to Perl).
The entire subroutine is as follows:
sub find_all_subsets {
if (1 == scalar (@_)) {return [@_]}
else {
my @all_subsets = () ;
my $last_item = pop (@_) ;
my @first_subsets = find_all_subsets (@_) ;
foreach my $subset (@first_subsets) {
...
This is my codes and I got an error:
require_once(IPT_DIR."config.php");
if ($trackip == 1) {
$ipaddr = $_SERVER["REMOTE_ADDR"] ;
$hostnm = gethostbyaddr("$ipaddr");
$exclude_me=false;
array_walk($exclude_ips, 'exclude_ip');
if(!$exclude_me) array_walk($exclude_hosts, 'exclude_host');
if (!$ex...
On this page...
http://www.axisofeco.com/matters/2010/03/11/the-word-youre-looking-for-is-sublime/
... I have a 'Tweet this' link which pastes in the article title and a link into your Twitter update box (if you're logged in to Twitter).
Problem is, when articles such as the one above have special characters in them (fancy single / d...
Hi guys,
I'm looking to parse data out of about 100 pages, all of which have this string of HTML in it:
<span class="cell CellFullWidth"><span class="SectionHeader">EVENT</span><br/><div class="Center">Event Name</div></span>
I'm not very familiar with parsers, so I'm wondering what I should use to extract the "Event Name" from each ...
Hi All,
How would I insert "_thumb" into files that are being dyanmically generated.
For example, I have a site that allows users to upload an image. The script takes the image, optimizes it and saves to file. How would I make it insert the string "_thumb" for the optimized image?
I'm currently saving 1 version of the otpimized file. ...
Why it's impossible to throw exception from __toString()?
class a
{
public function __toString()
{
throw new Exception();
}
}
$a = new a();
echo $a;
the code above produces this:
Fatal error: Method a::__toString() must not throw an exception in /var/www/localhost/htdocs/index.php on line 12
I was pointed to ht...
is it possible to insert an object into a session instead of creating a different sessions (in PHP)???
...
I've these arrays:
<?php
// New
$array1 = array(
array(
'g_id' => '1',
'g_title' => 'Root Admin',
'g_perm_id' => '1',
'g_bitoptions' => '0'
),
array(
'g_id' => '2',
'g_title' => 'Member',
'g_perm_id' => '2',
'g_bitoptions' => '32'
),
array(
'g_i...
Is this valid:
$_SESSION['pictures']['rateAlbum']['_POST'] = $_POST;
I want to save all of the POST data in the session in one shot.
edit:
oh and what about the other way around:
$_POST = $_SESSION['pictures']['rateAlbum']['_POST'];
...
Let's say you've got a simple fixed-width layout that pulls a title from a MySQL database.
CSS:
#wrapper {
width: 800px;
}
h1 {
width: 100%;
}
HTML:
<html>
<body>
<div id="wrapper">
<h1> $titleString </h1>
</div>
</body>
</html>
But the catch is, the length of the title string pulled from your MySQL da...
What are PHP 5.2 settnigs which affect compatibility with old code (developed for PHP 4 and 3)?
A web application using XTemplate 0.2.4-2 (officially meant for 3.0.11) works fine on one server running PHP 5.2 but works incorrect (seems that the form can't be submitted or processed correctly) on new PHP 5.2 and 5.3 installations. What ma...
I'm just wondering how I could display my last 200 mysql entries in php without showing duplicate entries.
...
Hi!
Is there a straightforward way of determining the number of decimal places in a(n) integer/double value in PHP? (that is, without using explode)
Thanks,
Erwin
...
I de-normalized my database, since the application was crawling otherwise, and Im storing a list of categories for each item in the DB as a raw html version, and simply echoing it out in my design. Each category is actually a link, which is include a tag. Naturally, this is abit of a pain, especially if I want to change the look of how...
I have a path like this:
parent/child/reply
How do I use php to remove the last part of the path, so that it looks like this:
parent/child
Thanks!
...
Hello, i'm trying to create nodes and taxonomy terms through a custom php script by using the node_save() function.
I'm working on drupal 6.
It's working well (thanks to previous questions on stackoverflow) except for accented letters.
Indeed, when a title or a taxonomy term contain "é", "è" or "à", the sentence is cut before those sp...
Debugging a PHP program, is there any add-on/plug-in for browser which I can view sessions variables (those PHP $_SESSION["foobar"] )?
Best if I can change the value in the variables.
...
I saw this example from php.net:
<?php
class MyClass {
const MY_CONST = "yonder";
public function __construct() {
$c = get_class( $this );
echo $c::MY_CONST;
}
}
class ChildClass extends MyClass {
const MY_CONST = "bar";
}
$x = new ChildClass(); // prints 'bar'
$y = new MyClass(); // prints ...
Hello,
Can someone help me with this
I am trying to set and catch the url variable
It begins with a form wich has the standard action set to "/autorisation/logout"
Then a button with an inline javascript function
function tbPayout()
{
parent.location = "/autorisation/logout?rcgo=payout";
return true;
}
<input src="/images/go02.gif"...