[PHP] include() problem.

2001-10-23 Thread brendan

Hi,
I have an issue with including a file accross my web server from a 
separate site on that server served on another port.

- explanation

my php website runs off IIS port :80 (unfortunately IIS is employers 
decision not mine )
- I have a web spider running off port :
both which operate independent of eachother and serve content separately ..

I am within a secure firewall (a university)

the network administration is understandably cautious about microsoft 
security and has now blocked all ports but :80 on IIS machines ...

- outcome

i cannot serve web content from port :
however the spider cannot run simultaneously to IIS on the same port..

- proposed solution ..

to use include("http://localhost:/spider/index.html?query=ihateIIS";)

outcome - blank screen, headache from staring at screen too long ..

HELP!!!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include() problem.

2001-10-23 Thread brendan

Uni runs solaris/unix
faculty runs iis
world of political pain and anguish..

view source brings up a blank screen ..
ta
brendan

David Robley wrote:

> On Wed, 24 Oct 2001 08:03, brendan wrote:
> 
>>Hi,
>>  I have an issue with including a file accross my web server from a
>>separate site on that server served on another port.
>>
>>- explanation
>>
>>my php website runs off IIS port :80 (unfortunately IIS is employers
>>decision not mine )
>>- I have a web spider running off port :
>>both which operate independent of eachother and serve content
>>separately ..
>>
>>I am within a secure firewall (a university)
>>
>>the network administration is understandably cautious about microsoft
>>security and has now blocked all ports but :80 on IIS machines ...
>>
>>- outcome
>>
>>i cannot serve web content from port :
>>however the spider cannot run simultaneously to IIS on the same port..
>>
>>- proposed solution ..
>>
>>to use
>>include("http://localhost:/spider/index.html?query=ihateIIS";)
>>
>>outcome - blank screen, headache from staring at screen too long ..
>>
>>HELP!!!
>>
> 
> I guess first question is - does View Source show you anything?
> 
> Isn't it wonderful how unis, of all places, insist on running stuff like 
> IIS? 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] @#$@# Reg Expressions

2001-10-29 Thread brendan

love em.. right now I hate em..

can someone inform me why the below doesnt work?
it is intended to strip out all the links in a page and return an array
.. insanity is just starting to set in..

cheers

$html =GETSITE($url);
// and put in a new line break behind every anchor tag
$the_array=spliti("", $html,-1);
echo $the_array ;
foreach($the_array AS $k) echo $k."";
}


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] @#$@# Reg Expressions

2001-10-29 Thread brendan

thanks but it didnt work either ..  ;)

Matt Friedman wrote:

> Try putting a "?" after your quantifier for "non-greedy" matching.
> 
> Something like: $the_array=split("", $html,-1);
> 
> Matt.
> 
> 
> 
> - Original Message - 
> From: "brendan" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, October 29, 2001 7:55 PM
> Subject: [PHP] @#$@# Reg Expressions
> 
> 
> 
>>love em.. right now I hate em..
>>
>>can someone inform me why the below doesnt work?
>>it is intended to strip out all the links in a page and return an array
>>.. insanity is just starting to set in..
>>
>>cheers
>>
>>$html =GETSITE($url);
>>// and put in a new line break behind every anchor tag
>>$the_array=spliti("", $html,-1);
>>echo $the_array ;
>>foreach($the_array AS $k) echo $k."";
>>}
>>
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>>
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread brendan

martin, jack ..
cheers for the replies

Jack.. I am trying to strip out all links in the page that is between 
the 
I was using
$html =GETSITE($url);

$the_array=spliti("", $html,-1); //spliti to avoid any case 
sensitivity.
foreach($the_array AS $k) echo $k."";

I had given preg_split a go but just got flummoxed with the need to 
slash everything ..


