[PHP] php.ini

2004-11-16 Thread lister
(on windows) can someone tell me where to define which php.ini gets used?

On my dev box, I installed the zend editor. Now when i do a
  localhost/phpinfo()
from a normal browser window (ie not from within the zend IDE) it says php
is using the <..>/zend/php.ini settings file...

within apache's httpd.conf you can set which php DLL to use, but I cannot
see how php then knows which .ini file to work with? It seems to be
picking up the php.ini from a completely different directory somewhere, so
i am wondering if the zend installer sets some secret registry value that
the php.dll is looking for?

I would have thot something like:

httpd.conf >
  extension=php5.dll

then the dll looks for a php.ini in the same directory.
or does it look in the  or something?


On windows, I installed php/apache etc using the webserv project, if this
is relevant. it seems to give a clean setup of apache, mysql, php etc.

Thanks!

/dc

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



[PHP] latest GD dll binary for windows?

2004-11-16 Thread lister
hi -

is there anywhere I can get a pre-compiled GD (graphics library) DLL for
windows, that supports the GIF writing?
The notices on the GD page say in big letters "not intended for use with
PHP!"...

http://www.boutell.com/gd/

For some reason the PHP install I have (Zend IDE has taken over my
machine!) has an old version of GD...

thanks!

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



Re: [PHP] php.ini

2004-11-16 Thread lister
thanks for the replies, but...

> If there is a php.ini file in the php root directory, then that gets
used. Otherwise, the php.ini file in C:\Windows (iirc).  If the

Actually it seems like the Zend IDE installed another apache server. But
the situation is more confusing.

When I start my standard apache server (dbl-click the binary itself to
make sure no windows services are redirecting), it is not looking for a
php.ini in the same folder as the binary. It reads in
C:/dev/Zend/etc/php.ini

I think I tracked down the issue to setting which httpd.conf apache looks
for. the directory setup is:

apache/
   /conf/httpd.conf

but this file seems to not be getting used, rather it is using the other
apache install...

1 apache binary
  2 looks for an httpd.conf (search order?)
3 which has a line where to load a php.dll
  4 php.ini is looked for next to the php.dll
 5 php.ini says where to find other php extensions etc.

so somewhere tween 1 and 2 there is a redirect i cannot track down.

i guess its not really a PHP issue, more an apache/zend IDE installer
thing but appreciate any tips...

/dc


>
>> On my dev box, I installed the zend editor. Now when i do a
>>   localhost/phpinfo()
>> from a normal browser window (ie not from within the zend IDE) it says php
>> is using the <..>/zend/php.ini settings file...
>
> This is because that's the file that it found first (ie, search order).
Zend installs its own php binaries (unless you do a custom setup).

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



[PHP] Failed error_log directive

2003-12-27 Thread Aidan Lister
Hello,

I am trying to log all php script errors from a virtualhost to a file.
A callback function is not the solution I am looking for.

I have tried to the following settings in my httpd.conf (apache) to no
avail.

php_admin_flag display_errors off
php_admin_flag log_errors on
php_admin_flag error_log /tmp/phplog

When an erroneous file is viewed, errors are not displayed (as expected),
however the file /tmp/phplog is not created.

I'd be grateful for any help.

Thank you.

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



[PHP] Re: connecting to progress db

2003-12-30 Thread Aidan Lister
Hi,

