[PHP-DB] Processing a fetched external page

2004-03-18 Thread Donovan Hutchinson
Hi,

I'm working on a project that takes the content of a URL and does stuff with the 
content. I've managed to extract the target url's html, and am using str_replace to 
fix links, stylesheets etc. However, i'm stumped when it comes to processing the text 
content.

Would anyone know how to isolate displayed text (anything in the body, paragraph text, 
headings etc) and then manipulate this text on a word by word basis?

Any suggestions appreciated,

Don

Re: [PHP-DB] Processing a fetched external page

2004-03-18 Thread Donovan Hutchinson
Thanks for the fast replies. I understand about stripping tags and
identifying areas using regular expressions, however my intention is to
display the page intact, with only the content changed.

An example being http://www.pootpoot.com/poot/pootify/

Thanks,

Don

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Sending variables to Flash from php

2004-03-03 Thread Donovan Hutchinson
Hi,
I'm working on a simple bit of flash that should display some text passed into it from 
PHP. I'm using the FlashVars as following (trimmed for brevity):

object ...
PARAM NAME=FlashVars VALUE=name=?php echo $firstname.'+'.$lastname; ?
 embed src=images/intro.swf quality=high FlashVars=name=?php echo 
$firstname.'+'.$lastname; ?...
../object

In flash, i've set up a dynamic text block called nametext, and added the following 
actionscript to the frame:

nametext = name;


I'm sure that should be setting the variable, but I can't seem to get it to work. Any 
suggestions appreciated :)

Donovan Hutchinson

--
Find UK Stores:
UKShopOnline.net
--

[PHP-DB] Cookie problem

2004-02-07 Thread Donovan Hutchinson
Hi,

I'm trying to use PHP to set a cookie to recognize people returning within a month. 
However no matter how i use the code, no cookie is being set. I've been in touch with 
my host, who assures me that cookies function in the 'normal' way on their servers, so 
its probably something wrong with my code. I'm using this:

$time = mktime()+(60*60*24*30); 
setcookie('lifevision', $dist_id, $time, '/', 'www.dono.co.uk','0');

i've also tried without the www and without the www. in the domain. To test if the 
cookie is being set, the url www.dono.co.uk/testing/ should set a cookie. It also 
starts a session for people who can't accept cookies. (i've also put a print_r at the 
end of the page to print the cookie contents, if any) However the cookie just isnt 
appearing. Any suggestions appreciated,

Don


Re: [PHP-DB] Re: PHP Java problem

2004-01-14 Thread Donovan Hutchinson
Thanks Justin, thats a handy function.

I've been testing my code and found that it works up until I start passing
objects into methods. This is the code I'm using to set up some objects
(they are being passes variables that have been settype()'d):

 $sessioniser = new Java('com.SessionManager', adam, );
 $homeaddress = new Java('com.Address', $hline1, $hline2, $hline3, $hline4,
$hline5, $hline6);
 $deliveryaddress = new Java('com.Address', $dline1, $dline2, $dline3,
$dline4, $dline5, $dline6);
 $name = new Java('com.Name', $firstname, $middlename, $lastname);
 $coname = new Java('com.Name', $cofirstname, $comiddlename, $colastname);

When I print_r each of these, it produces these results:

Sessioniser: java Object ( [0] = 8 )
HomeAddress: java Object ( [0] = 9 )
DeliveryAddress: java Object ( [0] = 10 )
Name: java Object ( [0] = 11 )
CoName: java Object ( [0] = 12 )

These objects do not correspond to the data I'm passing in to them. I've
asked the programmer why this is the case and he has shown his classes
working using a command line. I must be doing something wrong in php but
can't see what. Any suggestions most appreciated.

Thanks,

Don

 function objToAssoc($obj) {
if(is_object($obj)) {
  $arr = get_object_vars($obj);
} else {
  $arr = $obj;
}
if(is_array($arr)) {
  foreach($arr as $key = $val) {
$arr[$key] = objToAssoc($val);
  }
}
return $arr;
 }


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PHP Java problem

2004-01-13 Thread Donovan Hutchinson
Hi,

I've started putting together a site that uses PHP to access some custom
Java classes. While I'm not clear on what exactly the java classes are
doing, the programmer has given me an overview of the variables that I
should pass to them. However, I keep getting this error:

java.lang.IllegalArgumentException: argument type mismatch

The java programmer has no knowledge of PHP and so is unable to help locate
the source of the problem (tbh I'm don't have experience in large php
projects myself). The code I'm writing is in the following format:

$newobject = new Java('com.company.Class', $names, (String) $ssn, (int)
$time);

In the above example, $names is an object, $ssn a string and $time an
integer. The object $names is created in a similar way above this example.
Someone mentioned that I should be passing objects as arrays, but I'm not
clear on how this is done.

I've tested a very basic class to be sure it works, and had success, however
when I try to pass objects into classes, and multiple variables, it doesnt
work. I hope someone can shed some light on where I might be going wrong.

Many thanks,

Don

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php