Martin .. I'd tried that .. but i get an array count of 0 from 
$the_array ..(from $the_array=split("]*)", $html,-1);



echo count($the_array);

Jack Dempsey wrote:

> ok, are you trying to get the links returned or just split on them? i missed
> your original post.
> watch your caps as well...
> 
> i'd use preg_split also
> 
> jack
> 
> -Original Message-
> From: brendan [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 29, 2001 9:59 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] @#$@# Reg Expressions
> 
> 
> thanks but it didnt work either ..  ;)
> 
> Matt Friedman wrote:
> 
> 
>>Try putting a "?" after your quantifier for "non-greedy" matching.
>>
>>Something like: $the_array=split("", $html,-1);
>>
>>Matt.
>>
>>
>>
>>- Original Message -
>>From: "brendan" <[EMAIL PROTECTED]>
>>To: <[EMAIL PROTECTED]>
>>Sent: Monday, October 29, 2001 7:55 PM
>>Subject: [PHP] @#$@# Reg Expressions
>>
>>
>>
>>
>>>love em.. right now I hate em..
>>>
>>>can someone inform me why the below doesnt work?
>>>it is intended to strip out all the links in a page and return an array
>>>.. insanity is just starting to set in..
>>>
>>>cheers
>>>
>>>$html =GETSITE($url);
>>>// and put in a new line break behind every anchor tag
>>>$the_array=spliti("", $html,-1);
>>>echo $the_array ;
>>>foreach($the_array AS $k) echo $k."";
>>>}
>>>
>>>
>>>--
>>>PHP General Mailing List (http://www.php.net/)
>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>For additional commands, e-mail: [EMAIL PROTECTED]
>>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>>
>>>
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread brendan

mate you rock..


Martin Towell wrote:

> try this - 
> 
> $the_array = spliti(" $the_array = preg_grep("", $the_array);
> foreach($the_array as $k)
>   echo ereg_replace(".*", "", $k)."\n";
> 
> 
> -Original Message-
> From: Jack Dempsey [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 30, 2001 2:30 PM
> To: brendan; [EMAIL PROTECTED]
> Subject: RE: [PHP] @#$@# Reg Expressions
> 
> 
> brendan, please clarify: you're "trying to strip out all links in the page
> that is between
> the "
> 
> you're trying to strip out all links and return them?
> if so, split won't work.it splits on whatever the pattern is.
> if you're trying to get all the links, you could do [this doesn't get  name which is what you want i think]
> 
> preg_match_all("|()|",$html,$matches);
> 
> look at the preg_match_all page at php.net for info on how to use it
> 
> 
> ITE($url);
> 
> $the_array=spliti("", $html,-1); //spliti to avoid any case
> sensitivity.
> foreach($the_array AS $k) echo $k."";
> 
> I had given preg_split a go but just got flummoxed with the need to
> slash everything ..
> 
> 
> Martin .. I'd tried that .. but i get an array count of 0 from
> $the_array ..(from $the_array=split("]*)", $html,-1);
> 
> 
> 
> echo count($the_array);
> 
> Jack Dempsey wrote:
> 
> 
>>ok, are you trying to get the links returned or just split on them? i
>>
> missed
> 
>>your original post.
>>watch your caps as well...
>>
>>i'd use preg_split also
>>
>>jack
>>
>>-Original Message-
>>From: brendan [mailto:[EMAIL PROTECTED]]
>>Sent: Monday, October 29, 2001 9:59 PM
>>To: [EMAIL PROTECTED]
>>Subject: [PHP] @#$@# Reg Expressions
>>
>>
>>thanks but it didnt work either ..  ;)
>>
>>Matt Friedman wrote:
>>
>>
>>
>>>Try putting a "?" after your quantifier for "non-greedy" matching.
>>>
>>>Something like: $the_array=split("", $html,-1);
>>>
>>>Matt.
>>>
>>>
>>>
>>>- Original Message -
>>>From: "brendan" <[EMAIL PROTECTED]>
>>>To: <[EMAIL PROTECTED]>
>>>Sent: Monday, October 29, 2001 7:55 PM
>>>Subject: [PHP] @#$@# Reg Expressions
>>>
>>>
>>>
>>>
>>>
>>>>love em.. right now I hate em..
>>>>
>>>>can someone inform me why the below doesnt work?
>>>>it is intended to strip out all the links in a page and return an array
>>>>.. insanity is just starting to set in..
>>>>
>>>>cheers
>>>>
>>>>$html =GETSITE($url);
>>>>// and put in a new line break behind every anchor tag
>>>>$the_array=spliti("", $html,-1);
>>>>echo $the_array ;
>>>>foreach($the_array AS $k) echo $k."";
>>>>}
>>>>
>>>>
>>>>--
>>>>PHP General Mailing List (http://www.php.net/)
>>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>For additional commands, e-mail: [EMAIL PROTECTED]
>>>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>>
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] lesson in NOT how to run your php website ...

2001-10-29 Thread brendan

I teach law at a university  .. I also run the website here ...  php 
with a mysql backend ...


- I have been designing a client side administration tool which allows 
you to setup both the html input form to request from a database and 
format the way the results look and are returned ... so that academics 
can setup and run their own databases ...

- of course during setup and debugging I ran from the /temp directory of 
the website (we dont have a test machine)

- after debugging was over i forgot about the extra copy of this script 
in the /temp directory and forgot to delete it ..(there was no security 
on the script)

- what i also forgot was that in my last lecture series I had left the 
presentation files for the students in the .. you guessed it ... /temp 
directory  ..

- the students .. being students didnt actually look at the lecture 
notes very much, and i had deleted them ..

- however its exam time  ... and all of them in a flurry logged on to 
the site ('/temp') ... but instead of finding the lecture series they 
find this strange control panel with lots of weird buttons...
- web user + strange buttons on page => bugger ...

so about two weeks ago the site started to go haywire ... links stopped 
working .. databases started screwing up ..

- i had entirely forgot about the contents of the /temp directory ..
- i was going INSANE trying to continually fix the site ..
- i thought we were being hacked and ran a constant netstat, logged all 
visitor activity and made two separate complaints about what seems now 
were innocent web users ...
- i didnt sleep
- my girlfriend nearly dumped me ..
- i was sure there was a conspiracy at hand ..

- I only stumbled on the /temp directory when i began rebuilding a new 
site to replace what I had now decided was a comprimised code base ... I 
started in the /temp directory of course ;)


- I am sure there is a lesson here somewhere .. I think it is probably 
more valuable just to laugh at ..

ps thanks for all the help on the last run of stupidity I had (re 
!#@$!#$ regular expressions posts here)

happy programming!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread brendan

or really bloody narky afgani's

Martin Towell wrote:

> Off track - seems like the only ppl awake now are ozzies :)
> would I be right?
> 
> -Original Message-
> From: Brad Hubbard [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 30, 2001 3:11 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] @#$@# Reg Expressions
> 
> 
> On Tue, 30 Oct 2001 14:47, brendan wrote:
> 
>>mate you rock..
>>
> 
> You can tell he's an Australian (on ya mate :-)
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread brendan

Your too late for that ..
recipie boy  (aka speedboy) already had a go at us southerners
I reckon you noreasterners are for it next ..
Im working on finding out where he's from so we can make fun of his state ..
Im working hard..
ill find out..
then the jokes'll be flying..
;)

Brad Hubbard wrote:

> On Tue, 30 Oct 2001 15:14, brendan wrote:
> 
>>or really bloody narky afgani's
>>
>>Martin Towell wrote:
>>
>>>Off track - seems like the only ppl awake now are ozzies :)
>>>would I be right?
>>>
> 
> No jokes about Tamanians or New South Welshmen though alright?
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] anyone know any good jokes about queenslanders?

2001-10-29 Thread brendan

c2470.rochd1.qld.optusnet.com.au (aka speedboy)

so far i have found..

Did you know there really is an Australian beer (brewed in Queensland) 
called , pronounced "Four-X"? Rumour has it the name is because 
Queenslanders can't spell "beer."

- one nation.


Brad Hubbard wrote:

> On Tue, 30 Oct 2001 15:27, brendan wrote:
> 
>>Your too late for that ..
>>recipie boy  (aka speedboy) already had a go at us southerners
>>I reckon you noreasterners are for it next ..
>>Im working on finding out where he's from so we can make fun of his state
>>.. Im working hard..
>>ill find out..
>>then the jokes'll be flying..
>>;)
>>
> 
> I see what you mean... he's not making it easy for you.
> 
> 
> $ whos nomicrosoft.org
>   [whois.geektools.com]
> Query: nomicrosoft.org
> Registry:  whois.opensrs.net
> Results:
> Registrant:
>  No Organisation
>  No Address
>  No City, No State No Zip
>  DE
> 
>  Domain Name: NOMICROSOFT.ORG
>  
>  Sponsoring Reseller; for Technical Support
>  with respect to this domain contact:
> easyDNS Technologies Inc., [EMAIL PROTECTED]
> +1.416.535.8672
> http://www.easydns.com
> 
>  Administrative Contact:
> Karotte, Rutsche  [EMAIL PROTECTED]
> No Address
> No City, No State No Zip
> DE
> 0080 1100333
> 
>  Technical Contact:
> Karotte, Rutsche  [EMAIL PROTECTED]
> No Address
>   No City, No State No Zip
> DE
> 0080 1100333
>  
>  Billing Contact:
> Karotte, Rutsche  [EMAIL PROTECTED]
> No Address
> No City, No State No Zip
> DE
> 0080 1100333
>  
>  
>  Record last updated on 24-Oct-2001.
>  Record expires on 21-Oct-2002.
>  Record Created on 21-Oct-1999.
>  
>  Domain servers in listed order:
> NS1.EASYDNS.COM   216.220.40.243
> NS2.EASYDNS.COM   216.220.40.244
> REMOTE1.EASYDNS.COM   64.39.29.212
> REMOTE2.EASYDNS.COM   212.100.224.80
>  
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] @#$@# Reg Expressions

2001-10-29 Thread brendan

hans up who else is procrastinating?
;)


Martin Towell wrote:

> ARGH!! You, you, missed!! :/
> 
> 
> -Original Message-
> From: Brad Hubbard [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 30, 2001 3:53 PM
> To: Martin Towell; [EMAIL PROTECTED]
> Subject: Re: [PHP] @#$@# Reg Expressions
> 
> 
> On Tue, 30 Oct 2001 15:49, Martin Towell wrote:
> 
>>Here - I'm from NSW, Oz !!! can't make it any harder for you :)
>>
>>
> 
> And how are things in York St.?
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [PHP-DB] PHP Getting Variables from String

2001-10-29 Thread brendan

Use the eval function

$string="word1 word2 word3 word4);

$string_array=explode(" ",$string);

for ($x=0;$x>$string="These are some words"
>>
>>I want it to turn into $var1=These, $var2=are, $var3=some, $var4=some
>>
> 
> $search_entities = explode(" ", $string);
> 
> if (count($search_entities) > 0) {
>   $criteria = "";
>   for ($i = 0; $i < count($search_entities); $i++) {
>   if ($i == (count($search_entities) - 1)) {
>   $criteria .= "name = '$search_entities[$i]'";
>   } else {
>   $criteria .= " name = '$search_entities[$i]' OR ";
>   }
>   }
> }
> $query = "select name from countries where $criteria";
> 
> I don't like this though, anyone have a better solution?
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] TN3270?

2001-12-16 Thread brendan

does anyone know of how or where I can find info on, accessing a IBM 
mainframe which uses the TN3270 protocol via a socket?
TN3270 isnt ordinary telnet so I assume the existing telnet socket info 
isnt helpful
ta
brendan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] TN3270 socket

2001-12-17 Thread brendan

does anyone know of how or where I can find info on, accessing a IBM 
mainframe which uses the TN3270 protocol via a socket?
TN3270 isnt ordinary telnet so I assume the existing telnet socket info 
isnt helpful
ta
brendan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] telneting sockets help..

2001-12-18 Thread brendan

hi

i have been trying to write a telnet client to a tn3270 IBM mainframe 
database ( pericles.ipaustralia.gov.au:23 ) using fsockopen ...
i thought it wouldnt be that bad given i have done something similar 
with usenet ..
however i cannot get it to work no matter what I do .. i just get a 
permanent hang ...
has anyone ever attempted this or have any solutions?

i know this is rather open ended but i cant offer any code which even 
kind of works..

it would be much appreciated..


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] telneting sockets help..

2001-12-18 Thread brendan

hi james,
thanks for your reply  ..
i was able to connect ( i should have written that in the email) its 
getting the info to flush to the screen that i cant do .. it just hangs..

so if you add
something like

while (!feof($fp)) {
 echo fgets ($fp,128);
 }
 fclose ($fp);

to the end
you get nothing..