"Php" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> I am not sure how to go about this. =( I think my problems are twofold.
>
> problem 1. I have to connect to a progress database, for which there is
> no built-in php
> support. I have been looking at the unified ODBC functions, but progress
> isn't
> one of the supported dbs there either.

I've never heard of this sort of database, but I'd be checking with them for
any drivers, and then google.

> problem 2. the db is not specifically a web db. It is the clients'
> production db that
> is located on their facility and it is behind a firewall. I know I will
> get a performance
> hit with this setup, but I can live with this.

No database is a "web db".
If the database 'progress' has a server, then you can probably connect to it
somehow via the web. If it doesn't have a server (ie Filemaker pro, etc),
then you cannot connect via the web.

> question 1: do I need a progress driver, or do the ODBC functions take
> care of that?

Check the ODBC documentation.

> question 2: is it possible for the db connection to get thru a firewall,
> and then connect
> to a db?

No, a firewall blocks all incoming connections unless specifically told not
to do so. You'll have to arrange to allow connections from your IP/Port
through the firewall.

>
> TIA,
> Craig


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



[PHP] Re: PHP5 XML functions

2003-12-30 Thread Aidan Lister
I wish, I'm interested as well :/

<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> I've just gotten PHP5 B3 working using the precompiled binaries under Win
XP,
> but the dom xml functions of PHP4 don't seem to be immediately available.
> Does anyone have suggestions on how to learn to use the new XML
functionality?
> The source code?
>
> Greg Steffenson
>

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



[PHP] Re: Failed error_log directive

2003-12-30 Thread Aidan Lister
I still have not found a solution to this problem. What are some debugging
steps I could take?


"Aidan Lister" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I am trying to log all php script errors from a virtualhost to a file.
> A callback function is not the solution I am looking for.
>
> I have tried to the following settings in my httpd.conf (apache) to no
> avail.
>
> php_admin_flag display_errors off
> php_admin_flag log_errors on
> php_admin_flag error_log /tmp/phplog
>
> When an erroneous file is viewed, errors are not displayed (as expected),
> however the file /tmp/phplog is not created.
>
> I'd be grateful for any help.
>
> Thank you.

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



[PHP] Re: No COOKIE Set?

2003-12-31 Thread Aidan Lister
Try putting the exit() before the redirect, and see if there's an error when
you attempt to set the cookie.


"Cesar Aracena" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> My head is about to explode here... I am trying to setup a cookie for
every
> new user that registers in my site and right after that, to send them to
the
> home page... is that so difficult? apparently yes... It does redirect, but
> when I try to "echo" the $MemberId cookie with:
>
> echo $_COOKIE["MemberId"];
>
> Nothing happens... nothing is displayed... also, I can't find where these
> cookies are being stored. I am developing under WinXP, latest PHP and
latest
> MySQL... other cookies are being stored very well, but I don-t know
where...
> I'm displaying at http://localhost/. ¿¿¿???
>
> Here's my script:
>
>if ($use_same_data == "yes") // One kind of information stored
>{
>$query = "INSERT INTO members_info ... )";
>$result = mysql_query($query);
>$id = mysql_insert_id();
>}
>
>elseif ($use_same_data == "") // Other kind of choice of information
for
> shipping address
>{
> $query = "INSERT INTO members_info ...)";
> $result = mysql_query($query);
> $id = mysql_insert_id();
>}
>
>if (!$result)
>{
> echo "Error code here";
>}
>else
>{
> setcookie ("MemberId", $id, time()+31536000);
> header ("Location: $CFG->wwwroot");
> exit();
>}
>
> Thax in advanced,
>
> Cesar

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



[PHP] Production Websites (error loggin)

2004-01-02 Thread Aidan Lister
If anyone has successfully got php error logging working on a production
website, could you please reply with the steps taken?

I'm using RH7.3, Apache1.3x, PHP4.3x

My php.ini has:

log_errors = On
error_log = /var/log/httpd/php/error_log

However the errorlog is never created.

Thanks for any help.

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



Re: [PHP] example of posting board or shoutbox

2004-01-02 Thread Aidan Lister
Austin,

We're not here to write scripts for you, I suggest you start by reading the
manual at php.net. After you have a basic idea of how to use PHP, try
looking at a couple of examples online. Use google, and search for "Database
driven websites".

Another option is to use a pre-made shoutbox, again try google.com


"Austin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> ya, i want to do it in php with a submit, altho i dont know how =\.
> can u send me examples of what the code would look like and explain it,
> Thank you!
>
> Vail, Warren wrote:
>
> >Not sure I fully understand your problem, but if you are trying to simply
> >move information from one area of a form to another, without doing a form
> >post, then you might consider a javascript solution.  This will happen
> >almost instantaneously, since it all occurs on the browser machine.
> >
> >In order to use PHP, you will need to cause a form post (a submit) to
occur
> >to get the contents of your form elements to the server with the PHP
code,
> >where your code will take the form contents and echo the form html back
to
> >the browser with your data moved to the textarea like you want.
> >
> >hope this helps,
> >
> >Warren Vail
> >
> >-Original Message-
> >From: Austin [mailto:[EMAIL PROTECTED]
> >Sent: Friday, January 02, 2004 5:29 PM
> >To: [EMAIL PROTECTED]
> >Subject: [PHP] example of posting board or shoutbox
> >
> >
> >how do i make something where some1 enters text, a name, and email
> >address, etc. and can post it onto a textarea or something, in a format
of
> >
> >Name
> >Email(mailto link)
> >Message here
> >[If admin: link here to delete post]
> >Ending line that seperates each post-
> >[ admin login at bottom ]
> >
> >
> >i know this is  allot to explain,
> >i am new to php,
> >
> >-thank you
> >-Austin
> >
> >
> >

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



Re: [PHP] Production Websites (error loggin)

2004-01-03 Thread Aidan Lister
I can't belive it...

I checked the file permissions on so many occasions, I even used
/tmp/phperror_log just to make sure (why that doesn't work I'm not sure).

However sure enough, the directory wasn't world writeable.

Thanks Marek, I really appreciate your help.


"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Does apache have permissions to write to the file and directory?
>
> Aidan Lister wrote:
> > If anyone has successfully got php error logging working on a production
> > website, could you please reply with the steps taken?
> >
> > I'm using RH7.3, Apache1.3x, PHP4.3x
> >
> > My php.ini has:
> >
> > log_errors = On
> > error_log = /var/log/httpd/php/error_log
> >
> > However the errorlog is never created.
> >
> > Thanks for any help.
> >

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



[PHP] Re: How to do this? 6 lines of code...Parse error

2004-01-03 Thread Aidan Lister
Firstly I'd rewrite your other script to store the data in an array.

The benefits of doing so are simply demonstrated:



However, if you are unable to rewrite your script:

The correct syntax is:


"Ryan A" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> am a bit confused as to how you do this...first let me explain the flow of
> input:
> I will be getting $product1,$product2,$product3 etc from another
script...I
> dont know till what numberright now I am trying to catch the values
till
> 20 with a "for" loop.
>
> My problem is how do I attach the $i that I am using to the $product to
> check if its set? Heres my code and below that you will see some of the
> stuff I have tried:
>
>
> for($i=1; $i<21; $i++)
> { if(isset($product$i))
>  {echo "Product".$i." is set!";}
>  else(!isset($product$i))
>   {echo "Product".$i." is NOT set!";}}
> exit;
>
>
> This is what I have tried (in the if-isset part) :
> $product.$i
> $product."".$i
> $product.''.$i
> $product($i)
>
> all of the above give me a parse error.
>
> Any help appreciated.
>
> Thanks,
> -Ryan
> P.S, I didnt write the other script where I am getting the values from...I
> just have to work with it as they are not allowing me to touch the older
> script so I dont have access to it.

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



[PHP] Re: php_hostconnect()

2004-01-11 Thread Aidan Lister
It sounds like your script is poorly written.

On one server, error reporting is set to E_ALL (All errors and warnings). On
the other, It's probably set to E_ERROR.

Check out php.net/error_reporting


"Anthony Ritter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I currently have websites with two ISP's.
>
> I am getting a lot of warnings throughout a .php script on one server -
such
> as:
>
> php_hostconnect()
>
> I have used the _same_ .php script exactly on my other ISP's server and I
> don't get any warnings.
>
> In addition, I have tested this script locally on Apache server without
any
> errors.
>
> The site where I do not get warnnings has php 4.1.1 installed - wheras the
> other site where I get php_hostcoonect() warnings is php 4.2.3
>
> Any help will be greatly appreciated.
>
> Thank you.
> Tony Ritter

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



[PHP] PHP5: XML to PDF with XSL

2004-01-20 Thread Aidan Lister
Is this possible?

I'm purely interested in PHP5 examples of transforming an XML file into PDF
using an XSL stylesheet.

Thanks.

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



Re: [PHP] Problems with $_POST

2004-01-21 Thread Aidan Lister
Or,

After you've dumped the data into the DB, issue a header('location:
/path/to/script');

This will also solve the problem of IE saying "are you sure you want to
resend the form data".


"Toby Irmer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> You can use a token to check if a form has been sent before...
>
>  class formReload {
>
>  var $tokenarray = '__token';
>  var $tokenname = '__token';
>
>  function createToken()
>  {
>   $tok = md5(uniqid("mytoken"));
>   return sprintf(" value='%s'>",$this->tokenname,htmlspecialchars($tok));
>  }
>
>  function easyCheck()
>  {
>   $tok = $_REQUEST[$this->tokenname];
>   if (isset($_SESSION[$this->tokenarray][$tok]))
>   {
>return false;
>   }
>   else
>   {
>$_SESSION[$this->tokenarray][$tok] = true;
>return true;
>   }
>  }
> }
> ?>
>
> hth
>
> toby
>
>
> - Original Message -
> From: "Binay" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; "Reidar Solberg" <[EMAIL PROTECTED]>
> Sent: Wednesday, January 21, 2004 9:23 AM
> Subject: Re: [PHP] Problems with $_POST
>
>
> Hi
>
> What is the primary key in your tble? Using tht primary key check for
> duplicate entry... Theres no way u can change the posted data ... so even
if
> u reset $_POST['submit']  after the insert operation is done, next time u
> refresh it will be set and hence will duplicate...so check for duplicate
> entries urself only based on primary key or unique values in ur table.
>
> Hope this helps
>
> Cheers
> Binay
>
> U wrote..
> <
> I have a FORM for entering data into a DB.
>
> I use:
> ...
> ...
> if ($_POST['submit'] == 'Register') {
> ...
> code for INSERT into DB.
>
> This works OK, but if I REFRESH the page, it  duplicates the "dataset" in
> the table.
>
> How can I reset  $_POST['submit']  so it don't make this happen?
>
> Rgds
> Reidar Solberg
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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



Re: [PHP] PHP 5 Book

2004-01-21 Thread Aidan Lister
I'm using 4.1 alpha now - It is stable enough for a dev box - Nested queries
are good fun.


<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > Speaking of MySQL, I heard tale that 5.0 would include VIEWS, but I
> > can't find that in any of the new features logs.  Anyone know about
> > this?  It'd be a great feature to have.  Unless, of course, anyone
> > knows  how to do this without a "CREATE VIEW" statement.
> >
> > -Ben
>
> Its a terrible annoyance waiting for open source code to mature, you just
> wish you could help out in some way to speed up the process. It did say
> views was in 5.0, now its 5.1, stored procedures and triggers will be in
5.
> I'm sure there is a work around creating temporary tables ? I've never
used
> msql before so what exactly benificial will views have ? I'm hanging out
> for 4.1 so i can do nested queries.

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



[PHP] XSL

2004-01-24 Thread Aidan Lister
I am attempting to put this in my XSL, ">, However I get a ton of errors. How do I do this properly?

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



[PHP] Re: "Additional Features for working with linked Tables have been deactivated."

2004-01-24 Thread Aidan Lister
How about checking the phpmyadmin documentation, where this is all clearly
explained?


"Freedomware" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> It looks like all the databases I view with phpMyAdmin feature the
> following error message:
>
> "The additional Features for working with linked Tables have been
> deactivated. To find out why click here."
>
>
> When I click the link, I get this:
>
> Database mysql  running on localhost
> $cfg['Servers'][$i]['pmadb'] ... not OK [ Documentation ]
>
> $cfg['Servers'][$i]['relation'] ... not OK [ Documentation ]
> General relation features: Disabled
>
> $cfg['Servers'][$i]['table_info'] ... not OK [ Documentation ]
> Display Features: Disabled
>
> $cfg['Servers'][$i]['table_coords'] ... not OK [ Documentation ]
> $cfg['Servers'][$i]['pdf_pages'] ... not OK [ Documentation ]
> Creation of PDFs: Disabled
>
> $cfg['Servers'][$i]['column_info'] ... not OK [ Documentation ]
> Displaying Column Comments: Disabled
> Bookmarked SQL-query: Disabled
> MIME ... not OK [ Documentation ]
> $cfg['Servers'][$i]['history'] ... not OK [ Documentation ]
> SQL-history: Disabled
>
>
> Rather than troubleshoot all seven of these, can you see any evidence of
> a central problem that might be causing it? Or is there some way to work
> around it?
>
> Thanks.

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



[PHP] Re: XSL

2004-01-25 Thread Aidan Lister
Ahh fantastic. Thanks very much for that.



"Tobias Bradtke" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Aidan Lister wrote:
> > I am attempting to put this in my XSL,  > />">, However I get a ton of errors. How do I do this properly?
>
>
> try something like this:
>   
>
> or this:
>   
>  />
>   
>
> (^untested, but this is the way to do it in xsl..)
>
> look here: http://www.w3.org/TR/xslt#dt-attribute-value-template
>
>
> greetz!
> webwurst

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



[PHP] Re: PHP integration with ASP

2004-01-25 Thread Aidan Lister
I'm not sure if anyone else understood what you're trying to do better than
I did, but it sounds like you're not to sure about php/html.

To get the results of a form, you need to search the POST array.

var_dump($_POST);

As to the rest of the questions, I really don't understand what you're
talking about.

"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I am working on an integration between my PHP site and an ASP site with XML.
The basic flow is this:  I generate a request by placing XML into the value
portion of an input tag called ³REQUEST² the action is the url of the remote
ASP server which receives the request.  It then returns a form with the same
³REQUEST² input tag with the XML as the value.  My problem is getting the
XML that is posted to the form.  The confusing thing is that once I receive
the XML data I am no longer in my site.  The header information changes to
the URL that sent the data.

I am not sure how to capture the data that is returned by the server. I have
a procedure that puts XML data into my db from file.  But I'm not sure how
to get this result into a file.

The ASP example that I am changing to PHP is Request.Form("Results")
basically it gets the form's Results variable...  How can you do that in PHP
when nothing has been sent to the server??  Any insight would be very
helpful...

My code is below:

Code that generates the request:

$doc = domxml_new_doc('1.0');
$top_element = $doc->add_child($doc->create_element('ExchangeRequest'));

$login_data_node =
$top_element->add_child($doc->create_element('LoginData'));
$login_data_node->set_attribute("UserName", "uname");
$login_data_node->set_attribute("Password", "pass");

$request_node = $top_element->add_child($doc->create_element('Request'));
$request_node->set_attribute("Type", "RetrieveNewSearches");

//echo "Comment: "; print(htmlentities($doc->html_dump_mem(true)));
echo ""; die;

$xml = $doc->html_dump_mem();
$ns = strtr($xml, "\"", "'");

//echo "Comment: "; print($ns); echo ""; die;

$html = "

https://remoteaspserver/action.asp\";>





";

print($html);


Code received by server:








Thanks for your help!
/Tim Best

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



Re: [PHP] Re: XSL

2004-01-25 Thread Aidan Lister
I'll tell you the reasons I am doing it, then some other useful information.
You can make your own mind up.

The company I work for receives publications from all over the world, these
publications are usually word documents or HTML docs.
Most of the papers come through with an excessive amount of HTML mark-up,
and poorly defined HTML trees (no h1/h2/h3, etc).

After spending many hours formatting papers into raw semantic html (removing
all html mark-up, and allowing the CSS to format it properly) I decided
there must be a better way. I thought about storing the info in a database,
but decided it would be too complicated to move about. XML was the way to
go.

After converting my first paper to XML, I then attempted to format it with
XSL. The power I had over the article now was breath taking. I could do
whatever manipulations I wanted (generate a contents page, show only the
abstract, show more detail about the authors...) simply by changing the XSL
style.

Why do this with XSL, and not hardcore it in PHP using an XML parser?
XSL is now a web standard. I can port this XSL stylesheet to any server,
with or without php support. (although browsers don't like doing the
transformations themselves completely yet, although IE is pretty close). It
just made sense.

As for converting an entire website, that's up to you - I haven't, but I am
thinking about it.

Here is some reading material:
http://pawscon.com (recently converted the entire site to XML/XSL. A big
move from the "Php and web standards" group.
http://www.webmasterbase.com/article/595
http://www.sitepoint.com/article/602




<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> May i ask, what is a good purpose for xsl apart from syndication, is it
> worth it for building an entire site in or a content management system ?
> Like i found generating the xml, then having to do loops and stuff in xsl,
> having no control in php a real pain.
>
> > Ahh fantastic. Thanks very much for that.
> >
> >
> >
> > "Tobias Bradtke" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >> Aidan Lister wrote:
> >> > I am attempting to put this in my XSL,  >> > />">, However I get a ton of errors. How do I do this properly?
> >>
> >>
> >> try something like this:
> >>   
> >>
> >> or this:
> >>   
> >>  >> />
> >>   
> >>
> >> (^untested, but this is the way to do it in xsl..)
> >>
> >> look here: http://www.w3.org/TR/xslt#dt-attribute-value-template
> >>
> >>
> >> greetz!
> >> webwurst
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php

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



Re: [PHP] Should I wait for PHP 5.1?

2004-08-02 Thread Aidan Lister
http://php.net/migration5

5.0.1 is coming out shortly, wait for that.


"Gerard Samuel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sunday 01 August 2004 12:19 pm, Randall Perry wrote:
> > Any major gotchas going from 4 to 5? Any problems with PostgreSQL
> > connectivity? Will I have to scour and rewrite current scripts?
> >
>
> My opininon would be to wait on maybe 5.0.1, especially if its on a
production
> box.  Im not having an absolute blast with it on my dev boxes...

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



[PHP] Bouncer Test

2004-08-08 Thread Aidan Lister
Please do not reply to this email, or you will be taken off the mailing list.

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



[PHP] Re: PHP and Apache 2

2004-08-08 Thread Aidan Lister
Hi Rosen,

It doesn't hurt to use google you know.

[Q:]
Is there going to be a version of PHP 4.x which is declared stable for use
with Apache 2.x or, is this feature going to be reserved for PHP5?

[A:]
The development of the Apache 2 module is completely disconnected from the
PHP 5 efforts. I think that these efforts have slowed down to a halt, mostly
because of lack of interest in the PHP development community, mostly because
the only reliable way of using PHP and Apache 2 together is using the
prefork MPM, which is effectively very similar to Apache 1. Good Apache 2
connectivity is going to come at some point, but I'm not exactly sure when
it would be.


Basically PHP isn't threadsafe, and Apache2 uses threads.

I hope that helps.


"Rosen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> What is the reason, thath in the installation manual of PHP writes:
> "WARNING:
> Do not use Apache 2.0 and PHP in a production environment neither on Unix
> nor on Windows. "
>
> Thanks,
> Rosen

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



[PHP] Re: why use http headers??

2004-08-10 Thread Aidan Lister
Hi Tobias,

I don't really understand what you are asking, but if you want to send HTTP
headers please see:
www.php.net/header

If you need "Arguments for http headers", see the protocol specification
http://www.faqs.org/rfcs/rfc2616



"Tobias grønlund" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hey people,
>
> i need some help. Im missing some arguments for using http headers,
> especially "content-length", for speeding up a site or just improving
> the quality of a site :)
>
> any comments appreciated...

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



[PHP] Re: GENERAL DIGEST MAILLIST ALLOWS POST

2004-08-10 Thread Aidan Lister
Alfonso,

Please stop sending crap to this list, or you will be unsubscribed.

We're more than happy you've been able to sign up, but we don't need 4
emails detailing your progress.

Kind Regards,
Aidan


"Alfonso Baqueiro" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> If you are viewing this, means that been suscribed only to the
> general-digest, you are able to post.
>
> This is very useful for mozilla clients, cause you have mozilla to see
> the message list for new messages without the inconvenience of recieving
> a lot of mail daily.
>
> :)

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



[PHP] Re: PHP 4 equivalent for convert_uuencode

2004-08-10 Thread Aidan Lister
Hi Vidyut,

This function will be replicated in userland code when I get some more time,
I'll add a note when it is done.

For more info, see http://pear.php.net/php_compat




"Vidyut Luther" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>  I'm looking at the PHP manual which has
http://us3.php.net/convert_uuencode
> convert_uuencode as a function, but it's only a PHP 5 function. Is
> there a PHP 4 equivalent for this function ?.
>
> Really appreciate any help on this.
>
> -- 
> Vidyut Luther

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



[PHP] Re: define constants within functions?

2004-08-10 Thread Aidan Lister
Sure, define them outside the function :)


"Justin French" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> If I define a constant within a function, it appears that the constant
> is only defined within the namespace of the function.  Fair enough.
>
> Can I globalise these definitions?
>
> ---
> Justin French
> http://indent.com.au

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



[PHP] Re: Date and time

2004-08-11 Thread Aidan Lister
That's a mysql timestamp, if you want to manipulate dates in PHP you'll need
to use unix timestamps.

You have a couple of options,
select unix_timestamp(myFld) as myFld from myTbl

Then just add 60*60*24*7 to it.

Or, parse it with:
function convert_timestamp ($timestamp)
{
   $timestring = substr($timestamp,0,8)." ".
 substr($timestamp,8,2).":".
 substr($timestamp,10,2).":".
 substr($timestamp,12,2);

   return strtotime($timestring);
}


"Diff Fannehh" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I have this date in timestamp format:
>
> $a= 20040810114155;
>
> I want to add 7 days to this date. How can i do that?
>
> Thanks
>
>
>
> 
>
> Home, no matter how far...
> http://www.home.ro

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



[PHP] Re: Date and time

2004-08-11 Thread Aidan Lister
There was a little mistake in the code I posted before, try this one:

http://aidan.dotgeek.org/lib/?file=function.convert_timestamp.php


"Diff Fannehh" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I have this date in timestamp format:
>
> $a= 20040810114155;
>
> I want to add 7 days to this date. How can i do that?
>
> Thanks
>
>
>
> 
>
> Home, no matter how far...
> http://www.home.ro

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



[PHP] Re: oop too slow

2004-08-19 Thread Aidan Lister
Krzysztof,

Take a look at some PHP Profiling extensions, such as Advanced PHP Debugger
or XDebug. This will help you locate the slow parts of your script.



"Krzysztof Gorzelak" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi
> I'm trying my new php5 script, but it takes about 1.2s to generate my
page.
> That is, how my oop model looks like :
>
> [category]
> |||
> [photo]  [desc]   [products]
>
>
> [products]
> |
> [product]
> |||
> [photo] [desc] [keys]
>
>
> [keys]
> |
> [key]
> |
> [values]
> |
> [value]
>
> Each object gets data from mysql by itself. The generation time of 1
> category [30 products, 10 keys, 5 values ~= 300 mysql queries] takes as I
> said more than a 1s (on quite fast machine). How can this model be
improved?
> Do I create too many objects ? What are the oop solutions for such problem
?
>
> I also use an extra table to create many-to-many relation betwean a
product
> and a key. Is this the only way in mysql ?
>
> [product]
> |
> [product_id, key_id]
> |
> [key]
>
>
> Thanks a lot help
> Krzysztof Gorzelak
> [EMAIL PROTECTED]


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



[PHP] Re: for loops performance

2004-08-21 Thread Aidan Lister
Hi Tadas,

PHP5 has very optimised code for loops, try upgrading and tell us how it
goes!

Also, if it's applicable, a plain "foreach" loop is actually faster.

Kind Regards,
Aidan


"Xongoo!Com: Central Unit" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Holla,
>
> Maybe someone knows how to improve for loops
> performance? When generating 1000's of pages, it
> oads in 10-20 seconds. Maybe there is some
> solution I don't know about?
>
> Thanks!
>
> --
> Tadas Talaikis
> [EMAIL PROTECTED]
> http://www.xongoo.com

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



[PHP] Bouncer Test

2004-08-28 Thread Aidan Lister
Hello,

Another test to ensure we don't have any automatic replies or bouncing
addresses. Please don't reply, or you will be removed.

Thanks

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



[PHP] Re: data grids...

2004-09-08 Thread Aidan Lister
http://pear.php.net/package/Structures_DataGrid


"Blackwater Dev" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Does anyone have a nice clean way to provide data grids with php short
> of simply creating a bunch of input boxes or using flash?
>
> Thanks! 

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



[PHP] Re: how to load extensions outside the extension_dir

2004-09-10 Thread Aidan Lister
You can't,

It's a security thing.


"Marten Lehmann" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hello,
>
> I need to load extensions with dl() within PHP running as CGI. But as this 
> is a shared hosting environment, I don't have access to the extension_dir. 
> Anyway, dl() prepends /lib/php/extensions/ 
> --ZEND_MODULE_API_NO if I'm calling 
> dl("myext.so"); even if I'm starting with a slash. How can I disable this?
>
> Regards
> Marten 

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



Re: [PHP] Quick file_get_contents() questions...your opinion needed

2004-10-11 Thread Aidan Lister
If you want to use older functions without upgrading your version of PHP, 
try PHP_Compat.

Here's file_get_contents which is comparable in speed to the native version:
http://cvs.php.net/co.php/pear/PHP_Compat/Compat/Function/file_get_contents.php?r=1.19

Most information can be found at http://pear.php.net/php_compat


"Mag" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> Hey,
>
>> On Mon, 11 Oct 2004 07:24:03 -0700 (PDT), Mag
>> <[EMAIL PROTECTED]> wrote:
>> > $url=file_get_contents("http://www.yahoo.com/";);
>> >
>> > The thing is, it takes quite some time (2-5 secs)
>> > before the contents are in my program (I am using
>> my
>> > local webserver on my desktop for testing...not a
>> > webserver)
>> >
>> > My questions are for you more experienced guys...
>> > is there anyway to 'quicken' the process or is
>> this
>> > normal?
>> > do you recommend anything other than
>> > file_get_contents() ?
>> > and lastly, is this a resource intensive hog?
>
>
>
>> The 2-5 seconds is most likely a DNS lookup.  You
>> can speed it up by
>> using a local caching DNS server or the IP address,
>> or possibly a DNS
>> server under less load.
>
>
> Thats kind of what I thought, but wanted to confirm.
>
>
>> file_get_contents() is fairly new and and therefore
>> not very backwards
>> compatible with older PHP installs as a result.
>> It's handy and all,
>> but I found our production servers were running a
>> PHP too old to use
>> it one day last week when I tried.
>
> Interesting, so what is more backwards compatable? or
> to put it in another way, what did you change on your
> servers so that your app worked without
> file_get_contents?
>
> Thanks,
> Mag
>
> =
> --
> - The faulty interface lies between the chair and the keyboard.
> - Creativity is great, but plagiarism is faster!
> - Smile, everyone loves a moron. :-)
>
>
>
> __
> Do you Yahoo!?
> Yahoo! Mail Address AutoComplete - You start. We finish.
> http://promotions.yahoo.com/new_mail 

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



Re: [PHP] PHP5 Type Hints

2004-10-02 Thread Aidan Lister
Hi Gerald,

If you did see something like that, it was a mistake in our manual :)

I've documented typehinting now, though it will take a while to show up in 
the manual.
http://php.net/language.oop5.typehinting

Kind Regards,
Aidan


"Gerard Samuel" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Curt Zirzow wrote:
>> * Thus wrote Gerard Samuel:
>>
>>>Im unable to find documentation on this.
>>>Does one exist?  If so can you point me to it.
>>
>>
>> I dont think anything officially exist in the manual, yet. The type
>> hint can only be an Object, and will cause a fatal error if not the
>> paticular object isn't passed.
>>
>
> Thanks.  I could have sworn, I saw something somewhere,
> that led me to believe that arguments can be casted.
> I.E.
> function foo(int $foo)
> {
> // $foo will be casted as an integer
> } 

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



[PHP] Regular Expression - highlighting

2004-10-02 Thread Aidan Lister
Hello list,

I'm pretty terrible with regular expressions, I was wondering if someone 
would be able to help me with this
http://paste.phpfi.com/31964

The problem is detailed in the above link. Basically I need to match the 
contents of any HTML tag, except a link. I'm pretty sure a lookbehind set is 
needed in the center (%s) bit.

Any suggestions would be appreciated, but it's not quite as simple as it 
sounds - if possible please make sure you run the above script and see if it 
"PASSED".

Here's a little gui to make it easier to test:
http://aidan.dotgeek.org/test_hl.php

Thanks in advance,
Aidan 

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



Re: [PHP] Regular Expression - highlighting

2004-10-07 Thread Aidan Lister
Hi Michael,

Thanks very much for the assistance, I'll have to investigate further!

Kind Regards,
Aidan Lister