...
herein lies my second sleepless day..
i have been tyring to use the sockets() functions which have been 
added.. but they are badly documented and extremely unfriendly..

how did you manage to interact with your telnet server?
cheers
brendan


James Cox wrote:

> Hi,
> 
> I had recent problems like this, and I traced it to firewall issues; however
> i just checked the destination, and  found it is possible to telnet to that
> port, so it's not a firewall issue on their side.
> 
> Try using the following code -- and let it run, see what response you get.
> 
>  
> $host = "pericles.ipaustralia.gov.au";
> 
> $fp = fsockopen($host, 23, &$errno, &$errstr, 5);
>if (!($fp)) {
>   echo "SOCKET ERROR: $errno - $errstr\n";
> }
> 
> ?>
> 
> Hope that helps,
> 
> James Cox
> 
> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
> James Cox :: Senior Support Engineer
> Wherewithal, Inc. e: [EMAIL PROTECTED]
> Wherewithal. Capture Creative Connections.
> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
> 
>>-Original Message-
>>From: brendan [mailto:[EMAIL PROTECTED]]
>>Sent: 19 December 2001 04:12 AM
>>To: [EMAIL PROTECTED]
>>Subject: [PHP] telneting sockets help..
>>
>>
>>hi
>>
>>i have been trying to write a telnet client to a tn3270 IBM mainframe
>>database ( pericles.ipaustralia.gov.au:23 ) using fsockopen ...
>>i thought it wouldnt be that bad given i have done something similar
>>with usenet ..
>>however i cannot get it to work no matter what I do .. i just get a
>>permanent hang ...
>>has anyone ever attempted this or have any solutions?
>>
>>i know this is rather open ended but i cant offer any code which even
>>kind of works..
>>
>>it would be much appreciated..
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>
>>
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] telneting sockets help..

2001-12-18 Thread brendan

ta lawrence ..

did you get that to work on your server side??
if so maybe its a m$IIS problem (which i am forced to run off)  .. 
because that code hangs here too
cheers

brendan


Lawrence Sheed wrote:

> Have you tried setting socket blocking?
> Here's what I do...
> 
> var $connection=0; 
> $host = "pericles.ipaustralia.gov.au";
> $port=23;
> 
> switch( $connection=fsockopen($host,$port) )   { 
>case -3: 
> return("-3 socket could not be created"); 
>case -4: 
> return("-4 dns lookup on host '$host' failed"); 
>case -5: 
> return("-5 connection refused or timed out"); 
>case -6: 
> return("-6 fdopen() call failed"); 
>case -7: 
> return("-7 setvbuf() call failed"); 
>default: 
>   //let getline do its job bit by bit rather than timeout by timeout
> ;)
>   set_socket_blocking ($connection,false);
>   } 
> 
> Function GetLine() {
>   global $debug,$connection;
>   $line = fread($connection,128);
>   while(empty($line)){
>   $line = fread($connection,128);
>   usleep(25); 
>   }
> 
>   //If debugging on, force output
>   if ($debug) {
>   print ($line) ."";
>   System("echo ''"); 
>   flush;
>   }
> 
>   return ($line);
> }
> 
> 
> print GetLine();
> 
> -Original Message-
> From: brendan [mailto:[EMAIL PROTECTED]]
> Sent: December 19, 2001 1:04 PM
> To: [EMAIL PROTECTED]; James Cox
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] telneting sockets help..
> 
> 
> hi james,
> thanks for your reply  ..
> i was able to connect ( i should have written that in the email) its 
> getting the info to flush to the screen that i cant do .. it just hangs..
> 
> so if you add
> something like
> 
> while (!feof($fp)) {
>  echo fgets ($fp,128);
>  }
>  fclose ($fp);
> 
> to the end
> you get nothing..
> 
> ...
> herein lies my second sleepless day..
> i have been tyring to use the sockets() functions which have been 
> added.. but they are badly documented and extremely unfriendly..
> 
> how did you manage to interact with your telnet server?
> cheers
> brendan
> 
> 
> James Cox wrote:
> 
> 
>>Hi,
>>
>>I had recent problems like this, and I traced it to firewall issues;
>>
> however
> 
>>i just checked the destination, and  found it is possible to telnet to
>>
> that
> 
>>port, so it's not a firewall issue on their side.
>>
>>Try using the following code -- and let it run, see what response you get.
>>
>>>
>>$host = "pericles.ipaustralia.gov.au";
>>
>>$fp = fsockopen($host, 23, &$errno, &$errstr, 5);
>>   if (!($fp)) {
>>  echo "SOCKET ERROR: $errno - $errstr\n";
>>}
>>
>>?>
>>
>>Hope that helps,
>>
>>James Cox
>>
>>. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>James Cox :: Senior Support Engineer
>>Wherewithal, Inc. e: [EMAIL PROTECTED]
>>Wherewithal. Capture Creative Connections.
>>. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>
>>
>>>-Original Message-
>>>From: brendan [mailto:[EMAIL PROTECTED]]
>>>Sent: 19 December 2001 04:12 AM
>>>To: [EMAIL PROTECTED]
>>>Subject: [PHP] telneting sockets help..
>>>
>>>
>>>hi
>>>
>>>i have been trying to write a telnet client to a tn3270 IBM mainframe
>>>database ( pericles.ipaustralia.gov.au:23 ) using fsockopen ...
>>>i thought it wouldnt be that bad given i have done something similar
>>>with usenet ..
>>>however i cannot get it to work no matter what I do .. i just get a
>>>permanent hang ...
>>>has anyone ever attempted this or have any solutions?
>>>
>>>i know this is rather open ended but i cant offer any code which even
>>>kind of works..
>>>
>>>it would be much appreciated..
>>>
>>>
>>>--
>>>PHP General Mailing List (http://www.php.net/)
>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>For additional commands, e-mail: [EMAIL PROTECTED]
>>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: kancha [PHP] telneting sockets help..

2001-12-18 Thread brendan

have you tried the client script at http://php.ca/manual/en/ref.sockets.php
??
this seems to (kind of) work ..
however i get a ton of warning messsages from php such as

"Attempting to connect to '202.14.186.30' on port '23'...
Warning: socket_connect() expects parameter 1 to be resource, boolean
Warning: socket_read() expects parameter 1 to be resource, boolean given
Warning: socket_write() expects parameter 1 to be resource, boolean
Warning: socket_close() expects parameter 1 to be resource, boolean
"
not sure why

might be different for you?
cheers


Kancha . wrote:

> I'm in a smilar situation. I'm trying to telnet to a
> RAS server using php and the process justs hangs. I
> tried to telnet to other linux servers as well and the
> result was same. fsockopen to other ports such as 21
> or even 25 workds. It's just the port 23 that's giving
> this strange problem.
> 
> So far I haven't got a clue.
> 
> 
> --- brendan <[EMAIL PROTECTED]> wrote:
> 
>>hi
>>
>>i have been trying to write a telnet client to a
>>tn3270 IBM mainframe 
>>database ( pericles.ipaustralia.gov.au:23 ) using
>>fsockopen ...
>>i thought it wouldnt be that bad given i have done
>>something similar 
>>with usenet ..
>>however i cannot get it to work no matter what I do
>>.. i just get a 
>>permanent hang ...
>>has anyone ever attempted this or have any
>>solutions?
>>
>>i know this is rather open ended but i cant offer
>>any code which even 
>>kind of works..
>>
>>it would be much appreciated..
>>
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail:
>>[EMAIL PROTECTED]
>>For additional commands, e-mail:
>>[EMAIL PROTECTED]
>>To contact the list administrators, e-mail:
>>[EMAIL PROTECTED]
>>
>>
> 
> 
> __
> Do You Yahoo!?
> Check out Yahoo! Shopping and Yahoo! Auctions for all of
> your unique holiday gifts! Buy at http://shopping.yahoo.com
> or bid at http://auctions.yahoo.com
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] sockets ??