"Michael Sims" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Aidan Lister wrote:
>> Hello list,
>>
>> I'm pretty terrible with regular expressions, I was wondering if
>> someone would be able to help me with this
>> http://paste.phpfi.com/31964
>>
>> The problem is detailed in the above link. Basically I need to match
>> the contents of any HTML tag, except a link. I'm pretty sure a
>> lookbehind set is needed in the center (%s) bit.
>>
>> Any suggestions would be appreciated, but it's not quite as simple as
>> it sounds - if possible please make sure you run the above script and
>> see if it "PASSED".
>
> So basically, you want to put a link around "foo", only if it doesn't
> already have one, right?
>
> The problem with look-behind assertions is that they have to be 
> fixed-width.
> If you're certain of what kind of data you're going to be dealing with 
> then
> this may be sufficient.  For example, I came up with a regex that will 
> PASS
> your script but I doubt seriously that it'll be very useful to you as it
> would be easy to break it by coming up with various test cases.  For your
> single test case, however, this works:
>
> /(?)(?
> The problem is that HTML tags can be split across lines...they have have 
> any
> variable amount of whitespace within the tag...they can have other
> attributes (class, id, onClick), etc.  Since look behind assertions have 
> to
> be fixed width it'd be impossible (IMHO) to come up with a single regex 
> that
> would match all cases, unless the input data was uniform.  For example,
> stuff like
>
>  onClick="javascript:someFunction();">foo
>
> and its infinite variants could not be trapped for with a single regex 
> since
> you cannot have an infinite number of fixed width look-behind assertions.
> If quantifying modifiers such as '*', '+', and '?' were allowed in
> look-behind assertions it would be possible, but they aren't (see "man
> perlre").
>
> If your data is coming from unknown sources you'll probably have to use a
> full fledged HTML parser to pull out text that isn't already part of an 
> 
> tag.  I know there are several of these available for perl and I'm sure
> there are for PHP too but I'm unaware of them.
>
> Sorry if this isn't terribly helpful.  Maybe I'm overlooking something and
> someone else will point out a simple way to accomplish what you're trying 
> to
> do... 

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



[PHP] Re: Callback functions inside classes - how to?

2004-10-08 Thread Aidan Lister
http://php.net/language.types.html#language.pseudo-types

"Thomas Hochstetter" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi again,
>
> I have always been wondering how this is done properly:
>
> Here is an example:
>
> [snip]
> class A {
>   function name( $a, $b, $c) {
>  $tmp = array();
>  $tmp[a] = $a;
>  .
> array_push( $GLOBALS['XMLStack'], $tmp );
>  }
>
>  function parse() {
>.. some definitions .
>$parser->set_handler( "root/page/title", "name" );
>   . some more stuff here .
>  }
> }
> [/snip]
>
> What I want is to have the callback function name as it is in the above
> example. But, obviously, the above code won't work. So, how do I tell the
> set_handler function that it must use the name function from the class?
> Using:
> "A::name" or "$this->name" (if instantiated) . how do these callback
> function calls work, because the same issue is with the xml handler
> functions in php4 (have not as yet been to v5).
>
> Also, how can I get the data from the callback function out without using
> $GLOBALS? I cannot just return an array, can I?
>
> Any ideas.
>
> Thanks so  long.
>
> Thomas
> 

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



[PHP] Re: PHP Designer 2005

2005-04-26 Thread Aidan Lister
Contact the company who wrote the software you're trying to use for support.


"The Disguised Jedi" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
Some might consider this OT, but I need to figure this out somehow, and
google has been no help.

I downloaded and installed PHP Designer 2005, and I really like it so far,
but I'm having some problems. Any time it is running, my CPU Usage goes up
to 100% and the process "phpDesignerPrg.exe" is the culprit. My fan kicks
into overdrive, and my laptop gets really warm. The funny thing is, any time
another process tries to do something, phpDesigner shrinks into the
background, and uses almost no CPU, only to crawl back up to 100% after the
other process is finished.

Anyone here had this problem before? Anyone here know how to fix it?

Thanks for replying even if this is a little off-topic...

-- 
The Disguised Jedi
[EMAIL PROTECTED]

Now you have my $0.02. Or .01 Pounds, .014 Euros, or $0.025 CAN. I'm
world-wide BABY!
PHP rocks!
"Knowledge is Power. Power Corrupts. Go to school, become evil"

Disclaimer: Any disclaimer attached to this message may be ignored. However,
I must say that the ENTIRE contents of this message are subject to other's
criticism, corrections, and speculations.

This message is Certified Virus Free

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



[PHP] Re: Help outputting an array?

2005-04-26 Thread Aidan Lister
Hi Brian,

Try this function,
http://aidan.dotgeek.org/lib/?file=function.array2table.php


"Brian Dunning" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi all - it seems the longer I use PHP, the stupider my questions are 
> getting. I finally got my XML parsed into an array, but perhaps my  skills 
> at dealing with the array are not where I thought they were.  My array 
> print_r's out like this:
>
> Array
> (
>   [PARAS] => Array
> (
>   [PARA] => Array
> (
>   [__multi] => 1
> [0] => Array
>   (
> [NOTE] => Here is my first note.
> [TITLE] => Here is my first title.
>   )
> [1] => Array
>   (
> [NOTE] => Here is my second note.
> [TITLE] => Here is my second title.
>   )
> )
> )
> )
>
> I just want to loop through the array and output it as a table. It  would 
> look something like this:
>
> Here is my first note.Here is my first title.
> Here is my second note.Here is my second title.
>
> What incredibly easy way to do this am I just missing? Thanks!  :) 

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



[PHP] Re: PHP5 and pear

2004-04-10 Thread Aidan Lister
Was that from a > pear install xml_rpc ?



"Electroteque" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Pear does not seem to be actually in the sources for some reason
>
> [PEAR] XML_RPC: The following errors where found (use force option to
> install an
> yway):
> missing package name
> missing summary
> missing description
> missing license
> missing version
> missing release state
> missing release date
> missing release notes
> no maintainer(s)
> no files
>
> did this for all of them ??

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



Re: [PHP] mysql connect function in my class

2004-04-15 Thread Aidan Lister
I suggest you take everyone's advice and use one of the thousand database
abstraction objects.

At the very least, look at how they are put together.

This one is an excellent example:
http://pear.php.net/package/DB


"Andy B" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> makes since... i think would i would probably do is  define the
> error/errormsg stuff at the beginning of the class that way all functions
> can use it??
>
> class DbConnection {
> var $ErrorNumber;
> var $ErrorMsg;
> function Connect(.){
> $link=mysql_connect(...);
> if(!$link){
> $ErrorNumber=mysql_errno();
> //and the msg itself if we want
> $ErrorMsg=mysql_error();
> return false;}
> else{return $link;}}
>
> or however the best way goes for that...
>
> - Original Message - 
> From: "Curt Zirzow" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, April 15, 2004 1:35 AM
> Subject: Re: [PHP] mysql connect function in my class
>
>
> > * Thus wrote Andy B ([EMAIL PROTECTED]):
> > > hi
> > > i have this function inside a class that im writing that eventually i
> want
> > > to put inside a package of my own... the function goes like this:
> (comment
> > > block included):
> > >
> > > /**
> > > *function Connect: open connection to database.
> > > *
> > > [EMAIL PROTECTED] string $host mysql hostname to connect to
> > > [EMAIL PROTECTED] string $mysqluser name of the mysql user to login with
> > > [EMAIL PROTECTED] string $mysqlpwd the users password for mysql server
> > > [EMAIL PROTECTED] resource|false
> > > */
> > >
> > > function Connect($host, $mysqluser, $mysqlpwd){
> > > $link=mysql_connect($host, $mysqluser, $mysqlpwd)
> > > if(!$link){ return false; }
> > > else { return $link; }}
> >
> > > should i keep it like this or is it better for the function itself to
> deal
> > > with error handling at the same time? i.e. should it return an error
> > > message/number or something of that sort or give the returned resource
> over
> > > to some other function that deals with errors
> >
> > A standard database layer will return false, and set a error code
> > and error message property, so the application using the class can
> > do something about it.
> >
> >
> > if (! $link = mysql_connect($host..) ) {
> >   $this->error = mysql_errno();
> >   $this->error_msg = mysql_error();
> >   return false;
> > }
> > ...
> >
> > Then in the application:
> >
> > if (! $dbh = $db->Connect(blah...) ) {
> >   echo $db->error, ': ', $db->error_msg;
> >   exit;
> > }
> >
> >
> >
> > Curt
> > -- 
> > "I used to think I was indecisive, but now I'm not so sure."
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >

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



[PHP] show_source or highlight_string wrapping

2004-04-19 Thread Aidan Lister
Why do these functions wrap at approximately 80 chars? It's stupid! How can
this be worked around?

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



[PHP] Re: show_source or highlight_string wrapping

2004-04-20 Thread Aidan Lister
No, PHP explicity inserts  at 80chars


"Red Wingate" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Red Wingate wrote:
>
> > Aidan Lister wrote:
> >
> >> Why do these functions wrap at approximately 80 chars? It's stupid! How
> >> can this be worked around?
> >
> > It doesn't check the source to see that the browser wraps the text as it
> > reaches the border of the window.
>
> Oh just another note, use  to skip this limitation :-)
>
> 
>hightlight_file ( '...' );
> ?>
> 

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



[PHP] Re: show_source or highlight_string wrapping

2004-04-20 Thread Aidan Lister
It seems they've fixed this in php5, so I can't complain.

"Aidan Lister" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Why do these functions wrap at approximately 80 chars? It's stupid! How
can
> this be worked around?

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



[PHP] Re: show_source or highlight_string wrapping

2004-04-20 Thread Aidan Lister
Here's a PHP4 example:
http://ircphp.com/users/imho/?file=function.str_chop.php

Here's an example where PHP has explicitly wrapped at 80 chars, but only the
PHP, not the HTML.
http://ircphp.com/users/imho/



"Red Wingate" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I just build a testcase to check wether PHP does or not and it doesn't
even
> if i have 1080 chars in a line :p
>
>  -- red
>
> > No, PHP explicity inserts  at 80chars
> >
> >
> > "Red Wingate" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >> Red Wingate wrote:
> >>
> >> > Aidan Lister wrote:
> >> >
> >> >> Why do these functions wrap at approximately 80 chars? It's stupid!
> >> >> How can this be worked around?
> >> >
> >> > It doesn't check the source to see that the browser wraps the text as
> >> > it reaches the border of the window.
> >>
> >> Oh just another note, use  to skip this limitation :-)
> >>
> >> 
> >>  >>   hightlight_file ( '...' );
> >> ?>
> >> 

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



[PHP] Re: Whats faster? text files or mysql?

2004-04-20 Thread Aidan Lister
Ofcourse

"Andrew fenn" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have two text files with two rows of data on each line sperated by a tab
for about 20 lines in each file. Would it be faster accessing this data by
putting it in a mysql table?
>
>
>
>
> -
>   Yahoo! Messenger - Communicate instantly..."Ping" your friends today!
Download Messenger Now

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



Re: [PHP] Forking external binaries

2004-04-21 Thread Aidan Lister
There's a "nu-fork" library or something around.

There's a pear package which provides an API to this. Have a look around.

"Michal Migurski" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > We have a web application that forks off an external program to inject
> > an email in the outgoing queue. At busy periods this external program
> > (qmail-inject) can take a little while to return. I'm currently using
> > popen() to spawn the qmail-inject binary.
> >
> > Is there a way to spawn the external binary but not wait for it to
> > return. I'd be happy to ignore any return value if the tradeoff was a
> > fast return.
>
> If you call it via exec(), you can append an ampersan to detach the
> controlling terminal:
>
> exec("/path/to/qmail-inject -args &");
>
> Wish php had fork() in a non-experimental context. :\
>
> -
> michal migurski- contact info and pgp key:
> sf/cahttp://mike.teczno.com/contact.html

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



[PHP] Re: calling php function

2004-04-23 Thread Aidan Lister
No, you are confusing javascript (client side) with PHP (server side).

"T Umashankari" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Hello,
>
>  Is it possible to call php function in the onclick event ?
>
> REgards,
> Uma

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



[PHP] Re: How to do type/existence checking in PHP5

2004-04-23 Thread Aidan Lister
I don't understand the question.

One should always check the existence of something before attempting to use
it.

If (isset($var) && gettype($var) == "boolean") is one way of type checking.



"Christian Jul Jensen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi
>
> In PHP5 the behaviour of illegal string offsets has changed. This is
> documented in the 'thin changes' file.
>
> This gives a problem in checking for existence / types of values,
> directly into a deeper level of a multidimensional array.
>
> I reported this as a bug[1] because I find the behaviour unfortunate, and
> furthermore it's inconsistent. This was refused, with a note 'So don't
> do it'. I think it's a really bad idea not to check the
> existence/types of values, before using them, so how should this be done
> properly in PHP5, without risking fatal errors in the case of a
> non-existent array?
>
> This is a problem in migrating applications from PHP4 because the
> error will not appear unless the value deosn't exist, which is exactly
> why you do the check.
>
> [1] http://bugs.php.net/bug.php?id=28107
>
> --
> ./mvh Christian Jul Jensen
>   Frelance webprogrammer
>   TYPO3 Typehead Denmark

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



[PHP] OR

2004-04-25 Thread Aidan Lister
if (cond || cond2)

OR

if (cond OR cond2)


What do you use, and why?

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



[PHP] Re: PHP5 and static attributes

2004-05-12 Thread Aidan Lister
Do you have to access that variable statically?

If you're scope is the class:
echo $this->myInstance;

Otherwise,
echo C::$myInstance will access it outside the class (I think), even though
it's inherited.



"Rudy Metzger" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Dear all,
>
> I have a problem with 'referencing' static attributes. I have the
> following class tree.
>
> // --- CLASS A -
> class A
> {
>   protected static $myInstance;
> }
>
> // --- CLASS B --
> class B extends class A
> {
> }
>
> // --- CLASS C --
> class C extends class B
> {
>
> public function Debug()
> {
>   echo self::$myInstance; // does not work (undefined)
>   echo parent::$myInstance;  // also does not work
>   echo A::$myInstance; // works
> }
>
> }
>
> -
> The Problem is that you always have to know in which class the static
> was defined to reference it. Or is there something like
> static::$myInstance or this::$myInstance or class::$myInstance. If not,
> it maybe would be a great idea to add something to PHP, otherwise you
> always have to track in which class the static had been defined if you
> want to reference it!
>
> Thanx for reading and if someone knows how to solve this, please let me
> know!
>
> Cheerio
> /rudy

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



[PHP] Re: Common Functions

2004-05-13 Thread Aidan Lister
This doesn't sound like a very secure method of doing things at all. Also,
managing a file that big sounds like quite a nightmare.

Have you looked at using OOP stuff?

Use a couple of standard pear classes like Auth, MDB2, and you're well on
your way to having a very maintainable site.


"Shaun" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I have designed my site such that all my common functions are stored in
one
> file which is included in all other files. So if ever someone presses a
> submit button or a link with a special $_GET variable that matches a
> variable in the common file the function is performed. e.g.
>
> //common.php
> if(isset($_POST[add_user])){
> //add user to db...
> }
>
> This makes the maintenance of the site very easy as all functions in one
> file, however this file has over 2500 lines of code. The site runs on a
> dedicated server and performance is not a problem, I would just be very
> interested to hear your opinions on this design structure and any problems
I
> may face with this design pattern.
>
> Thanks for your help

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



Re: [PHP] a good user directory application...

2004-05-13 Thread Aidan Lister
Nothing this big will be solid, if you're looking for a complete PHP website
system, try postnuke/phpnuke whatever.


"Bruce" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> ryan...
>
> we've seen apps that have had some of the functions we're looking for...
ie
> dating apps, cms systems, etc... we're curious if anybody has seen/used
> something that they've considered to be really good/solid...
>
> -bruce
> [EMAIL PROTECTED]
>
>
> -Original Message-
> From: Ryan A [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, May 12, 2004 8:59 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] a good user directory application...
>
>
>
> On 5/13/2004 4:29:52 AM, [EMAIL PROTECTED] wrote:
> > hey...
> >
> > hi.
> > we're looking for a good/really good web based user directory
> > application. we'd
> > like the app to be able to allow users to login, and add
> > information to their profile.
> > we'd prefer an app that would provide the
> > ability to select/add additional information fields and not constrain
us.
> we
> > would also like an app that allows the user to upload a picture for the
> > other users to be able to see...
> >
> > we're
> > looking for something that will allow our users to be able to search
> > through the profile information, to find other users with the skills
that
> > they need. The goal is to be able to support a distributed team of
users.
> > this would be a way of allowing them to kind of stay in touch.
> >
> > we'd also prefer that the app have a good admin function.
> >
> > if need be, we could always rip this function out of an existing app if
> you
> > know of one, and create a stand alone app
> >
> > Of course we'd
> > also prefer that the app be "open source"...
>
> Of course...why pay for something so useful??
> Maybe you would also prefer for someone to make this for you...open source
> and free of course :-)
>
> Cheers,
> -Ryan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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



[PHP] Re: Binary to ASCII

2004-05-11 Thread Aidan Lister
Handy function for this sort of stuff:
http://ircphp.com/users/imho/?file=function.hexview.php

"René fournier" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> When reading from a Socket Server, my Socket Client retrieves data that
> includes ASCII and binary data:
>
> while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {
> $data .= $buf;
> if(preg_match("/ENX/", $data)) break;
> }
> echo "RESPONSE: ".$data."\n";
>
> The output looks like:
> RESPONSE: STX&The system is up and running.ENX
>
> Between the "STX" and "The system is up..." are 8 bytes of binary data
> (which this case appear as an ampersand), which I want to extract from
> $data, split into two 4 byte variables, and convert back into integers.
> I suspect that I need unpack() at some point, but any ideas how to
> extract and split the binary data from this string? (Sometimes, the
> binary data is not visible, but it's still there.)
>
> ...Rene
>
> PS. Thanks guys for the earlier advice with pack()--which worked.

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



[PHP] Re: using cookies

2004-05-09 Thread Aidan Lister
Hi,

Richards email was kinda wierd, so I'll reply to your email directly

> Hi, all --

> I guess I need a primer on cookie usage.  I've read the manual regarding
> setcookie and have gone back to look at everything having to do with
> cookies on this list in the past few months (it seems that I'm not the
> only one with some troubles, but most of them appear to have been having
> sent some HTML output before trying to set a cookie).

The manual is all you need to know, you just need to experiment with the
information provided until it clicks in.

> I want to check to see if the user has my cookie to then log him in
> automatically, and if he doesn't then I show the login screen and he logs
> in and then I set the cookie if the box is checked.

Okay, simple:



> Of course, $_COOKIE is set, so I have to check for my cookie name.  Even
> something as simple as

>   $_COOKIE['test'] = 'tested';

> followed by a load of the page and a print doesn't show it.

The above stuff didn't really make sense, you havn't explained what you are
trying to do and what does not work.

> Do I only call setcookie if the cookie isn't set, or do i call it every
> time I load the page to initialize it?  Once I set it, how do I read it?
> Does anyone have any pointers to a basic tutorial?

setcookie() does what you would expect, sets a cookie. As explained on the
PHP manual, " setcookie -- Send a cookie "
So, logically, you only need to call it when you want to set a cookie...

If you want to read the contents of the cookie, print_r($_COOKIE); That will
show you all cookie information on their computer for your domain.

If you know the name of the cookie you set, simply print $_COOKIE['name']

There's not a lot to it, all the information you'll need is on the manual,
good luck!


> TIA & HAND


"David T-G" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

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



Re: [PHP] $myobject->$$varname doens't work ??

2004-05-09 Thread Aidan Lister
Richard,

I think you need to read the questions more accurately - your last two
replies have been somewhat incorrect


"Richard Harb" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Try
> echo $obj->$varname;
>
>
> -Original Message-
> From: greg
> Sent: Sunday, May 9, 2004, 9:21:52 AM
> > Hello,
>
> > I was just trying this but it doesn't work :
> > 
> > class a {
> >public $foo = "hello world";
> > }
>
> > $obj = new a();
> > $varname = "foo";
> echo $obj->>$$varname;
>
> > $bar = "this is working";
> > $varname = "bar";
> > echo $$varname; // display "this is working" as expected
> ?>>
>
> > Is it a bug or is it normal ?
> > I didn't find anything about it in documentation (php4 / php5).
>
> > Greg

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



Re: [PHP] $myobject->$$varname doens't work ??

2004-05-09 Thread Aidan Lister
Ooops, actually he was pretty ambiguous, please disregard my previous
comment :)


"Richard Harb" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Try
> echo $obj->$varname;
>
>
> -Original Message-
> From: greg
> Sent: Sunday, May 9, 2004, 9:21:52 AM
> > Hello,
>
> > I was just trying this but it doesn't work :
> > 
> > class a {
> >public $foo = "hello world";
> > }
>
> > $obj = new a();
> > $varname = "foo";
> echo $obj->>$$varname;
>
> > $bar = "this is working";
> > $varname = "bar";
> > echo $$varname; // display "this is working" as expected
> ?>>
>
> > Is it a bug or is it normal ?
> > I didn't find anything about it in documentation (php4 / php5).
>
> > Greg

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



[PHP] Re: $myobject->$$varname doens't work ??

2004-05-09 Thread Aidan Lister

"Greg" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I was just trying this but it doesn't work :
> 
> class a {
>public $foo = "hello world";
> }
>
> $obj = new a();
> $varname = "foo";
> echo $obj->$$varname;
>

$$varname is turned into $foo, what is the value of $foo?

If you're trying to access "public $foo" then Richard was entirely correct
(sorry richard!), just do it like so: $a->foo

If, like in the below example, $foo is the name of a variable that you want
to access, then try ${$foo}, everynow and then there's a problem to that
effect

Good luck, welcome to oop :)


> $bar = "this is working";
> $varname = "bar";
> echo $$varname; // display "this is working" as expected
> ?>
>
> Is it a bug or is it normal ?
> I didn't find anything about it in documentation (php4 / php5).
>
> Greg

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



[PHP] Re: icmp echo / ping

2004-05-09 Thread Aidan Lister
Yep, check out:

http://pear.php.net/net_ping


"News.Php.Net" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I was wondering if it's possible to issue a icmp echo / ping without
> actually using the ping program supplied with the operating system.
>
> Anyone has an idea?
>
> Thanks in advance.
>
>

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



[PHP] Re: Putting a stop in a foreach

2004-05-09 Thread Aidan Lister
Simple!

$i = 0;
foreach ($foos as $foo)
{
 // do stuff

$i++;
if ($i > 5) break;
}

Cheers


"Verdon Vaillancourt" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi :)
>
> I'm trying to put a stop in a foreach statement following the user
> suggestion here, php.net/manual/en/control-structures.foreach.php
>
> Not really knowing what I am doing, I am running into some synatx
problems.
> I'm sure I'm doing something really stupid, can anybody point it out?
>
> This is the original statement that works...
>
> foreach ($this->_content as $item) {
> if ($item['type'] == 'item'){
> $elements['ITEM_LINK'] = $item['link'];
> $elements['ITEM_TITLE'] = $item['title'];
> $elements["TARGET"] = $this->_target;
> $items .= PHPWS_Template::processTemplate($elements,
> "phpwsrssfeeds", "block_item.tpl");
> }
> }
>
>
> This is my attempt to count items and put a stop in the foreach so it only
> returns 5 items.
>
> foreach ($this->_content as $n => $item) {
> if ($n=="5") {
> break;
> } else {
> if ($this->_content[$n] => $item['type'] == 'item'){
> $elements['ITEM_LINK'] = $this->_content[$n] => $item['link'];
> $elements['ITEM_TITLE'] = $this->_content[$n] =>
$item['title'];
> $elements["TARGET"] = $this->_target;
> $items .= PHPWS_Template::processTemplate($elements,
> "phpwsrssfeeds", "block_item.tpl");
> }
> }
> }
>
> Php doesn't like the syntax on any of the,
> $this->_content[$n] => $item['type']
> , etc lines
>
>
> TIA,
> Verdon

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



[PHP] Re: Does this "directory detection" script work for you?

2004-05-09 Thread Aidan Lister
Hi,

I use the following class to get Path information:

http://ircphp.com/users/imho/?file=Path.php

Let me know if this is helpful at all


"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello. I'm relying on the following code so that a script can
> automatically detect where it's installed and create paths and URLs from
> the information. This way absolute paths and URLs are always used.
>
> I've had a couple people report that the script wasn't finding the paths
> correctly, though, so I'm asking if people could test this out on their
> server and see if it detects the paths or not.
>
>   //Install path (path to survey.class.php)
>  $path = dirname($_SERVER['PATH_TRANSLATED']);
>
>  //Determine protocol of web pages
>  if(isset($_SERVER['HTTPS']) &&
> strcasecmp($_SERVER['HTTPS'],'ON') == 0)
>  { $protocol = 'https://'; }
>  else
>  { $protocol = 'http://'; }
>
>  //HTML address of this program
>  $dir_name = dirname($_SERVER['SCRIPT_NAME']);
>  if($dir_name == '\\')
>  { $dir_name = ''; }
>
>  $html = $protocol . $_SERVER['SERVER_NAME'] . $dir_name;
>
>  //Determine web address of current page
>  $current_page = $protocol . $_SERVER['SERVER_NAME'] .
> $_SERVER['SCRIPT_NAME'];
>
>  echo "Path to script: $path";
>  echo "URL to script directory: $html";
>  echo "URL to current script: $current_page";
> ?>
>
> It should print out the file system path to where the script was placed
> as well as a URL to the directory it was placed and a URL to the file
> itself.
>
> I've never had an issue with it personally and I've tested it on Apache
> and IIS on both Windows and Linux. So maybe it's some obscure CGI or OS
> configuration where this isn't working? I just need to know so I can
> plan accordingly.
>
> The only two substitutions that can be made (that I know of) are:
>
> $_SERVER['SCRIPT_NAME'] => $_SERVER['PHP_SELF']
> and
> $_SERVER['PATH_TRANSLATED'] => $_SERVER['SCRIPT_FILENAME']
>
> If it doesn't work for you, does it work if you do one of those
> substitutions?
>
> Also, this will test if the script is in subdirectories or not, also, so
> testing it within one and seeing if that works, too, is appreciated.
>
> Thanks for any help and time you're willing to provide.
>
> -- 
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com

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