2001-12-19 Thread brendan

have the below code.. and am having two issues..
the first is that str_read comes up with an error
'read() expects parameter 2 to be long, string given'

  - is this because i am recieving binary from host?

the value returned is totally empty .. i know i need to hanshake and all 
but how do I work out what the server is asking so i can respond in 
kind? (yes i have read the rfc ..)

??
cheers
brendan


OK.\n";
}

$in = '';
$out = '';

while (socket_read ($socket, $out, 1024)) {
 echo ord($out);
}

echo "sending guest login\n";
socket_write ($socket, $in, strlen ($in));
echo "OK.\n";

echo "Reading response:\n\n";
while (socket_read ($socket, $out, 2048)) {
 echo ord($out);
}

echo "Closing socket...";
socket_close ($socket);
echo "OK.\n\n";
  echo strlen($out);
?>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] socket read byte by byte

2001-12-19 Thread brendan

another question for the continuing saga ..
I am trying to undertake a handshake with the telnet (tn3270) server ..
using
$get=socket_read($socket, 128, PHP_BINARY_READ );
i now need to step through $get byte by byte
how do i do an equivilent fgetc? ie

  while (!feof($get)) {
echo fgetc($iget);
}

but with the socket???

entire code below. ...
cheers

brendan








---


 \n";
  }
  }
  return $bin_array;

}
$bin_array= makeChr();

 $chr_array[0]="NUL"; /*NULL 
(NUL)  0  No Operation*/

 $chr_array[1]="ARE";   //1