Re: [PHP] Returning an object

2004-05-07 Thread Aidan Lister

"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> * Thus wrote Aidan Lister ([EMAIL PROTECTED]):
> > How _should_ this be done? In terms of "best practice".
> >
> >  > function foobar ()
> > {
> > return new SomeObject;
> > }
> > ?>
> >
> > Or:
> >
> >  > function barfoo ()
> > {
> > $tempvar = new SomeObject;
> > return $tempvar
> > }
> > ?>
>
> I'm not exactly sure what your looking for, this is like asking
> what is better:
>
>   $a = 'foo';
>   echo $a;
>
>   or
>   echo 'foo';
>
> if tou want my opinion it should be written like this:
> 
> /*
>  * Create an instance of SomeObject
>  */
> function foobar() {
>   return new SomeObject;
> }
>
>
>
> > Please don't reply if you really, really don't know what you are talking
> > about.
>
> What kind of requirement is this? Anyone can reply your email and
> they will do so if they feel like it.
>

The reason I added that at the bottom was to stop people like yourself
replying, not that I don't appreciate your advice, I think you're simply not
aware of the facts.

>
> Curt
> -- 
> "I used to think I was indecisive, but now I'm not so sure."

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



[PHP] Re: Returning an object

2004-05-07 Thread Aidan Lister
I found some more information about it here:
http://bugs.php.net/bug.php?id=24687

It looks like you should assign an object to a variable before returning it.


"Justin Patrin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Aidan Lister wrote:
>
> > How _should_ this be done? In terms of "best practice".
> >
> >  > function foobar ()
> > {
> > return new SomeObject;
> > }
> > ?>
> >
> > Or:
> >
> >  > function barfoo ()
> > {
> > $tempvar = new SomeObject;
> > return $tempvar
> > }
> > ?>
> >
> > Please don't reply if you really, really don't know what you are talking
> > about.
>
> Some earlier versions of PHP5 would not allow returning by reference of
> a function call or a new call. It was very recently added, but may not
> be in RC2 (not sure). You had to assign to a variable before you returned.
>
> Here's my 2c:
>
> function &foobar() {
>return new SomeObject;
> }
>
> -- 
> paperCrane 

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



[PHP] PHP5 RC2 Spec file

2004-05-08 Thread Aidan Lister
Hi guys,

I'm trying to compile a PHP5 RC2 RPM, does anyone know where I can get a
SPEC file from?

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



[PHP] Re: PHP5 RC2 Spec file

2004-05-08 Thread Aidan Lister
Found it, it's generated by ./configure (I think)

"Aidan Lister" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi guys,
>
> I'm trying to compile a PHP5 RC2 RPM, does anyone know where I can get a
> SPEC file from?

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



[PHP] Re: Problems with very special characters

2004-05-08 Thread Aidan Lister
Hi,

Make sure the charset of your document matches the charset sent by the
server - If you tell the browser the charset is A, and use characters from
charset B, you will get the problem observed.

The charset can be sent from Apache, PHP and the actual charset is set in
the document.

It's a pain in the arse to fix, I've had the same problem, it took a lot of
experimenting

Good luck,


"Wouter Van Vliet" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello everybody,

I'm back! (been a subscriber here before, a while ago .. was quite an active
one at that time .. ;)) .. and I'm back for a reason, having a very wicked
problem. The setup is one RedHat linux 9 machine (called "s007"), previously
in use as both our web and database server. As traffic increased
dramatically earlier this week, we had to grab another server, running
RedHat Fedora. We'll call her "s006", and use to serve the webpages. All
happened very quickly and smooth for most of it. Only currently still
existing problem has (appearantly) to do with transferring the very special
characters over the lines between s007 and s006, displaying them on the
screen and entering them in the database through webforms. Normal special
chars like é, ê, à and so on seem to be displayed ok (after calling
htmlentities in php: PHP 4.3.3 (cgi) (built: Oct 21 2003 09:51:55) on s006
and PHP 4.3.4 (cli) (built: Jan 24 2004 22:34:14) on s007), but the more
exotic ones (~ and ^ signs on and under Z, S .. and stuff like that) still
cause problems on the s006. Same script, requesting data from the same rows
of the same database on the s007 works as it is supposed to.

MySQL version of both servers is "mysql  Ver 11.18 Distrib 3.23.58, for
redhat-linux-gnu (i386)", for both machines, /etc/sysconfig/i18n looks like:

  1 LANG="en_US"
  2 SUPPORTED="nl_NL:nl_NL:nl:en_US:en"
  3 SYSFONT="lat0-sun16"
  4 SYSFONTACM="iso15"

(numbers are line numbers). To compare the pages:
http://esctoday.s007.interlize.net/annual/2004/participants.php
 
http://esctoday.s006.interlize.net/annual/2004/participants.php

I'm stuck here with my hands in my hair, and would very much appriciate any
clue to a solution,
Wouter van Vliet

(ps. since I'm not sure of the solution will be found in php, mysql or any
other place I have posted this message also to the mysql-general list)

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



[PHP] Returning an object

2004-05-06 Thread Aidan Lister
How _should_ this be done? In terms of "best practice".



Or:



Please don't reply if you really, really don't know what you are talking
about.

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



[PHP] Re: PEAR::DB is great but is sooooo SLOW !

2004-05-16 Thread Aidan Lister
There are many, many benchmarks done comparing PEAR::DB to PEAR::MDB to
AdoDB, PEAR::DB is much slower than the native API, AdoDB is the fastest but
least functional - I suggest you try PEAR::MDB2

http://pear.php.net/package/mdb2

once you get into it, you'll love it


"Rainer müller" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Greg wrote:
> > Hello,
> >
> > I've just performed a few tests when using PEAR::DB and
> > the results weren't good at all.
> >
> > If I compare a script using PEAR::DB with a script using
> > standard functions (and which supports mysql, pgsql and
> > sqlite databases), the script using PEAR::DB is 10 times
> > slower than the other.
> >
> > In one of my projects, it slows down execution time to
> > 0,7 sec per page !
> >
> > Conclusion : if you want to use PEAR::DB package, you'll
> > probably will have to use cache systems for scripts that
> > may be request often.
> >
> > Am I the only one annoying by this loss of performance ?
> > Because this is a huge loss in that case !
> >
> > Greg
>
> Remember, PEAR::DB also uses the standard functions, so I can't
> understand, why it should be much slower.
>
> Rainer

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



[PHP] Re: change database from mysql to mssql

2004-05-17 Thread Aidan Lister
Yep, MDB2 is the best bet

"Torsten Roehr" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "David" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi all
> >
> > I have been using mysql as the database for my PHP application.
> > Now my manager ordered me to use Microsoft SQL Server as the database.
> > I have been using the mysql interface to access the database, so I have
> > to change my code.
> > Which database interface should I use, ODBC, ADO, mssql or PEAR?
> > Any brief suggestion or link to some good tutorial/paper would be very
> > much appreciated.
> >
>
> Try PEAR::MDB or PEAR::MDB2 (as soon as it's stable) - this should also
make
> switching to another database easier in the future - back to MySQL maybe
;)
> http://pear.php.net/package/MDB
> http://pear.php.net/package/MDB2
>
> Regards, Torsten

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



[PHP] Re: Pear question

2004-05-20 Thread Aidan Lister
PEAR doesn't need to be "installed", so to speak.

PEAR is simply a set of classes, at heart, they can be downloaded and used
without problem from the pear.php.net website. However, PEAR does have an
installer program that allows you to install these packages from command
line.

To check if you have the pear installer intalled, type "pear list-packages"
as superuser on your machine. If the installer is not installed, see the
http://pear.php.net/ website for installation information.

"Dave Carrera" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi List,
>
> How do I tell if pear is installed ?
>
> If it is not, then how do I add it to my Php.
>
> My Php is 4.3.0 on Unix system
>
> Thanks for any help or advice
>
> Dave C
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.687 / Virus Database: 448 - Release Date: 16/05/2004
>

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



[PHP] Re: Pear question

2004-05-20 Thread Aidan Lister
All of this information is on the http://pear.php.net/ website.

A simple usage example of PEAR::DB is here:
http://pear.php.net/manual/en/package.database.db.intro-connect.php

Basically, once you've established that PEAR is installed the user simply
"loads" the script.

Eg.


If this fails, you'll need to configure your users include_path via php.ini
to contain the location to the PEAR scripts.

Also, I'd run a "pear upgrade-all" to make sure you're using the latest
version of all the packages too.

Hope this helps :)


"Dave Carrera" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thanks Aidan,
>
> I get a list of installed packages.
>
> What do I or one of my users need to do to access / use the DB package?
>
> Any help, advice, example is very much appreciated.
>
> Dave C
>
>
>
> -Original Message-
> From: Aidan Lister [mailto:[EMAIL PROTECTED]
> Sent: 20 May 2004 13:04
> To: [EMAIL PROTECTED]
> Subject: Re: Pear question
>
>
> PEAR doesn't need to be "installed", so to speak.
>
> PEAR is simply a set of classes, at heart, they can be downloaded and used
> without problem from the pear.php.net website. However, PEAR does have an
> installer program that allows you to install these packages from command
> line.
>
> To check if you have the pear installer intalled, type "pear
list-packages"
> as superuser on your machine. If the installer is not installed, see the
> http://pear.php.net/ website for installation information.
>
> "Dave Carrera" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi List,
> >
> > How do I tell if pear is installed ?
> >
> > If it is not, then how do I add it to my Php.
> >
> > My Php is 4.3.0 on Unix system
> >
> > Thanks for any help or advice
> >
> > Dave C
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.687 / Virus Database: 448 - Release Date: 16/05/2004
> >
>
>
>
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.687 / Virus Database: 448 - Release Date: 16/05/2004
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.687 / Virus Database: 448 - Release Date: 16/05/2004
>

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



[PHP] Re: php installation help

2004-05-20 Thread Aidan Lister
Hi Phillip,

For future reference, PHP install questions are best asked on the
[EMAIL PROTECTED] mailing list, however I'm sure someone can answer
your question here also.



"Khutjo Phillip Leremi" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]


Hi I have recently installed gd-2.0.15 on my linux 9.0 machine and this
machine has a database that i need to access through phpMyadmin so the
requirements are that php should be installed but when I error this
instruction I get this error;

[EMAIL PROTECTED] root]# apt-get install php
Reading Package Lists... Done
Building Dependency Tree... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php: Depends: libgd.so.1.8
E: Broken packages

I understand that gd 2 comes with libgd.so.2.0. Any help.

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



[PHP] Re: Pear/Net_FTP help

2004-05-20 Thread Aidan Lister
Hi Chris,

Please send your message to [EMAIL PROTECTED], you are more likely
to get a response there.


"Chris" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all.  Hopefully someone here can show me what I am doing wrong.  I am
> trying to write a small script to ftp into a server and retrieve a
> listing.  I am using the Pear module Net_FTP for this.  I am able to
> connect to the server, but I cannot get a directory listing to work.  Here
> is my code.
>
> // PEAR::Net_FTP
> require_once 'Net/FTP.php';
>
> // Configuration section
> $ftp[hostname] = "localhost";
> $ftp[user]  = "username";
> $ftp[password] = "password";
>
> // Create a new ftp class
> $ftp = new Net_FTP();
>
> // Time to connect to the ftp server
> $ftp->setHostname($ftp[hostname]);
> $ftp->setPort(21);
> $ftp->connect();
> $ftp->setUsername($ftp[user]);
> $ftp->setPassword($ftp[password]);
> if(!$ftp->login()){
>  echo "Unable to connect to the $ftp[hostname] server.  Please
> verify your settings and try again.";
> }
> $ftp->pwd();
>
> // Lets see what we can see.
> $ftpLS = $ftp->ls(null, NET_FTP_DIRS_ONLY);
>
> echo "";
> print_r($ftpLS);
> echo "";
> $ftp->disconnect();
>
> I get a error message back saying it could not retrieve current directory.
>
> Can anyone offer any help?  Example code would be appreciated.  Thanks
>
> Chris

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



[PHP] Re: php and java applets

2004-05-21 Thread Aidan Lister
I'd implement access control in the java object if possible, sounds easier.

"Tom Playford" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Dear all knowing list,
>
> I am trying to control the movement of a camera in real time from the web.
But I also need to make sure that only the user I specify can have control.
>
> What I though I could do was this: launch a java applet from a php page
parsing the session id. Then when the user adjusts the controls on the
applet, a php page is loaded by the applet, sets the user session with the
session id, then sends the control details back to the server and on to the
camera.
>
> I've given this a go with no luck. When I try to set the session id on the
php script that the Java applet loads I get a permissions error (the perms
on /tmp are fine). I'm not 100% sure I understand sessions, is my method
utterly implausible? Does anyone have any better suggestions?
>
>
> Thanks,
>
> Tom Playford

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



[PHP] Re: include $var

2004-05-21 Thread Aidan Lister
Try it?

(Yes, it works)

"Bob Lockie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Should 'include $var;' work?
> I need go to an HTML page after the form has been submitted.
> page A -> program B (no output) -> page A

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



[PHP] Re: How To Do This?

2004-05-22 Thread Aidan Lister
Hi Justin,

For future reference, your choice of subject is poor - be more descriptive,
your subject could apply to 99% of the questions asked on this list.

I have no idea what you've created in DW MX 2004, nor have you given us any
information about it.

If you have an authorisation level stored in $authlvl, a simple switch
statement would decide which menu to display.
http://au3.php.net/manual/en/control-structures.switch.php

I hope this helps,
Aidan



"Justin Kozuch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hey Everyone,
>
> I'm struggling with an application I'm building for a client.
>
> Depending on the person logged in, they have an authorization level
> attached to their profile (1 for Administrator, 2 for Manager, etc).
>
> When they successfully login, they are presented with a menu that is
> customized with options that can only be seen by certain ID levels, such
> as:
>
> ID = 1:
> View Ticket
> Add Ticket
> Edit Ticket
> Delete Ticket
> Reassign Ticket
>
> ID = 2
> View Ticket
> Add Ticket
>
> etc etc etc.
>
> I was thinking of using an if statement, but I'm not quite sure how to
> tie this into the login application I've created in DW MX 2004.
>
> Has anyone done this before? I'm looking for some direction on how to
> proceed.
>
> Thanks,
>
> Justin Kozuch

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



[PHP] Re: Is there any good examples of PHPLIB?

2004-05-24 Thread Aidan Lister
Hi Dsx,

If you're unable to use classes from PHPLIB, I suggest you learn PHP first.
Using objects for the first time is very confusing, but there are some
excellent guides on the internet. I suggest you spend a couple of days just
experimenting, writing your own classes to do menial tasks, etc.

Whatever task you're trying to achieve, be it communicate with an IRC server
or query a game server, pear.php.net has the objects you need.


"Dsx" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there any good examples of PHPLIB?I can only write very simple
programs of PHPLIB,but when the functions and classes added,  I cannot hold
it.So I'd like to learn some code examples of it,who can provide me some or
a website about it?
> Thank you in advance.

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



Re: [PHP] Current URL

2004-06-03 Thread Aidan Lister
Hi,

You could use $_SERVER['DOCUMENT_ROOT']