$chr_array[7]="BELL";  /*   Produces an audible or
 visible signal (which does
 NOT move the print head).*/

 $chr_array[7]="BS"; /*Moves the print head one
 character position towards
 the left margin.   */
 $chr_array[9]="HT";  /*Moves the printer to the
 next horizontal tab stop.
 It remains unspecified how
 either party determines or
 establishes where such tab
 stops are located. */
 $chr_array[10]="LF"; /*  Line Feed ()  Moves 
the printer to the
 next print line, keeping the
 same horizontal position.   */

 $chr_array[11]="VT"; /*   Moves the printer to the
 next vertical tab stop.  It
 remains unspecified how
 either party determines or
 establishes where such tab
 stops are located.   */
  $chr_array[12]="FF"; /*Moves the printer to the top
 of the next page, keeping
 the same horizontal position. */

 $chr_array[13]="CR"; /* Carriage Return (CR)   13  Moves 
the printer to the left
 margin of the current line. */



  $chr_array[29]="3270-REGIME"; /*  Telnet 3270 Regime Option
  rfc 
http://www.ietf.org/rfc/rfc1041.txt
*/

   $chr_array[240]="SE";  /*   End of subnegotiation 
parameters. */

   $chr_array[241]="NOP"; /* No operation. */

   $chr_array[242]="Data Mark";   /*  The data 
stream portion of a Synch.*/
 /* This should always be accompanied */
  /* by a TCP Urgent notification.*/
  $chr_array[243]="Break";/* NVT character BRK.*/
  $chr_array[244]="Interrupt Process"; /* The function IP.*/
  $chr_array[245]="Abort output"; /* The function AO.*/
  $chr_array[246]="Are You There";/*  The function AYT.*/
  $chr_array[247]="Erase character"; /* The function EC. */
  $chr_array[248]="Erase Line";   /* The function EL.*/
  $chr_array[249]="Go ahead"; /* The GA signal. */
  $chr_array[250]="SB";   /* Indicates that what follows is
  subnegotiation of the indicated
  option. */
  $chr_array[251]="WILL";   /* Indicates the desire to begin
  performing, or confirmation that
  you are now performing, the
  indicated option.*/

  $chr_array[ 252]="WON'T"; /* Indicates the refusal to perform,
  or continue performing, the
  indicated option. */

  $chr_array[253]="DO";/* Indicates the request that the
  other party perform, or
  confirmation that you are expecting
  the other party to perform, the
  indicated option. */

   $chr_array[254]="DON\'T";   /*Indicates the demand that the
  other party stop performing,
  or confirmation that you are no
  longer expecting the other party
   

[PHP] nesting php

2001-04-27 Thread Brendan Caulfield

Hello everyone!

I am trying to pass a variable in a url and can't seem to do it.  The problem is, the 
url is already being determined by a php "if" statement.  So, when I get to the part 
where I try to append the url I get parse errors. What I would ideally like to do is 
generate the url using php and append the url with a variable, also using php.  The 
variable is a username, therefore i need to use (urlencode()).  Any ideas.

Thanks, 

Brendan


_
Start your day everyday with fellow Sigma Nu brothers. Visit http://www.SigmaNu.com, 
Sigma Nu's exclusive private label start page, where you'll get Fraternity news, New 
York Times news, custom stock portfolios, up-to-the-minute sports scores, current 
weather conditions and five-day forecasts, online shopping with brand name stores, 
web-based Sigma Nu e-mail and much more. This is a free service brought to you by 
Sigma Nu. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Novice question - Please Help

2002-01-30 Thread brendan conroy

Hi,
   thanks for reading this. Ive looked at every php site and cant find an 
answer, youre my last hope!(ok so its not that serious, but pretty close!).
Could someone please email me and tell me how to split a string into 
different arrays and save what they were split on?
Also I cant get the sizeof function to work no matter what syntax i use, i 
think ive tried them all, do you have to include a library or something in 
your program to make it work?

Thanks a million, this isint a frivilous question, I looked everywhere 
before i came here, thanks,



Bren

_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Convert a string to an array w/o spliting or exploding

2002-02-13 Thread brendan conroy

Hi, thanks for reading this novice question, I'd be grateful if someone 
could email me and tell me if its possible to convert a string to an array 
whithout using the split[] or explode[] function, as these aren't 
appropriate for the task. I cant find any ino on php.net,

Thanks,

Bren

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


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




[PHP] VERY novice question!

2002-02-14 Thread brendan conroy

Thanks for reading this! This is a really novice question but I cant find 
any info about this in the online manual. I would be grateful if someone 
could email me the PHP equivalent of the "&&"(AND) and "||"(OR) operators 
which are used in C.
I'am trying to write if statements like

if((($m[0]=="-")&&($count<2))||($count++"0"))
{
}


I be grateful for any replies!!

Thanks,


Bren

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


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




[PHP] Novice question

2002-02-15 Thread brendan conroy

Hi,thanks for reading this!
This problem has got me beat! I cant figure out how to insert a minus sign 
into each element in an array of strings.
I keep getting the error that the first element in array_push has to be an 
array, no matter what method I've tried, and I cant think of any more!
Im trying to isolate terms in polynommials, which Ive stored in an array m[] 
like this:


$m[0]="-3x_1^6/7-4x_2^3/5";
$m[1]="-4x_3^2/3-7x_4/7";


/*Each element in m has two terms, and I want to isolate these by exploding 
on the minus sign, thus giving me four elements, which then need to have a 
minus inserted into them.


I take one of the four elements in $ss, and for each character I push it 
into a temporary storage array $test, then I reverse $test so the term is in 
the correct order, and then I insert the minus sign at the start. But 
funnily enough, there seems to be a flaw in my logic or code. What Ive 
written so far is*/

$ss=explode("-",$m);

for($cnt=1;$cnthttp://mobile.msn.com


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




[PHP] Novice Question

2002-02-18 Thread brendan conroy

Hi thanks for reading this.

This problem is difficult to get across, this is what happens:

A) On a html page I ask users how many inputs they wish to enter, say 3. The 
3 is stored as a variable called $NoPols.

B) Then in the code below, a loop creates $NoPols (3) forms to take the 
users inputs.

The problem is that the same name($Yourpol) is used in each of the created 
forms, and i dont know how to get around this problem.

I would like to know if it is possible to create a page which has a number 
of forms, the number of which is decided by the user(on a start page), so 
the user can submit as many inputs as they want from one page.


Sorry if I've wasted your time,

I'd be very grateful for any assisstance with this problem,

thanks a million,




Brendan









npage.php









enter polynomial  here:










_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




[PHP] novice question -- array_push($real[$i][$j],$s[$j]);????????

2002-02-20 Thread brendan conroy

Hi, thanks for reading this,
Iam trying to push elements into a two dimentional array, but I cant find 
the proper syntax, I'd be grateful if someone could email me the proper 
method. Iam using the normal method, which worked fine for a one dimentional 
array, but when I use it for a two dimentional array, it doesnt seem to 
recognise that is an array, even though I initialized the array with 
$real[0][0] = 0;.

Thanks a million for your time,


Bren

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


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




[PHP] Novice question

2002-02-23 Thread brendan conroy