"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Thu, 2004-06-03 at 23:15, Stephen Craton wrote:
> > I've wondered for quite some time, and search just as long it seems
like,
> > for a way to get the current URL directory. For example, let's say you
were
> > at www.example.com/files. The script is executing in this directory, and
> > it's calling an include script from the base (www.example.com or maybe
even
> > www.example.com/includes). In this included file are some links and
maybe
> > some images. These images and links are set up to be called from the
base
> > directory, so basically all the links inside the file say something like
> > "images/bob.gif" or something of that nature.
> >
> > How could you dynamicaly change this in relation to where the included
> > script is? If I were to include it in that files in /files, it would
look
> > for the images in /files/images/bob.gif which would not be there. One
> > solution I have thought of is just putting the / at the beginning
(/images/)
> > but that wouldn't be the safest solution if the script were running in a
> > subfolder to begind with (like the entire site is in
www.example.com/site1).
> >
> > I hope you understand what I'm trying to say. Any ideas?
>
> In a configuration file shared by the project's scripts have a constant
> or global variable like follows:
>
> $GLOBALS['imageBase'] = '/site1/';
>
> Now wherever in your site you use an image you can use this value to
> prepend the image path.
>
> Cheers,
> Blobbie.
> -- 
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for   |
> | creating re-usable components quickly and easily.  |
> `'

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



[PHP] Re: if/elseif/else v. switch

2004-06-05 Thread Aidan Lister
This appears to be a really, really stupid question.

If they are indentical in operation, then ofcourse there will be no
noticeable difference to the user.


One may note that a switch statement is faster, because the condition is
only evaluated once. However you did not ask about the speed difference.


"Dennis Seavers" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there any noticeable difference (on the part of the client) between
identical conditionals, one written as a switch, the other written as an if,
elseif ... else conditional?  I realize that one programmer coming in behind
another might prefer the gentler layout of a switch; but would there be any
perceivable difference, client-side, between the options?

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



Re: [PHP] Re: if/elseif/else v. switch

2004-06-05 Thread Aidan Lister
Hi Rachel,

You'll note I did not criticise the poster, merely his seemingly stupid
question.

I suggest you practice what you preach. If you have a comment on my reply to
a users post, feel free to contact me personally - [EMAIL PROTECTED]

There is equally no need to criticise my crticism - on the list, in front of
everyone, as you so boldly put it.


"Rachel Rodriguez" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> --- Aidan Lister <[EMAIL PROTECTED]> wrote:
> > This appears to be a really, really stupid question.
> >
>
> Is this level of condemnation of a poster necessary?
>
> Whether you think Dennis's question was stupid or not,
> there is no need for such harsh criticism in front of
> everyone on this list.
>
> There are many ways you could have worded your
> response to ask the poster to rephrase his question.
> Your approach was not appropriate.
>
> =
> ~Rachel
>
>
>
>
> __
> Do you Yahoo!?
> Friends.  Fun.  Try the all-new Yahoo! Messenger.
> http://messenger.yahoo.com/

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



Re: [PHP] asp.net vs. php

2004-06-06 Thread Aidan Lister
Hehe Curt, point made :)

"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> * Thus wrote Kathleen Ballard ([EMAIL PROTECTED]):
> > I have been asked to make a fact based comparison of
> > the pros and cons of asp.net and php.  I am not trying
> > to start a war and apologize if this is too off topic,
> > but I know make of the list members work in other
> > coding languages.
>
> Here is a 191 documents related to php vs. asp:
>
> http://groups.google.com/groups?q=asp+vs+php&meta=group%3Dphp.general
>
> GGIYF
>
>
> Curt
> -- 
> "I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Re: if/elseif/else v. switch

2004-06-08 Thread Aidan Lister
Hi Chris,

> oh right and that makes everything better. you're a fantastic person!

I don't see how criticising a silly question makes me a bad person in the
first place.

> you should be able to handle a little public humiliation/chastisement
> since you so easily dish it out.

You missed the point.

Anyway, stop flogging a dead horse. Stupid questions have stupid answers,
unfortunatly mine was one of the stupid answers - in hind site, I agree it
was an inapropriate thing to say.

Kind Regards,
Aidan

- Original Message - 
From: "Chris W. Parker" <[EMAIL PROTECTED]>
To: "Aidan Lister" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, June 08, 2004 2:25 AM
Subject: RE: [PHP] Re: if/elseif/else v. switch


Aidan Lister <mailto:[EMAIL PROTECTED]>
on Saturday, June 05, 2004 6:19 AM said:

> You'll note I did not criticise the poster, merely his seemingly
> stupid question.

oh right and that makes everything better. you're a fantastic person!

> I suggest you practice what you preach. If you have a comment on my
> reply to a users post, feel free to contact me personally -
> [EMAIL PROTECTED]

you should be able to handle a little public humiliation/chastisement
since you so easily dish it out.



c.

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



[PHP] Re: >>>>>> THREADS IN PHP

2004-06-12 Thread Aidan Lister
Please don't "hype" your post, or you'll find, as do many children, no one
will pay it any attention.


"Jack Bauer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi,
>
> i'm looking for a methode to use threads in php (on linux)

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



[PHP] Re: function for string to array (map)?

2004-06-18 Thread Aidan Lister
No, because that's not a standard format.

You'll have to write your own function (as you've done).

If you're looking to store an array as a string, look at serialize()

"Pete Forman" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there a standard function that converts a string to an array with
> proper keys, not auto generated integers?  I've found myself calling
> explode() twice.  split(), etc. do not seem to offer any improvement.
>
> $str = "a:x,b:y,c:z";
> $arr = explode(",", $str);
> foreach ($arr as $item) {
>   list($key, $value) = explode(":", $item);
>   $map[$key] = $value;
> }
>
> Is there a foo() that would do something like this?
>
> $map = foo(",", ":", $str);
>
> -- 
> Pete Forman-./\.-  Disclaimer: This post is originated
> WesternGeco  -./\.-   by myself and does not represent
> [EMAIL PROTECTED]-./\.-   opinion of Schlumberger, Baker
> http://petef.port5.com   -./\.-   Hughes or their divisions.

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



[PHP] Re: hellllppp my php kills the browser

2004-06-19 Thread Aidan Lister
Please read:

http://www.catb.org/~esr/faqs/smart-questions.html



"Water_foul" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> i fixed it i had an endless loop oops :)
> "Water_foul" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > i dont know why but the following code "kills" the browser:
> >  > //the function for adding new addresses
> > function loop_new_address($loopnum,$url,$name){
> > //the ${'link' . $loopnum} says put $link and add $loopnum to the end
> > if(isset($_COOKIE['link' . $loopnum . ''])){
> > loop_new_address_help($loopnum+1,$url,$name);
> > }
> > else{
> > setcookie('link' . $loopnum . '',$url,time()+3600,'/');
> > setcookie('name' . $loopnum . '',$name,time()+3600,'/');
> > setcookie('link' . $loopnum . '',$url,time()+3600);
> > setcookie('name' . $loopnum . '',$name,time()+3600);
> > print('' . $name . ' was added');
> > };
> > };
> > //A function to let loop_new_address loop
> > function loop_new_address_help($loopnum,$url,$name){
> > loop_new_address($loopnum,$url,$name);
> > };
> > if(isset($_GET['new'])) {
> > loop_new_address(1,$_GET['url'],$_GET['name']);
> > };
> > print('');
> > print(' > action="module/personal/delete.php">delete');
> > //write code
> > $writenum=1;
> > while(isset($_COOKIE['link' . $writenum . ''])==true){
> > print('' .
> $_COOKIE['name'
> > . $writenum . ''] . '');
> > };
> > include('links.htm')
> > ?>
> > 
> > 
> > 
> >  > type=hidden name=new value=1>
> > Site name
> > site url (if it is not on this site it MUST contain
> > "http://";)
> > 
> > 

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



[PHP] Re: Testing if cookies are enabled

2004-06-21 Thread Aidan Lister
Think about it.

Step 1) Analyse the problem.
a) Set a cookie.
b) Test if the cookie has been set.
c) Display data from cookie

Step 2) Read the fucking manual
a) http://php.net/setcookie
b) http://php.net/setcookie
c) http://php.net/setcookie

If you can't work it out, and have actually done some reading, feel free to
ask for some more help.



"Martin Schneider" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello!
>
> I saw this on some pages and want to do the same:
>
> - On one page the user can login. Before that no cookie is set!
>
> - On the next page they set the cookie and show either the user data or
> a warning that the user has disabled cookies and should enable them.
>
> I wasn't able to set and text a cookie on the same page! How is it done?
>
> Martin

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



[PHP] Re: email autoresponder

2004-06-21 Thread Aidan Lister
If you don't know what it is, why do you want to make one?

There's a lot more to this than simple PHP, I suggest you start on
google.com


"Syed Ghouse" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi All

will anybody explain me what is email autoresponder?.
and how to create in php?

Regards
Syed

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



[PHP] Re: php-login scripts

2004-06-28 Thread Aidan Lister
Hi,

You've sent this email to a mailing list with a couple of thousand users.
I'm probably not alone when I say "what on earth are you talking about?".

I don't know what PHP-Login is, if you have a problem using whatever
software that may be - please contact them about it.

You can find the PEAR website here:
http://pear.php.net/


"Sriranganath" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Dear Sir,

Can u send me the Check list for PHP-Login :

It is not clear in the website which files should we have to include under
which directories.

There are two or more files with the same name vizConfig.php
which one to include .?
i am trying this for the past 4 days. i am unable to get it done.


i have downloaded all the files:

1. details.php
2.edit.php
3.functions.php
4.global.php
5.index.php
6.list.php
7.login.php
8.logout.php
9. password.php
10.session_defaults.php
11.signup.php
12.user.phop
13. html_form.php
14.filter.php
15.config.php (?) i am doubt in this file

Also, You have told to download all the PEAR related packages. But you ahve
not given any link for this.


Finally, I request you to give me one complete catalogue having all the
related files and associated directories.

Your reply is highly appreciated.

Regards
Sriranganath

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



[PHP] Re: Error Reporting

2004-06-28 Thread Aidan Lister
Did you restart your webserver to make sure the changes were loaded?


"Tom Chubb" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I ave a strange problem with my error reporting!
> I have set php.ini to: error_reporting  =  E_ALL but I don't see any
errors.
> (After I was happy things were working on my Apache Test Server, I
uploaded
> to my web host and discovered errors.)
> Thanks,
>
> Tom

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



[PHP] Re: getting query string from referer website

2004-06-28 Thread Aidan Lister
$_SERVER['QUERY_STRING'] has nothing to do with the refering website.

foo.php?bar=6

The QUERY_STRING for the above example is: bar=6

When someone visits your page, they visit foo.php (for example), thus your
QUERY_STRING will always be blank.

I believe you're looking for HTTP_REFERER




"I.A. Gray" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> When I use the $_SERVER to get a query string it doesn't ever seem to
return
> me anything:
>
> $queryy = $_SERVER['QUERY_STRING'];
>
> In my webstats script, 790 are blank and 2 give the value of "loc=uk" and
> "currentID=6" - not very satisfactuary!
>
> Why is this happening?  Could I get the search string from the referer web
> site?  It sounds like a bit of a faff, but is this what I have to do?
>
> Say a referer website is
>
http://www.google.co.uk/search?q=web+design+for+performers&ie=UTF-8&hl=en&me
> ta=
>
> is there a good way of getting the query string "web design for
performers"
> ?
>
> for Yahoo it is different:
>
>
http://search.yahoo.com/search?p=biography+examples&ei=UTF-8&fr=fp-tab-web-t
> &n=20&fl=0&x=wrt
>
> the search string is followed by "p="
>
> I'd like to list the top ten search keywords and the top ten search
phrases.
>
> Any ideas?
>
> Thanks!

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



Re: [PHP] New changes

2004-06-28 Thread Aidan Lister
It's a virus, duh


"John Cashmore" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> what are these posts and why do they keep getting posted with some
> picutre with a password?
>
>
> On Sun, 27 Jun 2004 17:53:49 +0100, Hitcho <[EMAIL PROTECTED]> wrote:
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > nyngargjah.bmp - 3K Download
> >
>
>
> -- 
> John Cashmore
> Aka
> CaShY
> [EMAIL PROTECTED]

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



[PHP] Re: Regular expression

2004-06-30 Thread Aidan Lister
I suggest not using a regex.

There are better tools for parsing an email, for example "formail".

$email = `formail -x Return-Path`;

See google.com for more information

Regards,
Aidan


"Syed Ghouse" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi All

will anyone give me a solution to get the name and email address of sender
from the mail text below using regular expression.

The result shud get
name as syed ghouse
and
email as [EMAIL PROTECTED]

--- Mail text start ---

Return-Path: <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]
Received: (qmail 25523 invoked by uid 508); 19 Jun 2004 06:23:25 -
Received: from localhost (HELO 192.168.90.8) (127.0.0.1)
  by mail.jinis.com with SMTP; 19 Jun 2004 06:23:25 -
Received: from 192.168.90.20 (proxying for 192.168.90.85)
(SquirrelMail authenticated user [EMAIL PROTECTED])
by 192.168.90.8 with HTTP;
Sat, 19 Jun 2004 11:53:25 +0530 (IST)
Message-ID: <[EMAIL PROTECTED]>
Date: Sat, 19 Jun 2004 11:53:25 +0530 (IST)
Subject: test

>From : 'syed ghouse' <[EMAIL PROTECTED]>

To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED],[EMAIL PROTECTED]
User-Agent: SquirrelMail/1.4.2
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Priority: 3
Importance: Normal

test mail ignore

--- Mail text end ---


Regards

Syed



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



[PHP] Re: Best external app from php

2004-06-30 Thread Aidan Lister
If you're asking which is faster, PHP or Java, it's a very difficult
question and I doubt anyone will give you a concrete answer.

I'd suggest writing the application in a much faster compiled language, c++
for example.


"C.F. Scheidecker Antunes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello all,
>
> I need to have a web application to call an external app that needs to
> execute on the background. (It is an *NIX server)
>
> The app that is being called will do a lenghty work but will be called
> by a php script through the web server.
> An user will log in, request a computation, the script will call an
> external app which will run on the
> background. Once the job is completed, a notification will be sent to
> the user which will log in again and check the results.
> The external app performs a data mining computation on the SQL server to
> produce  results which will then be written to an SQL table.
>
> My question is this:
>
> Is it better to write the external app in PHP or Java?
> If I write in PHP then I have to have a way to make the PHP not bound to
> time limitations as the operation might take a while.
> If I write it in Java I won't have this concern. However, I am concerned
> with speed and overhead.
> Which one would put a higher load to the processor, a PHP app or a Java
> one?
> Which one will take longer?
>
> Also, there might be more than 20 of these threads running on the server
> at the same time, hence my concern on which language the app should be
> writen.
>
> Does anyone has experience with such a scenario?
>
> The input is much apreciated.
>
> Thanks in advance,
>
> C.F.


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



Re: [PHP] binary data over UDP with PHP?

2004-07-08 Thread Aidan Lister
If you're receiving binary data back, this function may interest you:

http://aidan.dotgeek.org/lib/?file=function.hexdump.php

Also, why are you messing with chr etc?
$string = "\x00\x01\xFF";
etc.


"Coder_1024" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thanks for the feedback.  As it turns out, the reason I was getting zero
> data bytes in my UDP packet was that I had declared the packet variable
> outside the function in which I was using it.
>
> $packet = chr(0x01).chr(0x1d) etc
>
> function doSomething($x)
> {
> // using $packet in here gives you an empty variable.
> }
>
> So I guess it was a very basic PHP language thing I was running into.
Guess
> I've done too much Perl and assumed the variables were accessible in the
> function. :-)
>
>
> "Keith Greene" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I use the following without problem:
> >
> >  $fp = fsockopen("udp://www.server.com", 24250, &$errno,
&$errstr,
> .2);
> > if (!$fp) {
> >   $status = "Server not available";
> > } else {
> >  $trigger =
> > chr(hexdec('FF')).chr(hexdec('FF')).chr(hexdec('01')).chr(hexdec('00'));
> >  fwrite($fp,$trigger);   # Send trigger to the
> > status server
> >  $junk = fread($fp, 4);  # discard echoed
command
> > from status server
> > }
> >
> > Keith
> >
> > At 04:23 PM 7/7/2004, coder_1024 wrote:
> > >I'm trying to send some binary data to a UDP server using PHP.  The
> examples
> > >I've been able to find show sending binary data over TCP, or they show
> > >sending text over UDP.
> > >
> > >I'm constructing the messages using the below:
> > >
> > >   $text_msg = "Hello, World\r\n";
> > >   $binary_msg = chr(0x01).chr(0x02).chr(0x00).chr(0xAD);
> > >   $binary_msg_size = 4;
> > >
> > >I've tried a couple methods of sending the data:
> > >
> > >   $fp = fsockopen("udp://" . $host,$port,);
> > >   fwrite($fp,$binary_msg,$binary_msg_size);
> > >
> > >and
> > >
> > >   $sock = socket_create(AF_INET,SOCK_DGRAM,SOL_UDP);
> > >   socket_sendto($sock,$binary_msg,$binary_msg_size,0,$host,$port);
> > >
> > >In either case, a UDP packet is sent, but with a zero data size.  If I
> > >instead send the $text_msg, it works as expected.  For some reason
> sending
> > >the binary data doesn't work.
> > >
> > >Does anyone have insight into how to send binary data over UDP using
PHP?
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, visit: http://www.php.net/unsub.php

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



[PHP] Re: Client IP

2004-07-08 Thread Aidan Lister
I use the following script:

http://aidan.dotgeek.org/lib/?file=Visitor.php

As you've been told about 400 times, there's no reliable way to get the
information.

The above script checks if the client connected using a proxy, then falls
back to what the webserver sends.


"Rosen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> How can I get remote IP adress of client?
> I use the fillow script::
>
> $ip=getenv('HTTP_X_FORWARDED_FOR');
> if (!$ip)
> {
> $ip = getenv('REMOTE_ADDR');
> }
>
>
> But sometime it return me "unknown" sa IP adress.
>
> Can someone help me ?
>
> Thanks in advance!

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



[PHP] Re: help to generate codebars

2004-07-09 Thread Aidan Lister
What is a codebar?


"Vicente Vives" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello everybody,
>
> I'm looking for a way to generate codebars from the web. I found some
> ActiveX for ASP but i want to generate them using PHP :-)
>
> Do you know how?
> Do you know any library to do it?
>
>
>
> Thanks a lot.
>
>
>
> Vicente Vives.

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



[PHP] Re: Session_Start Problem (Fatal Error)

2004-07-09 Thread Aidan Lister
Did you look on the mambo forums as suggested?

<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm using Mambo Open Source CMS to run a site I'm building, and seem to
have a
> problem logging into the Administration Tool.  It comes up with:
>
> Fatal error: session_start(): Failed to initialize storage module. in
> /home/hetbweb/public_html/administrator/index.php on line 64
>
> I've looked at various things that could cause this, and finally contacted
my
> server support who said:
> "It's a PHP bug which they still havent fixed as of yet, as soon as the
fix
> becomes available we will update PHP.
> It may be worth looking on the mambo forums as there may be a patch to
resolve
> this for your script."
>
> Does anyone know about this, and if so, is there a fix or work around or
> anything?
>
> Cheers
> Nunners

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



  1   2   >