Hi,
thanks for reading this, Im just going to say it cos i dont want to waste 
your time. Im looking for a really big favour here(cos I think it may take 
time to spot this, although it might only take five seconds to spot, but I 
dunno,the problem area of code is only four lines long), so dont  spend time 
reading this unless you got half an hour spare or are looking a good 
samaritan award or something.



Still reading this? Excellent, Iam saved.
I wrote code which takes a input string, breaks it up and puts the bits into 
an array called $real. THIS WORKS.

But I may have lots of input strings so I slapped a for loop around the code 
to do the same thing for all the inputs and THAT WORKS ASWELL!

Then i wanted to save the different bits of each input string in its own 
array, so I created an array of arrays and at the end of each cycle of the 
big loop, I take out all the element in $real and put them into the array of 
arrays, called $poly[][]. THIS DOESNT WORK.

I've spent a week trying to fix this and get that horrible feeling that all 
the work is going down the drain, cos if I dont get this working, I am 
screwed.

I'd be sincerely grateful if someone could help me with this


/*===*/
I put these type of comments around the problem area of the code, which is 
about four lines long near the bottom
/*===*/

Regards

Bren








";


$real[0]=0;
$z=array_pop($real);



$array[0] = 0;
$z = array_pop($array);

/*$real[0] = 0;
$z = array_pop($real);*/


$test[0]=0;
$z = array_pop($test);


/*big loop=*/
for($ws=0;$ws".*/

/*echo"shit";
print_r($c);*/


  for($r=0;$r<=count($c);$r++)
  {
 /*  echo"peaches";
echo"";*/
$m=$c[$r];
echo"M EQUALS"."";
echo"$m";
echo"";
$count=0;







for($j=0;$j";
/*$count=0;*/
if($m[$j]=="-" )
{
$count++;
}



}

  if((($m[0]=="-")AND($count<2))OR($count<1))
{
echo"dumbass";
echo"";
  /*if(count($real)<=4)*/
   {
   array_push($real,$c[$r]);

echo"";
}
  }


elseif(($m[0]=="-")AND($count>1))
{
echo"bla";
echo"";
$ss = explode("-",$m);

for($cnt=0;$cnt";
$ss[$cnt] = "-".$ss[$cnt];


for($waa=0;$waa";
   $ss = explode("-",$m);

for($na=1;$na";
}
}













/*echo"$count";
echo"real";
echo"";
print_r($real); */


}
/*
for($rt=0;$rt0)
{
print_r($real);
echo"";
$poly[$ws][$rt]=array_pop($real);
$rt++;

echo"pink elephants";
/**/
}

}
/*end of big loop*/




echo"real";
echo"";
print_r($real);


echo""."POLY EQUALS";
for($ty=0;$ty<4/*count($poly[$ws][$rt])*/;$ty++)
{
echo""."print loop";
echo $poly[0][$ty];
echo"";
}
echo"";


?>





































_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




[PHP] Desperate!!!!!!! Resource id #24 - error???????????

2002-03-22 Thread brendan conroy

Hi guys,
Thanks for reading this. I desperatley need help with this error. I 
just finished a huge project thats taken me months, my code works, but the 
code its attached to has an error. The project is due Monday and naturally 
enough the guy who wrote the code with the error is gone on holiday for the 
weekend- typical.

Does anyone know what the hell Resource id's are, and why they are showing 
up in my array instead of good ol fashioned numbers?

My array goes (correct)into a function looking like this :

Array ( [0] => Array ( [0] => -1 [1] => 1 [2] => 1 [3] => 1 ) [1] => Array ( 
[0] => -2 [1] => 2 [2] => 2 [3] => 10 [4] => 2 ) [2] => Array ( [0] => -3 
[1] => 3 [2] => 3 [3] => 9 ) ) Array ( [0] => Array ( [0] => -4 [1] => 4 [2] 
=> 4 [3] => 4 ) [1] => Array ( [0] => -5 [1] => 5 [2] => 5 [3] => 5 ) [2] => 
Array ( [0] => -6 [1] => 6 [2] => 6 [3] => 6 ) )

and comes out looking like this:

Array ( [0] => Array ( [0] => Resource id #5 [1] => Resource id #8 [2] => 1 
[3] => 1 ) [1] => Array ( [0] => Resource id #16 [1] => Resource id #17 [2] 
=> 2 [3] => 10 [4] => 2 [5] => ) [2] => Array ( [0] => Resource id #24 [1] 
=> Resource id #25 [2] => 3 [3] => 9 ) ) Array ( [0] => Array ( [0] => 
Resource id #35 [1] => Resource id #36 [2] => 4 [3] => 4 ) [1] => Array ( 
[0] => Resource id #44 [1] => Resource id #45 [2] => 5 [3] => 5 ) [2] => 
Array ( [0] => Resource id #53 [1] => Resource id #54 [2] => 6 [3] => 6 ) )

The Resource id #'s only go into the first two places in the end(third) 
arrays.


I'd really appreciate help with this


Thanks a million



_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




[PHP] Sooo close - please help

2002-03-22 Thread brendan conroy

Hi guys,
   Thanks for reading this. I desperatley need help with this
error. I just finished a huge project thats taken me months, my code works, 
but the code it uses has an error. The project is due Monday and naturally 
enough the guy who wrote the code with the error is gone on holiday for the 
weekend- typical. To be so close to having it finished is sort of 
sickening..

Does anyone know what the hell Resource id's are, and why they are showing
up in my array instead of good ol fashioned numbers?

My array goes (correct)into a function looking like this :

Array ( [0] => Array ( [0] => -1 [1] => 1 [2] => 1 [3] => 1 ) [1] =>Array ( 
[0] => -2 [1] => 2 [2] => 2 [3] => 10 [4] => 2 ) [2] => Array ( [0] => -3[1] 
=> 3 [2] => 3 [3] => 9 ) ) Array ( [0] => Array ( [0] => -4 [1] => 4 [2]=> 4 
[3] => 4 ) [1] => Array ( [0] => -5 [1] => 5 [2] => 5 [3] => 5 ) [2] =>Array 
( [0] => -6 [1] => 6 [2] => 6 [3] => 6 ) )

and comes out looking like this:

Array ( [0] => Array ( [0] => Resource id #5 [1] => Resource id #8 [2] => 
1[3] => 1 ) [1] => Array ( [0] => Resource id #16 [1] => Resource id #17 
[2]=> 2 [3] => 10 [4] => 2 [5] => ) [2] => Array ( [0] => Resource id #24 
[1]=> Resource id #25 [2] => 3 [3] => 9 ) ) Array ( [0] => Array ( [0] 
=>Resource id #35 [1] => Resource id #36 [2] => 4 [3] => 4 ) [1] => Array 
([0] => Resource id #44 [1] => Resource id #45 [2] => 5 [3] => 5 ) [2] 
=>Array ( [0] => Resource id #53 [1] => Resource id #54 [2] => 6 [3] => 6 ) 
)

The Resource id #'s only go into the first two places in the end(third)
arrays.

Heres the other guys code, Im pretty sure the bug is in monic or prodmono as 
they're the functions that deal with the elements that are turned into 
Resource id #'s . I know this is an awful lot to ask,but like I said Im 
desperate

>  function grobmonic($g)
> {
>
>   for($c=0;$c   {
>   $g[$c]=monic($g[$c]);
>   }
> return $g;
> }
> ?>
>
>
>  function monic($p)
> {
>   print_r($p);
>   if(gmp_cmp($p[0][0],$p[0][1])!=0)
>   {
>   $temp[0]=$p[0][1];
> $temp[1]=$p[0][0];
>   $p=prodmono($temp,$p);
>   }
> return $p;
> }
> ?>
>
>
>
>
>  function prodmono($p1,$p2)
> {
>
>   for($a=0;$a {
>
>   $num=gmp_mul($p1[0],$p2[$a][0]);
>
> $den=gmp_mul($p1[1],$p2[$a][1]);
>   $g=gmp_gcd($num,$den);
>   if(gmp_cmp($g,1)!=0)
>   {
>   $num=gmp_divexact($num,$g);
>   $den=gmp_divexact($den,$g);
>   }
>   $res[$a][0]=$num;
> $res[$a][1]=$den;
>   $k=$i=$j=2;
>   while($i   {
>   if($p1[$i]<$p2[$a][$j])
>   {
>   $res[$a][$k]=$p1[$i];
>   $res[$a][$k+1]=$p1[$i+1];
>   $i=$i+2;
>   }
>   elseif($p1[$i]>$p2[$a][$j])
>   {
> $res[$a][$k]=$p2[$a][$j];
> $res[$a][$k+1]=$p2[$a][$j+1];
> $j=$j+2;
> }
>   else
>   {
> $res[$a][$k]=$p1[$i];
> $res[$a][$k+1]=$p1[$i+1]+$p2[$a][$j+1];
> $i=$i+2;
>   $j=$j+2;
> }
>   $k=$k+2;
>   }
>   while($i   {
>   $res[$a][$k]=$p1[$i];
> $res[$a][$k+1]=$p1[$i+1];
> $i=$i+2;
>   $k=$k+2;
> }
> while($j {
> $res[$a][$k]=$p2[$a][$j];
> $res[$a][$k+1]=$p2[$a][$j+1];
> $j=$j+2;
> $k=$k+2;
> }
>   }
>   return $res;
>   }
> ?>
>


I'd really appreciate help with this


Thanks a million







_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: [PHP] storing data from multi-line text boxes into mysql

2002-07-08 Thread Brendan P. Caulfield

try nl2br()

http://www.php.net/manual/en/function.nl2br.php

-brendan

> I want to store user inputed data from a HTML multi-line text box into a
> mysql database.  But unfortunately, it doesn't remember any of the hard
> returnsis there a painless why to do this?
>
> Thanks!




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




[PHP] dumb

2002-07-09 Thread Brendan P. Caulfield

this is dumb.  can we just ignore this and move.  we are all smart enough
to block his posts.  let's just do it and quit wasting all of our time and
get back to doing what we do here.

respectfully,

-brendan



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




[PHP] URL Rewrite Problems...

2001-08-13 Thread Brendan P. Caulfield

Hello Everyone,

I have recently written a script to change htpasswd via a web interface.  
The script is running fine, but all of the variables (by default) are being 
sent in the url.  I have not called any of the URL functions, so I am not 
exactly sure why this is happening.  Is there something in the php.ini or at 
compile time which is enabling this.  The problem ends up being that 
passwords are sent in plain text in the url!

Help!

Brendan

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PDFlib 6 and PHP 4.3.8/9

2004-10-21 Thread Brendan P. Caulfield
Hi Everyone,

I am hoping someone out there may be able to help...

I have recently installed PDFlib 6 and am running PHP 4.3.8.  I am having
trouble with the pdf_open_file() function.  I would like to create a PDF
to memory by leaving the second parameter (filename) in the above function
empty.  However, every time I do this, I get the following error message:

Warning: pdf_open_file() expects exactly 2 parameters, 1 given in xxx

This means I always have to create the PDF file before outputting it to
the browser... which is very annoying.

Has anyone else encountered this?  I have been unable to find much in the
groups to this point!

Thanks in advance for the help.

-brendan

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